From 2dfa93408ee4786455f3ebc814207f3923dcc1f3 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 20 Apr 2023 05:45:30 +0000 Subject: [PATCH] CodeGen from PR 23641 in Azure/azure-rest-api-specs mgmt, add "timeCreated" to "VirtualMachineScaleSetVMProperties" (#23641) --- eng/versioning/version_client.txt | 1 + pom.xml | 1 + .../CHANGELOG.md | 5 + .../README.md | 105 + .../SAMPLE.md | 18242 ++++++++++++++++ .../pom.xml | 61 + .../compute/generated/ComputeManager.java | 1074 + .../fluent/AvailabilitySetsClient.java | 227 + .../CapacityReservationGroupsClient.java | 236 + .../fluent/CapacityReservationsClient.java | 335 + .../CloudServiceOperatingSystemsClient.java | 148 + .../CloudServiceRoleInstancesClient.java | 412 + .../fluent/CloudServiceRolesClient.java | 78 + .../generated/fluent/CloudServicesClient.java | 682 + .../CloudServicesUpdateDomainsClient.java | 160 + .../fluent/CommunityGalleriesClient.java | 43 + .../CommunityGalleryImageVersionsClient.java | 93 + .../fluent/CommunityGalleryImagesClient.java | 76 + .../fluent/ComputeManagementClient.java | 383 + .../fluent/DedicatedHostGroupsClient.java | 207 + .../fluent/DedicatedHostsClient.java | 408 + .../generated/fluent/DiskAccessesClient.java | 593 + .../fluent/DiskEncryptionSetsClient.java | 372 + .../fluent/DiskRestorePointsClient.java | 268 + .../compute/generated/fluent/DisksClient.java | 423 + .../generated/fluent/GalleriesClient.java | 304 + .../GalleryApplicationVersionsClient.java | 403 + .../fluent/GalleryApplicationsClient.java | 346 + .../fluent/GalleryImageVersionsClient.java | 375 + .../generated/fluent/GalleryImagesClient.java | 318 + .../fluent/GallerySharingProfilesClient.java | 80 + .../generated/fluent/ImagesClient.java | 286 + .../generated/fluent/LogAnalyticsClient.java | 144 + .../generated/fluent/OperationsClient.java | 38 + .../ProximityPlacementGroupsClient.java | 199 + .../generated/fluent/ResourceSkusClient.java | 40 + .../fluent/RestorePointCollectionsClient.java | 248 + .../generated/fluent/RestorePointsClient.java | 201 + .../fluent/SharedGalleriesClient.java | 73 + .../SharedGalleryImageVersionsClient.java | 99 + .../fluent/SharedGalleryImagesClient.java | 81 + .../generated/fluent/SnapshotsClient.java | 426 + .../generated/fluent/SshPublicKeysClient.java | 228 + .../generated/fluent/UsagesClient.java | 43 + .../VirtualMachineExtensionImagesClient.java | 120 + .../VirtualMachineExtensionsClient.java | 311 + .../fluent/VirtualMachineImagesClient.java | 219 + .../VirtualMachineImagesEdgeZonesClient.java | 213 + .../VirtualMachineRunCommandsClient.java | 353 + ...irtualMachineScaleSetExtensionsClient.java | 315 + ...lMachineScaleSetRollingUpgradesClient.java | 227 + ...tualMachineScaleSetVMExtensionsClient.java | 348 + ...ualMachineScaleSetVMRunCommandsClient.java | 346 + .../VirtualMachineScaleSetVMsClient.java | 941 + .../fluent/VirtualMachineScaleSetsClient.java | 1347 ++ .../fluent/VirtualMachineSizesClient.java | 41 + .../fluent/VirtualMachinesClient.java | 1324 ++ .../fluent/models/AccessUriInner.java | 54 + .../fluent/models/AvailabilitySetInner.java | 208 + .../models/AvailabilitySetProperties.java | 152 + .../models/CapacityReservationGroupInner.java | 127 + .../CapacityReservationGroupProperties.java | 85 + .../models/CapacityReservationInner.java | 212 + .../models/CapacityReservationProperties.java | 148 + .../fluent/models/CloudServiceInner.java | 127 + .../models/CloudServiceInstanceViewInner.java | 107 + .../fluent/models/CloudServiceRoleInner.java | 144 + .../models/CommunityGalleryIdentifier.java | 50 + .../models/CommunityGalleryImageInner.java | 351 + .../CommunityGalleryImageProperties.java | 398 + .../CommunityGalleryImageVersionInner.java | 153 + ...ommunityGalleryImageVersionProperties.java | 143 + .../fluent/models/CommunityGalleryInner.java | 33 + .../models/ComputeOperationValueDisplay.java | 84 + .../models/ComputeOperationValueInner.java | 108 + .../models/DedicatedHostGroupInner.java | 195 + .../models/DedicatedHostGroupProperties.java | 159 + .../fluent/models/DedicatedHostInner.java | 234 + .../models/DedicatedHostProperties.java | 214 + .../fluent/models/DiskAccessInner.java | 120 + .../fluent/models/DiskAccessProperties.java | 76 + .../fluent/models/DiskEncryptionSetInner.java | 230 + .../DiskEncryptionSetUpdateProperties.java | 141 + .../generated/fluent/models/DiskInner.java | 841 + .../fluent/models/DiskProperties.java | 847 + .../fluent/models/DiskRestorePointInner.java | 340 + .../models/DiskRestorePointProperties.java | 407 + .../fluent/models/DiskUpdateProperties.java | 605 + .../models/EncryptionSetProperties.java | 211 + .../models/GalleryApplicationInner.java | 233 + .../models/GalleryApplicationProperties.java | 235 + .../GalleryApplicationVersionInner.java | 129 + .../GalleryApplicationVersionProperties.java | 132 + .../fluent/models/GalleryImageInner.java | 417 + .../fluent/models/GalleryImageProperties.java | 470 + .../models/GalleryImageVersionInner.java | 152 + .../models/GalleryImageVersionProperties.java | 161 + .../generated/fluent/models/GalleryInner.java | 175 + .../fluent/models/GalleryProperties.java | 179 + .../generated/fluent/models/ImageInner.java | 178 + .../fluent/models/ImageProperties.java | 132 + .../LogAnalyticsOperationResultInner.java | 43 + .../NetworkInterfaceReferenceProperties.java | 79 + .../fluent/models/OSFamilyInner.java | 114 + .../fluent/models/OSVersionInner.java | 114 + .../PrivateEndpointConnectionInner.java | 90 + .../PrivateEndpointConnectionProperties.java | 101 + .../PrivateLinkResourceListResultInner.java | 55 + .../models/PrivateLinkResourceProperties.java | 81 + .../models/ProximityPlacementGroupInner.java | 195 + .../ProximityPlacementGroupProperties.java | 175 + .../models/RecoveryWalkResponseInner.java | 55 + .../fluent/models/ResourceSkuInner.java | 244 + .../models/RestorePointCollectionInner.java | 112 + .../RestorePointCollectionProperties.java | 105 + .../fluent/models/RestorePointInner.java | 190 + .../fluent/models/RestorePointProperties.java | 212 + ...etrieveBootDiagnosticsDataResultInner.java | 54 + .../fluent/models/RoleInstanceInner.java | 161 + .../models/RoleInstancePropertiesInner.java | 83 + .../fluent/models/RoleInstanceViewInner.java | 93 + .../models/RollingUpgradeStatusInfoInner.java | 98 + .../RollingUpgradeStatusInfoProperties.java | 100 + .../models/RunCommandDocumentBaseInner.java | 187 + .../models/RunCommandDocumentInner.java | 127 + .../fluent/models/RunCommandResultInner.java | 55 + .../models/SharedGalleryIdentifier.java | 50 + .../models/SharedGalleryImageInner.java | 351 + .../models/SharedGalleryImageProperties.java | 398 + .../SharedGalleryImageVersionInner.java | 152 + .../SharedGalleryImageVersionProperties.java | 143 + .../fluent/models/SharedGalleryInner.java | 33 + .../fluent/models/SharingUpdateInner.java | 96 + .../fluent/models/SnapshotInner.java | 624 + .../fluent/models/SnapshotProperties.java | 630 + .../models/SnapshotUpdateProperties.java | 318 + ...shPublicKeyGenerateKeyPairResultInner.java | 132 + .../models/SshPublicKeyResourceInner.java | 87 + .../SshPublicKeyResourceProperties.java | 59 + .../fluent/models/UpdateDomainInner.java | 54 + ...adeOperationHistoricalStatusInfoInner.java | 73 + .../generated/fluent/models/UsageInner.java | 140 + ...irtualMachineAssessPatchesResultInner.java | 164 + .../VirtualMachineCaptureResultInner.java | 93 + .../VirtualMachineExtensionImageInner.java | 179 + ...irtualMachineExtensionImageProperties.java | 183 + .../models/VirtualMachineExtensionInner.java | 367 + .../VirtualMachineExtensionProperties.java | 384 + ...rtualMachineExtensionUpdateProperties.java | 310 + ...rtualMachineExtensionsListResultInner.java | 54 + .../models/VirtualMachineImageInner.java | 299 + .../models/VirtualMachineImageProperties.java | 290 + .../VirtualMachineImageResourceInner.java | 164 + .../fluent/models/VirtualMachineInner.java | 843 + ...rtualMachineInstallPatchesResultInner.java | 228 + .../VirtualMachineInstanceViewInner.java | 463 + ...tworkInterfaceConfigurationProperties.java | 316 + ...orkInterfaceIpConfigurationProperties.java | 235 + .../models/VirtualMachinePropertiesInner.java | 825 + ...ublicIpAddressConfigurationProperties.java | 225 + .../models/VirtualMachineRunCommandInner.java | 398 + .../VirtualMachineRunCommandProperties.java | 454 + .../VirtualMachineScaleSetExtensionInner.java | 369 + ...ualMachineScaleSetExtensionProperties.java | 356 + .../models/VirtualMachineScaleSetInner.java | 650 + ...rtualMachineScaleSetInstanceViewInner.java | 112 + ...hineScaleSetIpConfigurationProperties.java | 272 + ...caleSetNetworkConfigurationProperties.java | 290 + .../VirtualMachineScaleSetProperties.java | 552 + ...ublicIpAddressConfigurationProperties.java | 199 + .../VirtualMachineScaleSetSkuInner.java | 77 + ...aleSetUpdateIpConfigurationProperties.java | 254 + ...tUpdateNetworkConfigurationProperties.java | 282 + ...irtualMachineScaleSetUpdateProperties.java | 367 + ...ublicIpAddressConfigurationProperties.java | 138 + ...irtualMachineScaleSetVMExtensionInner.java | 408 + ...neScaleSetVMExtensionsListResultInner.java | 55 + .../models/VirtualMachineScaleSetVMInner.java | 577 + ...ualMachineScaleSetVMInstanceViewInner.java | 473 + ...rtualMachineScaleSetVMPropertiesInner.java | 524 + .../models/VirtualMachineSizeInner.java | 191 + .../models/VirtualMachineUpdateInner.java | 790 + .../VmImagesInEdgeZoneListResultInner.java | 83 + .../generated/fluent/models/package-info.java | 6 + .../generated/fluent/package-info.java | 6 + .../implementation/AccessUriImpl.java | 36 + .../implementation/AvailabilitySetImpl.java | 266 + .../AvailabilitySetsClientImpl.java | 1476 ++ .../implementation/AvailabilitySetsImpl.java | 194 + .../CapacityReservationGroupImpl.java | 225 + .../CapacityReservationGroupsClientImpl.java | 1449 ++ .../CapacityReservationGroupsImpl.java | 199 + .../CapacityReservationImpl.java | 272 + .../CapacityReservationsClientImpl.java | 1653 ++ .../CapacityReservationsImpl.java | 238 + .../implementation/CloudServiceImpl.java | 258 + .../CloudServiceInstanceViewImpl.java | 59 + ...loudServiceOperatingSystemsClientImpl.java | 927 + .../CloudServiceOperatingSystemsImpl.java | 105 + .../implementation/CloudServiceRoleImpl.java | 54 + .../CloudServiceRoleInstancesClientImpl.java | 2073 ++ .../CloudServiceRoleInstancesImpl.java | 155 + .../CloudServiceRolesClientImpl.java | 522 + .../implementation/CloudServiceRolesImpl.java | 73 + .../CloudServicesClientImpl.java | 3575 +++ .../implementation/CloudServicesImpl.java | 245 + .../CloudServicesUpdateDomainsClientImpl.java | 898 + .../CloudServicesUpdateDomainsImpl.java | 91 + .../CommunityGalleriesClientImpl.java | 211 + .../CommunityGalleriesImpl.java | 60 + .../CommunityGalleryImageImpl.java | 110 + .../CommunityGalleryImageVersionImpl.java | 63 + ...mmunityGalleryImageVersionsClientImpl.java | 584 + .../CommunityGalleryImageVersionsImpl.java | 84 + .../CommunityGalleryImagesClientImpl.java | 516 + .../CommunityGalleryImagesImpl.java | 73 + .../implementation/CommunityGalleryImpl.java | 44 + .../ComputeManagementClientBuilder.java | 146 + .../ComputeManagementClientImpl.java | 954 + .../ComputeOperationValueImpl.java | 53 + .../DedicatedHostGroupImpl.java | 262 + .../DedicatedHostGroupsClientImpl.java | 1280 ++ .../DedicatedHostGroupsImpl.java | 176 + .../implementation/DedicatedHostImpl.java | 280 + .../DedicatedHostsClientImpl.java | 1971 ++ .../implementation/DedicatedHostsImpl.java | 209 + .../implementation/DiskAccessImpl.java | 211 + .../DiskAccessesClientImpl.java | 3004 +++ .../implementation/DiskAccessesImpl.java | 297 + .../implementation/DiskEncryptionSetImpl.java | 272 + .../DiskEncryptionSetsClientImpl.java | 1992 ++ .../DiskEncryptionSetsImpl.java | 189 + .../generated/implementation/DiskImpl.java | 592 + .../implementation/DiskRestorePointImpl.java | 117 + .../DiskRestorePointsClientImpl.java | 1381 ++ .../implementation/DiskRestorePointsImpl.java | 163 + .../implementation/DisksClientImpl.java | 2145 ++ .../generated/implementation/DisksImpl.java | 198 + .../implementation/GalleriesClientImpl.java | 1585 ++ .../implementation/GalleriesImpl.java | 182 + .../GalleryApplicationImpl.java | 288 + .../GalleryApplicationVersionImpl.java | 266 + .../GalleryApplicationVersionsClientImpl.java | 1952 ++ .../GalleryApplicationVersionsImpl.java | 270 + .../GalleryApplicationsClientImpl.java | 1614 ++ .../GalleryApplicationsImpl.java | 192 + .../implementation/GalleryImageImpl.java | 395 + .../GalleryImageVersionImpl.java | 274 + .../GalleryImageVersionsClientImpl.java | 1779 ++ .../GalleryImageVersionsImpl.java | 244 + .../GalleryImagesClientImpl.java | 1514 ++ .../implementation/GalleryImagesImpl.java | 188 + .../generated/implementation/GalleryImpl.java | 248 + .../GallerySharingProfilesClientImpl.java | 345 + .../GallerySharingProfilesImpl.java | 54 + .../generated/implementation/ImageImpl.java | 231 + .../implementation/ImagesClientImpl.java | 1535 ++ .../generated/implementation/ImagesImpl.java | 170 + .../LogAnalyticsClientImpl.java | 607 + .../implementation/LogAnalyticsImpl.java | 77 + .../LogAnalyticsOperationResultImpl.java | 34 + .../implementation/OSFamilyImpl.java | 48 + .../implementation/OSVersionImpl.java | 49 + .../implementation/OperationsClientImpl.java | 174 + .../implementation/OperationsImpl.java | 45 + .../PrivateEndpointConnectionImpl.java | 56 + .../PrivateLinkResourceListResultImpl.java | 41 + .../ProximityPlacementGroupImpl.java | 260 + .../ProximityPlacementGroupsClientImpl.java | 1298 ++ .../ProximityPlacementGroupsImpl.java | 195 + .../RecoveryWalkResponseImpl.java | 37 + .../implementation/ResourceSkuImpl.java | 117 + .../ResourceSkusClientImpl.java | 342 + .../implementation/ResourceSkusImpl.java | 45 + .../RestorePointCollectionImpl.java | 226 + .../RestorePointCollectionsClientImpl.java | 1424 ++ .../RestorePointCollectionsImpl.java | 194 + .../implementation/RestorePointImpl.java | 168 + .../RestorePointsClientImpl.java | 902 + .../implementation/RestorePointsImpl.java | 200 + ...RetrieveBootDiagnosticsDataResultImpl.java | 37 + .../implementation/RoleInstanceImpl.java | 71 + .../RoleInstancePropertiesImpl.java | 45 + .../implementation/RoleInstanceViewImpl.java | 52 + .../RollingUpgradeStatusInfoImpl.java | 76 + .../RunCommandDocumentBaseImpl.java | 50 + .../RunCommandDocumentImpl.java | 71 + .../implementation/RunCommandResultImpl.java | 40 + .../SharedGalleriesClientImpl.java | 503 + .../implementation/SharedGalleriesImpl.java | 70 + .../SharedGalleryImageImpl.java | 106 + .../SharedGalleryImageVersionImpl.java | 59 + .../SharedGalleryImageVersionsClientImpl.java | 624 + .../SharedGalleryImageVersionsImpl.java | 85 + .../SharedGalleryImagesClientImpl.java | 552 + .../SharedGalleryImagesImpl.java | 75 + .../implementation/SharedGalleryImpl.java | 40 + .../implementation/SharingUpdateImpl.java | 45 + .../implementation/SnapshotImpl.java | 461 + .../implementation/SnapshotsClientImpl.java | 2164 ++ .../implementation/SnapshotsImpl.java | 200 + ...SshPublicKeyGenerateKeyPairResultImpl.java | 41 + .../SshPublicKeyResourceImpl.java | 204 + .../SshPublicKeysClientImpl.java | 1429 ++ .../implementation/SshPublicKeysImpl.java | 198 + .../implementation/UpdateDomainImpl.java | 36 + ...radeOperationHistoricalStatusInfoImpl.java | 42 + .../generated/implementation/UsageImpl.java | 44 + .../implementation/UsagesClientImpl.java | 316 + .../generated/implementation/UsagesImpl.java | 45 + .../generated/implementation/Utils.java | 204 + ...VirtualMachineAssessPatchesResultImpl.java | 72 + .../VirtualMachineCaptureResultImpl.java | 56 + .../VirtualMachineExtensionImageImpl.java | 76 + ...rtualMachineExtensionImagesClientImpl.java | 610 + .../VirtualMachineExtensionImagesImpl.java | 137 + .../VirtualMachineExtensionImpl.java | 354 + .../VirtualMachineExtensionsClientImpl.java | 1391 ++ .../VirtualMachineExtensionsImpl.java | 208 + ...irtualMachineExtensionsListResultImpl.java | 48 + .../VirtualMachineImageImpl.java | 113 + .../VirtualMachineImageResourceImpl.java | 57 + .../VirtualMachineImagesClientImpl.java | 1115 + ...rtualMachineImagesEdgeZonesClientImpl.java | 1071 + .../VirtualMachineImagesEdgeZonesImpl.java | 221 + .../VirtualMachineImagesImpl.java | 230 + .../implementation/VirtualMachineImpl.java | 743 + ...irtualMachineInstallPatchesResultImpl.java | 89 + .../VirtualMachineInstanceViewImpl.java | 119 + .../VirtualMachinePropertiesImpl.java | 155 + .../VirtualMachineRunCommandImpl.java | 376 + .../VirtualMachineRunCommandsClientImpl.java | 1911 ++ .../VirtualMachineRunCommandsImpl.java | 238 + .../VirtualMachineScaleSetExtensionImpl.java | 314 + ...alMachineScaleSetExtensionsClientImpl.java | 1533 ++ .../VirtualMachineScaleSetExtensionsImpl.java | 208 + .../VirtualMachineScaleSetImpl.java | 605 + ...irtualMachineScaleSetInstanceViewImpl.java | 66 + ...hineScaleSetRollingUpgradesClientImpl.java | 992 + ...ualMachineScaleSetRollingUpgradesImpl.java | 85 + .../VirtualMachineScaleSetSkuImpl.java | 43 + ...VirtualMachineScaleSetVMExtensionImpl.java | 351 + ...MachineScaleSetVMExtensionsClientImpl.java | 1540 ++ ...irtualMachineScaleSetVMExtensionsImpl.java | 262 + ...ineScaleSetVMExtensionsListResultImpl.java | 49 + .../VirtualMachineScaleSetVMImpl.java | 192 + ...tualMachineScaleSetVMInstanceViewImpl.java | 118 + ...irtualMachineScaleSetVMPropertiesImpl.java | 119 + ...achineScaleSetVMRunCommandsClientImpl.java | 1668 ++ ...rtualMachineScaleSetVMRunCommandsImpl.java | 163 + .../VirtualMachineScaleSetVMsClientImpl.java | 4530 ++++ .../VirtualMachineScaleSetVMsImpl.java | 291 + .../VirtualMachineScaleSetsClientImpl.java | 7030 ++++++ .../VirtualMachineScaleSetsImpl.java | 459 + .../VirtualMachineSizeImpl.java | 53 + .../VirtualMachineSizesClientImpl.java | 215 + .../VirtualMachineSizesImpl.java | 46 + .../VirtualMachineUpdateImpl.java | 186 + .../VirtualMachinesClientImpl.java | 6502 ++++++ .../implementation/VirtualMachinesImpl.java | 447 + .../VmImagesInEdgeZoneListResultImpl.java | 52 + .../implementation/package-info.java | 6 + .../compute/generated/models/AccessLevel.java | 50 + .../compute/generated/models/AccessUri.java | 31 + .../models/AdditionalCapabilities.java | 82 + .../models/AdditionalUnattendContent.java | 142 + .../models/AggregatedReplicationState.java | 53 + .../generated/models/AlternativeOption.java | 79 + .../generated/models/AlternativeType.java | 50 + .../generated/models/ApiEntityReference.java | 52 + .../compute/generated/models/ApiError.java | 43 + .../generated/models/ApiErrorException.java | 38 + .../generated/models/ApplicationProfile.java | 56 + .../generated/models/Architecture.java | 47 + .../generated/models/ArchitectureTypes.java | 47 + .../models/AutomaticOSUpgradePolicy.java | 121 + .../models/AutomaticOSUpgradeProperties.java | 50 + .../models/AutomaticRepairsPolicy.java | 117 + .../generated/models/AvailabilitySet.java | 368 + .../models/AvailabilitySetListResult.java | 91 + .../models/AvailabilitySetUpdate.java | 190 + .../generated/models/AvailabilitySets.java | 205 + .../models/AvailablePatchSummary.java | 157 + .../generated/models/BillingProfile.java | 76 + .../generated/models/BootDiagnostics.java | 83 + .../models/BootDiagnosticsInstanceView.java | 78 + .../generated/models/CachingTypes.java | 57 + .../generated/models/CapacityReservation.java | 328 + .../models/CapacityReservationGroup.java | 247 + .../CapacityReservationGroupInstanceView.java | 44 + ...cityReservationGroupInstanceViewTypes.java | 45 + .../CapacityReservationGroupListResult.java | 92 + .../CapacityReservationGroupUpdate.java | 84 + .../models/CapacityReservationGroups.java | 210 + .../CapacityReservationInstanceView.java | 86 + .../CapacityReservationInstanceViewTypes.java | 45 + ...pacityReservationInstanceViewWithName.java | 59 + .../models/CapacityReservationListResult.java | 92 + .../models/CapacityReservationProfile.java | 57 + .../models/CapacityReservationUpdate.java | 162 + .../CapacityReservationUtilization.java | 61 + .../models/CapacityReservations.java | 177 + .../generated/models/CloudService.java | 389 + .../models/CloudServiceExtensionProfile.java | 54 + .../CloudServiceExtensionProperties.java | 321 + .../models/CloudServiceInstanceView.java | 48 + .../models/CloudServiceListResult.java | 91 + .../models/CloudServiceNetworkProfile.java | 123 + .../models/CloudServiceOperatingSystems.java | 136 + .../models/CloudServiceOsProfile.java | 54 + .../models/CloudServiceProperties.java | 368 + .../generated/models/CloudServiceRole.java | 59 + .../models/CloudServiceRoleInstances.java | 251 + .../models/CloudServiceRoleListResult.java | 92 + .../models/CloudServiceRoleProfile.java | 54 + .../CloudServiceRoleProfileProperties.java | 79 + .../models/CloudServiceRoleProperties.java | 39 + .../generated/models/CloudServiceRoleSku.java | 107 + .../generated/models/CloudServiceRoles.java | 71 + .../models/CloudServiceSlotType.java | 50 + .../generated/models/CloudServiceUpdate.java | 53 + .../models/CloudServiceUpgradeMode.java | 57 + .../CloudServiceVaultAndSecretReference.java | 79 + .../models/CloudServiceVaultCertificate.java | 55 + .../models/CloudServiceVaultSecretGroup.java | 83 + .../generated/models/CloudServices.java | 364 + .../models/CloudServicesUpdateDomains.java | 109 + .../generated/models/CommunityGalleries.java | 38 + .../generated/models/CommunityGallery.java | 45 + .../models/CommunityGalleryImage.java | 138 + .../models/CommunityGalleryImageList.java | 91 + .../models/CommunityGalleryImageVersion.java | 78 + .../CommunityGalleryImageVersionList.java | 92 + .../models/CommunityGalleryImageVersions.java | 86 + .../models/CommunityGalleryImages.java | 69 + .../models/CommunityGalleryInfo.java | 163 + .../generated/models/ComponentNames.java | 48 + .../models/ComputeOperationListResult.java | 44 + .../models/ComputeOperationValue.java | 59 + .../models/ConfidentialVMEncryptionType.java | 51 + .../models/ConsistencyModeTypes.java | 53 + .../generated/models/CopyCompletionError.java | 94 + .../models/CopyCompletionErrorReason.java | 44 + .../generated/models/CreationData.java | 339 + .../generated/models/DataAccessAuthMode.java | 47 + .../compute/generated/models/DataDisk.java | 448 + .../generated/models/DataDiskImage.java | 41 + .../models/DataDiskImageEncryption.java | 64 + .../generated/models/DedicatedHost.java | 414 + .../models/DedicatedHostAllocatableVM.java | 78 + .../DedicatedHostAvailableCapacity.java | 57 + .../generated/models/DedicatedHostGroup.java | 365 + .../DedicatedHostGroupInstanceView.java | 54 + .../models/DedicatedHostGroupListResult.java | 92 + ...GroupPropertiesAdditionalCapabilities.java | 65 + .../models/DedicatedHostGroupUpdate.java | 186 + .../generated/models/DedicatedHostGroups.java | 187 + .../models/DedicatedHostInstanceView.java | 99 + .../DedicatedHostInstanceViewWithName.java | 59 + .../models/DedicatedHostLicenseTypes.java | 57 + .../models/DedicatedHostListResult.java | 91 + .../models/DedicatedHostSizeListResult.java | 51 + .../generated/models/DedicatedHostUpdate.java | 221 + .../generated/models/DedicatedHosts.java | 223 + .../generated/models/DeleteOptions.java | 47 + .../generated/models/DiagnosticsProfile.java | 62 + .../generated/models/DiffDiskOptions.java | 44 + .../generated/models/DiffDiskPlacement.java | 53 + .../generated/models/DiffDiskSettings.java | 91 + .../compute/generated/models/Disallowed.java | 51 + .../models/DisallowedConfiguration.java | 50 + .../compute/generated/models/Disk.java | 1113 + .../compute/generated/models/DiskAccess.java | 243 + .../generated/models/DiskAccessList.java | 91 + .../generated/models/DiskAccessUpdate.java | 53 + .../generated/models/DiskAccesses.java | 356 + .../generated/models/DiskControllerTypes.java | 54 + .../generated/models/DiskCreateOption.java | 71 + .../models/DiskCreateOptionTypes.java | 55 + .../models/DiskDeleteOptionTypes.java | 52 + .../models/DiskDetachOptionTypes.java | 52 + .../generated/models/DiskEncryptionSet.java | 394 + .../models/DiskEncryptionSetIdentityType.java | 58 + .../models/DiskEncryptionSetList.java | 91 + .../models/DiskEncryptionSetParameters.java | 35 + .../models/DiskEncryptionSetType.java | 53 + .../models/DiskEncryptionSetUpdate.java | 202 + .../generated/models/DiskEncryptionSets.java | 210 + .../models/DiskEncryptionSettings.java | 110 + .../generated/models/DiskImageEncryption.java | 50 + .../generated/models/DiskInstanceView.java | 111 + .../compute/generated/models/DiskList.java | 89 + .../generated/models/DiskRestorePoint.java | 164 + .../models/DiskRestorePointAttributes.java | 87 + .../models/DiskRestorePointInstanceView.java | 79 + .../models/DiskRestorePointList.java | 91 + .../DiskRestorePointReplicationStatus.java | 79 + .../generated/models/DiskRestorePoints.java | 165 + .../generated/models/DiskSecurityProfile.java | 79 + .../generated/models/DiskSecurityTypes.java | 56 + .../compute/generated/models/DiskSku.java | 68 + .../compute/generated/models/DiskState.java | 65 + .../models/DiskStorageAccountTypes.java | 62 + .../compute/generated/models/DiskUpdate.java | 584 + .../compute/generated/models/Disks.java | 221 + .../compute/generated/models/Encryption.java | 78 + .../generated/models/EncryptionImages.java | 85 + .../models/EncryptionSetIdentity.java | 142 + .../models/EncryptionSettingsCollection.java | 117 + .../models/EncryptionSettingsElement.java | 85 + .../generated/models/EncryptionType.java | 53 + .../generated/models/ExecutionState.java | 62 + .../models/ExpandTypeForListVMs.java | 44 + ...dTypesForGetCapacityReservationGroups.java | 50 + .../models/ExpandTypesForGetVMScaleSets.java | 44 + .../models/ExpandTypesForListVMs.java | 44 + .../generated/models/ExtendedLocation.java | 76 + .../models/ExtendedLocationType.java | 44 + .../models/ExtendedLocationTypes.java | 44 + .../compute/generated/models/Extension.java | 79 + .../compute/generated/models/Galleries.java | 180 + .../compute/generated/models/Gallery.java | 337 + .../generated/models/GalleryApplication.java | 433 + .../GalleryApplicationCustomAction.java | 147 + ...lleryApplicationCustomActionParameter.java | 166 + ...yApplicationCustomActionParameterType.java | 57 + .../models/GalleryApplicationList.java | 91 + .../models/GalleryApplicationUpdate.java | 226 + .../models/GalleryApplicationVersion.java | 277 + .../models/GalleryApplicationVersionList.java | 92 + ...ryApplicationVersionPublishingProfile.java | 265 + ...alleryApplicationVersionSafetyProfile.java | 33 + .../GalleryApplicationVersionUpdate.java | 120 + .../models/GalleryApplicationVersions.java | 189 + .../generated/models/GalleryApplications.java | 161 + .../GalleryArtifactPublishingProfileBase.java | 247 + .../GalleryArtifactSafetyProfileBase.java | 53 + .../GalleryArtifactVersionFullSource.java | 62 + .../models/GalleryArtifactVersionSource.java | 53 + .../models/GalleryDataDiskImage.java | 71 + .../generated/models/GalleryDiskImage.java | 94 + .../models/GalleryDiskImageSource.java | 87 + .../generated/models/GalleryExpandParams.java | 44 + .../models/GalleryExtendedLocation.java | 76 + .../models/GalleryExtendedLocationType.java | 47 + .../generated/models/GalleryIdentifier.java | 40 + .../generated/models/GalleryImage.java | 655 + .../generated/models/GalleryImageFeature.java | 76 + .../models/GalleryImageIdentifier.java | 121 + .../generated/models/GalleryImageList.java | 91 + .../generated/models/GalleryImageUpdate.java | 402 + .../generated/models/GalleryImageVersion.java | 307 + .../models/GalleryImageVersionList.java | 91 + .../GalleryImageVersionPublishingProfile.java | 77 + .../GalleryImageVersionSafetyProfile.java | 70 + .../GalleryImageVersionStorageProfile.java | 112 + .../models/GalleryImageVersionUpdate.java | 142 + .../models/GalleryImageVersions.java | 178 + .../generated/models/GalleryImages.java | 155 + .../compute/generated/models/GalleryList.java | 90 + .../generated/models/GalleryOSDiskImage.java | 39 + .../models/GalleryProvisioningState.java | 63 + .../models/GallerySharingPermissionTypes.java | 53 + .../models/GallerySharingProfiles.java | 41 + .../models/GalleryTargetExtendedLocation.java | 167 + .../generated/models/GalleryUpdate.java | 165 + .../generated/models/GrantAccessData.java | 110 + .../generated/models/HardwareProfile.java | 114 + .../compute/generated/models/HostCaching.java | 54 + .../generated/models/HyperVGeneration.java | 47 + .../models/HyperVGenerationType.java | 47 + .../models/HyperVGenerationTypes.java | 47 + .../compute/generated/models/Image.java | 329 + .../generated/models/ImageDataDisk.java | 105 + .../models/ImageDeprecationStatus.java | 111 + .../compute/generated/models/ImageDisk.java | 221 + .../generated/models/ImageDiskReference.java | 138 + .../generated/models/ImageListResult.java | 90 + .../compute/generated/models/ImageOSDisk.java | 144 + .../generated/models/ImagePurchasePlan.java | 102 + .../generated/models/ImageReference.java | 240 + .../compute/generated/models/ImageState.java | 50 + .../generated/models/ImageStorageProfile.java | 124 + .../compute/generated/models/ImageUpdate.java | 138 + .../compute/generated/models/Images.java | 172 + .../compute/generated/models/InnerError.java | 76 + .../compute/generated/models/InstanceSku.java | 54 + .../generated/models/InstanceViewStatus.java | 155 + .../models/InstanceViewStatusesSummary.java | 43 + .../generated/models/InstanceViewTypes.java | 51 + .../generated/models/IntervalInMins.java | 57 + .../compute/generated/models/IpVersion.java | 50 + .../compute/generated/models/IpVersions.java | 50 + .../models/KeyForDiskEncryptionSet.java | 93 + .../models/KeyVaultAndKeyReference.java | 92 + .../models/KeyVaultAndSecretReference.java | 93 + .../models/KeyVaultKeyReference.java | 91 + .../models/KeyVaultSecretReference.java | 92 + .../models/LastPatchInstallationSummary.java | 205 + .../generated/models/LinuxConfiguration.java | 172 + .../generated/models/LinuxParameters.java | 138 + .../models/LinuxPatchAssessmentMode.java | 52 + .../generated/models/LinuxPatchSettings.java | 129 + ...PatchAutomaticByPlatformRebootSetting.java | 54 + ...GuestPatchAutomaticByPlatformSettings.java | 84 + .../models/LinuxVMGuestPatchMode.java | 53 + .../generated/models/ListUsagesResult.java | 91 + .../models/LoadBalancerConfiguration.java | 118 + .../LoadBalancerConfigurationProperties.java | 69 + .../LoadBalancerFrontendIpConfiguration.java | 100 + ...ncerFrontendIpConfigurationProperties.java | 103 + .../generated/models/LogAnalytics.java | 68 + .../models/LogAnalyticsInputBase.java | 254 + .../models/LogAnalyticsOperationResult.java | 24 + .../generated/models/LogAnalyticsOutput.java | 39 + .../MaintenanceOperationResultCodeTypes.java | 57 + .../models/MaintenanceRedeployStatus.java | 209 + .../models/ManagedDiskParameters.java | 121 + .../generated/models/NetworkAccessPolicy.java | 50 + .../generated/models/NetworkApiVersion.java | 47 + .../models/NetworkInterfaceReference.java | 99 + .../generated/models/NetworkProfile.java | 117 + .../compute/generated/models/OSDisk.java | 409 + .../compute/generated/models/OSDiskImage.java | 58 + .../models/OSDiskImageEncryption.java | 62 + .../models/OSDiskImageSecurityProfile.java | 77 + .../compute/generated/models/OSFamily.java | 52 + .../generated/models/OSFamilyListResult.java | 91 + .../generated/models/OSFamilyProperties.java | 73 + .../models/OSImageNotificationProfile.java | 82 + .../compute/generated/models/OSProfile.java | 368 + .../models/OSProfileProvisioningData.java | 125 + .../compute/generated/models/OSVersion.java | 52 + .../generated/models/OSVersionListResult.java | 91 + .../generated/models/OSVersionProperties.java | 114 + .../models/OSVersionPropertiesBase.java | 84 + .../models/OperatingSystemStateTypes.java | 54 + .../generated/models/OperatingSystemType.java | 47 + .../models/OperatingSystemTypes.java | 54 + .../compute/generated/models/Operations.java | 33 + .../generated/models/OrchestrationMode.java | 47 + .../models/OrchestrationServiceNames.java | 44 + .../models/OrchestrationServiceState.java | 50 + .../OrchestrationServiceStateAction.java | 47 + .../OrchestrationServiceStateInput.java | 91 + .../models/OrchestrationServiceSummary.java | 54 + .../compute/generated/models/PassNames.java | 48 + .../models/PatchAssessmentState.java | 47 + .../models/PatchInstallationDetail.java | 116 + .../models/PatchInstallationState.java | 59 + .../models/PatchOperationStatus.java | 59 + .../generated/models/PatchSettings.java | 169 + .../models/PirCommunityGalleryResource.java | 111 + .../compute/generated/models/PirResource.java | 54 + .../models/PirSharedGalleryResource.java | 68 + .../compute/generated/models/Plan.java | 136 + .../generated/models/PolicyViolation.java | 76 + .../models/PolicyViolationCategory.java | 53 + .../generated/models/PriorityMixPolicy.java | 85 + .../generated/models/PrivateEndpoint.java | 39 + .../models/PrivateEndpointConnection.java | 60 + .../PrivateEndpointConnectionListResult.java | 83 + ...teEndpointConnectionProvisioningState.java | 54 + ...rivateEndpointServiceConnectionStatus.java | 51 + .../generated/models/PrivateLinkResource.java | 130 + .../models/PrivateLinkResourceListResult.java | 26 + .../PrivateLinkServiceConnectionState.java | 106 + .../models/PropertyUpdatesInProgress.java | 50 + .../generated/models/ProtocolTypes.java | 51 + .../models/ProximityPlacementGroup.java | 305 + .../ProximityPlacementGroupListResult.java | 89 + ...oximityPlacementGroupPropertiesIntent.java | 53 + .../models/ProximityPlacementGroupType.java | 50 + .../models/ProximityPlacementGroupUpdate.java | 33 + .../models/ProximityPlacementGroups.java | 175 + .../generated/models/ProxyOnlyResource.java | 69 + .../generated/models/PublicIpAddressSku.java | 76 + .../models/PublicIpAddressSkuName.java | 47 + .../models/PublicIpAddressSkuTier.java | 47 + .../models/PublicIpAllocationMethod.java | 47 + .../generated/models/PublicNetworkAccess.java | 47 + .../generated/models/PurchasePlan.java | 123 + .../models/PurchasePlanAutoGenerated.java | 151 + .../RecommendedMachineConfiguration.java | 85 + .../models/RecoveryWalkResponse.java | 32 + .../models/RegionalReplicationStatus.java | 84 + .../models/RegionalSharingStatus.java | 95 + .../generated/models/RepairAction.java | 53 + .../generated/models/ReplicationMode.java | 47 + .../generated/models/ReplicationState.java | 53 + .../generated/models/ReplicationStatus.java | 59 + .../models/ReplicationStatusTypes.java | 44 + .../models/RequestRateByIntervalInput.java | 118 + .../models/ResourceIdentityType.java | 61 + .../models/ResourceInstanceViewStatus.java | 111 + .../generated/models/ResourceRange.java | 76 + .../compute/generated/models/ResourceSku.java | 112 + .../models/ResourceSkuCapabilities.java | 54 + .../generated/models/ResourceSkuCapacity.java | 84 + .../models/ResourceSkuCapacityScaleType.java | 54 + .../generated/models/ResourceSkuCosts.java | 69 + .../models/ResourceSkuLocationInfo.java | 103 + .../models/ResourceSkuRestrictionInfo.java | 55 + .../models/ResourceSkuRestrictions.java | 90 + .../ResourceSkuRestrictionsReasonCode.java | 51 + .../models/ResourceSkuRestrictionsType.java | 51 + .../models/ResourceSkuZoneDetails.java | 59 + .../generated/models/ResourceSkus.java | 35 + .../generated/models/ResourceSkusResult.java | 91 + .../generated/models/ResourceUriList.java | 88 + .../models/ResourceWithOptionalLocation.java | 39 + .../generated/models/RestorePoint.java | 213 + .../models/RestorePointCollection.java | 252 + .../RestorePointCollectionExpandOptions.java | 45 + .../RestorePointCollectionListResult.java | 84 + ...estorePointCollectionSourceProperties.java | 65 + .../models/RestorePointCollectionUpdate.java | 107 + .../models/RestorePointCollections.java | 188 + .../models/RestorePointEncryption.java | 88 + .../models/RestorePointEncryptionType.java | 53 + .../models/RestorePointExpandOptions.java | 44 + .../models/RestorePointInstanceView.java | 83 + .../models/RestorePointSourceMetadata.java | 205 + .../models/RestorePointSourceVMDataDisk.java | 158 + .../RestorePointSourceVMStorageProfile.java | 83 + .../models/RestorePointSourceVmosDisk.java | 175 + .../generated/models/RestorePoints.java | 132 + .../RetrieveBootDiagnosticsDataResult.java | 32 + .../generated/models/RoleInstance.java | 67 + .../models/RoleInstanceListResult.java | 91 + .../models/RoleInstanceNetworkProfile.java | 42 + .../models/RoleInstanceProperties.java | 31 + .../generated/models/RoleInstanceView.java | 48 + .../generated/models/RoleInstances.java | 61 + .../generated/models/RollbackStatusInfo.java | 73 + .../models/RollingUpgradeActionType.java | 51 + .../models/RollingUpgradePolicy.java | 274 + .../models/RollingUpgradeProgressInfo.java | 84 + .../models/RollingUpgradeRunningStatus.java | 85 + .../models/RollingUpgradeStatusCode.java | 57 + .../models/RollingUpgradeStatusInfo.java | 81 + .../generated/models/RunCommandDocument.java | 67 + .../models/RunCommandDocumentBase.java | 52 + .../generated/models/RunCommandInput.java | 117 + .../models/RunCommandInputParameter.java | 89 + .../models/RunCommandListResult.java | 91 + .../models/RunCommandManagedIdentity.java | 88 + .../models/RunCommandParameterDefinition.java | 143 + .../generated/models/RunCommandResult.java | 25 + .../generated/models/ScaleInPolicy.java | 112 + .../models/ScheduledEventsProfile.java | 84 + .../models/SecurityEncryptionTypes.java | 51 + .../models/SecurityPostureReference.java | 88 + .../generated/models/SecurityProfile.java | 122 + .../generated/models/SecurityTypes.java | 50 + .../generated/models/SelectPermissions.java | 44 + .../models/ServiceArtifactReference.java | 56 + .../generated/models/SettingNames.java | 54 + .../generated/models/ShareInfoElement.java | 39 + .../generated/models/SharedGalleries.java | 65 + .../generated/models/SharedGallery.java | 38 + .../models/SharedGalleryDataDiskImage.java | 64 + .../models/SharedGalleryDiskImage.java | 65 + .../models/SharedGalleryHostCaching.java | 50 + .../generated/models/SharedGalleryImage.java | 131 + .../models/SharedGalleryImageList.java | 91 + .../models/SharedGalleryImageVersion.java | 70 + .../models/SharedGalleryImageVersionList.java | 92 + ...aredGalleryImageVersionStorageProfile.java | 83 + .../models/SharedGalleryImageVersions.java | 90 + .../generated/models/SharedGalleryImages.java | 73 + .../generated/models/SharedGalleryList.java | 91 + .../models/SharedGalleryOSDiskImage.java | 32 + .../generated/models/SharedToValues.java | 44 + .../generated/models/SharingProfile.java | 105 + .../generated/models/SharingProfileGroup.java | 80 + .../models/SharingProfileGroupTypes.java | 50 + .../generated/models/SharingState.java | 57 + .../generated/models/SharingStatus.java | 73 + .../generated/models/SharingUpdate.java | 34 + .../models/SharingUpdateOperationTypes.java | 56 + .../compute/generated/models/Sku.java | 108 + .../compute/generated/models/Snapshot.java | 823 + .../generated/models/SnapshotList.java | 90 + .../compute/generated/models/SnapshotSku.java | 68 + .../models/SnapshotStorageAccountTypes.java | 50 + .../generated/models/SnapshotUpdate.java | 350 + .../compute/generated/models/Snapshots.java | 222 + .../generated/models/SoftDeletePolicy.java | 52 + .../compute/generated/models/SourceVault.java | 53 + .../generated/models/SpotRestorePolicy.java | 86 + .../generated/models/SshConfiguration.java | 54 + .../generated/models/SshPublicKey.java | 87 + .../SshPublicKeyGenerateKeyPairResult.java | 42 + .../models/SshPublicKeyResource.java | 266 + .../models/SshPublicKeyUpdateResource.java | 82 + .../generated/models/SshPublicKeys.java | 205 + .../models/SshPublicKeysGroupListResult.java | 92 + .../generated/models/StatusCodeCount.java | 54 + .../generated/models/StatusLevelTypes.java | 54 + .../generated/models/StorageAccountType.java | 53 + .../generated/models/StorageAccountTypes.java | 70 + .../generated/models/StorageProfile.java | 171 + .../generated/models/SubResourceReadOnly.java | 39 + .../SubResourceWithColocationStatus.java | 61 + .../models/SupportedCapabilities.java | 106 + .../generated/models/TargetRegion.java | 174 + .../models/TerminateNotificationProfile.java | 82 + .../models/ThrottledRequestsInput.java | 82 + .../generated/models/UefiSettings.java | 83 + .../generated/models/UpdateDomain.java | 31 + .../models/UpdateDomainListResult.java | 91 + .../generated/models/UpdateResource.java | 53 + .../models/UpdateResourceDefinition.java | 54 + .../compute/generated/models/UpgradeMode.java | 59 + .../UpgradeOperationHistoricalStatusInfo.java | 39 + ...erationHistoricalStatusInfoProperties.java | 129 + .../models/UpgradeOperationHistoryStatus.java | 70 + .../models/UpgradeOperationInvoker.java | 54 + .../generated/models/UpgradePolicy.java | 117 + .../generated/models/UpgradeState.java | 57 + .../compute/generated/models/Usage.java | 45 + .../compute/generated/models/UsageName.java | 76 + .../compute/generated/models/Usages.java | 38 + .../generated/models/UserArtifactManage.java | 125 + .../models/UserArtifactSettings.java | 89 + .../generated/models/UserArtifactSource.java | 86 + .../models/UserAssignedIdentitiesValue.java | 54 + .../models/VMDiskSecurityProfile.java | 88 + .../models/VMGalleryApplication.java | 200 + .../VMGuestPatchClassificationLinux.java | 50 + .../VMGuestPatchClassificationWindows.java | 65 + .../models/VMGuestPatchRebootBehavior.java | 53 + .../models/VMGuestPatchRebootSetting.java | 50 + .../models/VMGuestPatchRebootStatus.java | 59 + ...SetConvertToSinglePlacementGroupInput.java | 56 + .../generated/models/VMSizeProperties.java | 96 + .../generated/models/VaultCertificate.java | 114 + .../generated/models/VaultSecretGroup.java | 83 + .../generated/models/VirtualHardDisk.java | 50 + .../generated/models/VirtualMachine.java | 1598 ++ .../VirtualMachineAgentInstanceView.java | 110 + .../VirtualMachineAssessPatchesResult.java | 82 + .../VirtualMachineCaptureParameters.java | 119 + .../models/VirtualMachineCaptureResult.java | 53 + .../VirtualMachineEvictionPolicyTypes.java | 47 + .../models/VirtualMachineExtension.java | 580 + ...alMachineExtensionHandlerInstanceView.java | 105 + .../models/VirtualMachineExtensionImage.java | 92 + .../models/VirtualMachineExtensionImages.java | 111 + .../VirtualMachineExtensionInstanceView.java | 161 + .../models/VirtualMachineExtensionUpdate.java | 300 + .../models/VirtualMachineExtensions.java | 155 + .../VirtualMachineExtensionsListResult.java | 26 + .../models/VirtualMachineHealthStatus.java | 42 + .../models/VirtualMachineIdentity.java | 136 + .../generated/models/VirtualMachineImage.java | 119 + .../models/VirtualMachineImageFeature.java | 76 + .../models/VirtualMachineImageResource.java | 55 + .../models/VirtualMachineImages.java | 202 + .../models/VirtualMachineImagesEdgeZones.java | 198 + ...irtualMachineInstallPatchesParameters.java | 146 + .../VirtualMachineInstallPatchesResult.java | 113 + .../models/VirtualMachineInstanceView.java | 134 + .../generated/models/VirtualMachineIpTag.java | 76 + .../models/VirtualMachineListResult.java | 90 + ...lMachineNetworkInterfaceConfiguration.java | 319 + ...workInterfaceDnsSettingsConfiguration.java | 51 + ...achineNetworkInterfaceIpConfiguration.java | 258 + .../models/VirtualMachinePatchStatus.java | 106 + .../models/VirtualMachinePriorityTypes.java | 53 + .../models/VirtualMachineProperties.java | 243 + ...alMachinePublicIpAddressConfiguration.java | 274 + ...blicIpAddressDnsSettingsConfiguration.java | 64 + .../VirtualMachineReimageParameters.java | 111 + .../models/VirtualMachineRunCommand.java | 661 + .../VirtualMachineRunCommandInstanceView.java | 237 + .../VirtualMachineRunCommandScriptSource.java | 147 + .../VirtualMachineRunCommandUpdate.java | 389 + .../models/VirtualMachineRunCommands.java | 204 + .../VirtualMachineRunCommandsListResult.java | 89 + .../models/VirtualMachineScaleSet.java | 1149 + .../VirtualMachineScaleSetDataDisk.java | 329 + .../VirtualMachineScaleSetExtension.java | 520 + ...ualMachineScaleSetExtensionListResult.java | 92 + ...irtualMachineScaleSetExtensionProfile.java | 88 + ...VirtualMachineScaleSetExtensionUpdate.java | 357 + .../VirtualMachineScaleSetExtensions.java | 155 + ...VirtualMachineScaleSetHardwareProfile.java | 58 + .../VirtualMachineScaleSetIdentity.java | 136 + .../VirtualMachineScaleSetInstanceView.java | 47 + ...neScaleSetInstanceViewStatusesSummary.java | 43 + ...VirtualMachineScaleSetIpConfiguration.java | 286 + .../models/VirtualMachineScaleSetIpTag.java | 76 + ...alMachineScaleSetListOSUpgradeHistory.java | 92 + .../VirtualMachineScaleSetListResult.java | 92 + .../VirtualMachineScaleSetListSkusResult.java | 92 + ...tualMachineScaleSetListWithLinkResult.java | 92 + ...lMachineScaleSetManagedDiskParameters.java | 114 + ...alMachineScaleSetNetworkConfiguration.java | 296 + ...aleSetNetworkConfigurationDnsSettings.java | 51 + .../VirtualMachineScaleSetNetworkProfile.java | 121 + .../models/VirtualMachineScaleSetOSDisk.java | 370 + .../VirtualMachineScaleSetOSProfile.java | 349 + ...eScaleSetPublicIpAddressConfiguration.java | 253 + ...blicIpAddressConfigurationDnsSettings.java | 64 + ...rtualMachineScaleSetReimageParameters.java | 79 + ...VirtualMachineScaleSetRollingUpgrades.java | 118 + .../VirtualMachineScaleSetScaleInRules.java | 50 + .../models/VirtualMachineScaleSetSku.java | 38 + .../VirtualMachineScaleSetSkuCapacity.java | 84 + .../VirtualMachineScaleSetSkuScaleType.java | 51 + .../VirtualMachineScaleSetStorageProfile.java | 156 + .../models/VirtualMachineScaleSetUpdate.java | 414 + ...lMachineScaleSetUpdateIpConfiguration.java | 268 + ...ineScaleSetUpdateNetworkConfiguration.java | 288 + ...alMachineScaleSetUpdateNetworkProfile.java | 121 + .../VirtualMachineScaleSetUpdateOSDisk.java | 243 + ...VirtualMachineScaleSetUpdateOSProfile.java | 138 + ...SetUpdatePublicIpAddressConfiguration.java | 165 + ...alMachineScaleSetUpdateStorageProfile.java | 138 + ...VirtualMachineScaleSetUpdateVMProfile.java | 349 + .../models/VirtualMachineScaleSetVM.java | 248 + .../VirtualMachineScaleSetVMExtension.java | 560 + ...rtualMachineScaleSetVMExtensionUpdate.java | 322 + .../VirtualMachineScaleSetVMExtensions.java | 169 + ...MachineScaleSetVMExtensionsListResult.java | 27 + ...ualMachineScaleSetVMExtensionsSummary.java | 58 + .../VirtualMachineScaleSetVMInstanceIDs.java | 56 + ...lMachineScaleSetVMInstanceRequiredIDs.java | 60 + .../VirtualMachineScaleSetVMInstanceView.java | 140 + .../VirtualMachineScaleSetVMListResult.java | 92 + ...ScaleSetVMNetworkProfileConfiguration.java | 55 + .../VirtualMachineScaleSetVMProfile.java | 569 + .../VirtualMachineScaleSetVMProperties.java | 166 + ...tualMachineScaleSetVMProtectionPolicy.java | 82 + ...ualMachineScaleSetVMReimageParameters.java | 46 + .../VirtualMachineScaleSetVMRunCommands.java | 201 + .../models/VirtualMachineScaleSetVMs.java | 514 + .../models/VirtualMachineScaleSets.java | 751 + .../generated/models/VirtualMachineSize.java | 63 + .../models/VirtualMachineSizeListResult.java | 55 + .../models/VirtualMachineSizeTypes.java | 549 + .../generated/models/VirtualMachineSizes.java | 36 + ...VirtualMachineSoftwarePatchProperties.java | 178 + .../models/VirtualMachineStatusCodeCount.java | 54 + .../models/VirtualMachineUpdate.java | 277 + .../generated/models/VirtualMachines.java | 732 + .../compute/generated/models/VmDiskTypes.java | 47 + .../models/VmImagesInEdgeZoneListResult.java | 34 + .../generated/models/WinRMConfiguration.java | 54 + .../generated/models/WinRMListener.java | 102 + .../models/WindowsConfiguration.java | 246 + .../generated/models/WindowsParameters.java | 163 + .../models/WindowsPatchAssessmentMode.java | 52 + ...PatchAutomaticByPlatformRebootSetting.java | 54 + ...GuestPatchAutomaticByPlatformSettings.java | 85 + .../models/WindowsVMGuestPatchMode.java | 59 + .../generated/models/package-info.java | 6 + .../compute/generated/package-info.java | 6 + .../src/main/java/module-info.java | 19 + ...AvailabilitySetsCreateOrUpdateSamples.java | 27 + .../AvailabilitySetsDeleteSamples.java | 38 + ...labilitySetsGetByResourceGroupSamples.java | 38 + ...labilitySetsListAvailableSizesSamples.java | 36 + ...abilitySetsListByResourceGroupSamples.java | 34 + .../AvailabilitySetsListSamples.java | 21 + .../AvailabilitySetsUpdateSamples.java | 78 + ...eservationGroupsCreateOrUpdateSamples.java | 43 + ...apacityReservationGroupsDeleteSamples.java | 39 + ...vationGroupsGetByResourceGroupSamples.java | 29 + ...ationGroupsListByResourceGroupSamples.java | 28 + .../CapacityReservationGroupsListSamples.java | 25 + ...apacityReservationGroupsUpdateSamples.java | 61 + ...cityReservationsCreateOrUpdateSamples.java | 45 + .../CapacityReservationsDeleteSamples.java | 36 + .../CapacityReservationsGetSamples.java | 29 + ...ListByCapacityReservationGroupSamples.java | 24 + .../CapacityReservationsUpdateSamples.java | 66 + ...iceOperatingSystemsGetOSFamilySamples.java | 22 + ...ceOperatingSystemsGetOSVersionSamples.java | 22 + ...OperatingSystemsListOSFamiliesSamples.java | 21 + ...OperatingSystemsListOSVersionsSamples.java | 21 + ...loudServiceRoleInstancesDeleteSamples.java | 23 + ...ceRoleInstancesGetInstanceViewSamples.java | 24 + ...eInstancesGetRemoteDesktopFileSamples.java | 23 + .../CloudServiceRoleInstancesGetSamples.java | 22 + .../CloudServiceRoleInstancesListSamples.java | 21 + ...oudServiceRoleInstancesRebuildSamples.java | 23 + ...oudServiceRoleInstancesReimageSamples.java | 23 + ...oudServiceRoleInstancesRestartSamples.java | 23 + .../CloudServiceRolesGetSamples.java | 22 + .../CloudServiceRolesListSamples.java | 20 + .../CloudServicesCreateOrUpdateSamples.java | 351 + .../CloudServicesDeleteInstancesSamples.java | 30 + .../generated/CloudServicesDeleteSamples.java | 20 + ...loudServicesGetByResourceGroupSamples.java | 23 + .../CloudServicesGetInstanceViewSamples.java | 23 + ...oudServicesListByResourceGroupSamples.java | 21 + .../generated/CloudServicesListSamples.java | 21 + .../CloudServicesPowerOffSamples.java | 20 + .../CloudServicesRebuildSamples.java | 30 + .../CloudServicesReimageSamples.java | 30 + .../CloudServicesRestartSamples.java | 30 + .../generated/CloudServicesStartSamples.java | 20 + ...cesUpdateDomainGetUpdateDomainSamples.java | 22 + ...sUpdateDomainListUpdateDomainsSamples.java | 23 + ...esUpdateDomainWalkUpdateDomainSamples.java | 23 + .../generated/CloudServicesUpdateSamples.java | 41 + .../CommunityGalleriesGetSamples.java | 22 + ...mmunityGalleryImageVersionsGetSamples.java | 28 + ...munityGalleryImageVersionsListSamples.java | 23 + .../CommunityGalleryImagesGetSamples.java | 22 + .../CommunityGalleryImagesListSamples.java | 20 + ...icatedHostGroupsCreateOrUpdateSamples.java | 70 + .../DedicatedHostGroupsDeleteSamples.java | 38 + ...edHostGroupsGetByResourceGroupSamples.java | 39 + ...dHostGroupsListByResourceGroupSamples.java | 34 + .../DedicatedHostGroupsListSamples.java | 34 + .../DedicatedHostGroupsUpdateSamples.java | 66 + .../DedicatedHostsCreateOrUpdateSamples.java | 44 + .../DedicatedHostsDeleteSamples.java | 34 + .../generated/DedicatedHostsGetSamples.java | 29 + ...dicatedHostsListAvailableSizesSamples.java | 23 + .../DedicatedHostsListByHostGroupSamples.java | 36 + .../DedicatedHostsRestartSamples.java | 22 + .../DedicatedHostsUpdateSamples.java | 87 + .../DiskAccessesCreateOrUpdateSamples.java | 25 + ...leteAPrivateEndpointConnectionSamples.java | 24 + .../generated/DiskAccessesDeleteSamples.java | 20 + ...sGetAPrivateEndpointConnectionSamples.java | 24 + ...DiskAccessesGetByResourceGroupSamples.java | 38 + ...ccessesGetPrivateLinkResourcesSamples.java | 23 + ...iskAccessesListByResourceGroupSamples.java | 21 + ...ListPrivateEndpointConnectionsSamples.java | 23 + .../generated/DiskAccessesListSamples.java | 21 + ...dateAPrivateEndpointConnectionSamples.java | 36 + .../generated/DiskAccessesUpdateSamples.java | 40 + ...skEncryptionSetsCreateOrUpdateSamples.java | 103 + .../DiskEncryptionSetsDeleteSamples.java | 20 + ...cryptionSetsGetByResourceGroupSamples.java | 38 + ...ionSetsListAssociatedResourcesSamples.java | 23 + ...ryptionSetsListByResourceGroupSamples.java | 21 + .../DiskEncryptionSetsListSamples.java | 21 + .../DiskEncryptionSetsUpdateSamples.java | 107 + .../generated/DiskRestorePointGetSamples.java | 48 + .../DiskRestorePointGrantAccessSamples.java | 32 + ...RestorePointListByRestorePointSamples.java | 23 + .../DiskRestorePointRevokeAccessSamples.java | 28 + .../generated/DisksCreateOrUpdateSamples.java | 587 + .../generated/DisksDeleteSamples.java | 20 + .../DisksGetByResourceGroupSamples.java | 23 + .../generated/DisksGrantAccessSamples.java | 51 + .../DisksListByResourceGroupSamples.java | 21 + .../generated/generated/DisksListSamples.java | 21 + .../generated/DisksRevokeAccessSamples.java | 20 + .../generated/DisksUpdateSamples.java | 208 + .../GalleriesCreateOrUpdateSamples.java | 99 + .../generated/GalleriesDeleteSamples.java | 20 + .../GalleriesGetByResourceGroupSamples.java | 81 + .../GalleriesListByResourceGroupSamples.java | 21 + .../generated/GalleriesListSamples.java | 21 + .../generated/GalleriesUpdateSamples.java | 28 + ...licationVersionsCreateOrUpdateSamples.java | 78 + ...lleryApplicationVersionsDeleteSamples.java | 28 + .../GalleryApplicationVersionsGetSamples.java | 52 + ...rsionsListByGalleryApplicationSamples.java | 24 + ...lleryApplicationVersionsUpdateSamples.java | 68 + ...leryApplicationsCreateOrUpdateSamples.java | 53 + .../GalleryApplicationsDeleteSamples.java | 22 + .../GalleryApplicationsGetSamples.java | 23 + ...lleryApplicationsListByGallerySamples.java | 23 + .../GalleryApplicationsUpdateSamples.java | 57 + ...eryImageVersionsCreateOrUpdateSamples.java | 649 + .../GalleryImageVersionsDeleteSamples.java | 23 + .../GalleryImageVersionsGetSamples.java | 93 + ...mageVersionsListByGalleryImageSamples.java | 24 + .../GalleryImageVersionsUpdateSamples.java | 95 + .../GalleryImagesCreateOrUpdateSamples.java | 39 + .../generated/GalleryImagesDeleteSamples.java | 22 + .../generated/GalleryImagesGetSamples.java | 23 + .../GalleryImagesListByGallerySamples.java | 20 + .../generated/GalleryImagesUpdateSamples.java | 42 + .../GallerySharingProfileUpdateSamples.java | 84 + .../ImagesCreateOrUpdateSamples.java | 325 + .../generated/ImagesDeleteSamples.java | 32 + .../ImagesGetByResourceGroupSamples.java | 23 + .../ImagesListByResourceGroupSamples.java | 21 + .../generated/ImagesListSamples.java | 21 + .../generated/ImagesUpdateSamples.java | 50 + ...icsExportRequestRateByIntervalSamples.java | 37 + ...alyticsExportThrottledRequestsSamples.java | 38 + .../generated/OperationsListSamples.java | 32 + ...yPlacementGroupsCreateOrUpdateSamples.java | 34 + ...ProximityPlacementGroupsDeleteSamples.java | 24 + ...cementGroupsGetByResourceGroupSamples.java | 23 + ...ementGroupsListByResourceGroupSamples.java | 20 + .../ProximityPlacementGroupsListSamples.java | 21 + ...ProximityPlacementGroupsUpdateSamples.java | 42 + .../generated/ResourceSkusListSamples.java | 47 + ...PointCollectionsCreateOrUpdateSamples.java | 69 + .../RestorePointCollectionsDeleteSamples.java | 34 + ...tCollectionsGetByResourceGroupSamples.java | 40 + ...CollectionsListByResourceGroupSamples.java | 21 + .../RestorePointCollectionsListSamples.java | 21 + .../RestorePointCollectionsUpdateSamples.java | 69 + .../generated/RestorePointsCreateSamples.java | 54 + .../generated/RestorePointsDeleteSamples.java | 36 + .../generated/RestorePointsGetSamples.java | 37 + .../generated/SharedGalleriesGetSamples.java | 20 + .../generated/SharedGalleriesListSamples.java | 20 + .../SharedGalleryImageVersionsGetSamples.java | 28 + ...SharedGalleryImageVersionsListSamples.java | 23 + .../SharedGalleryImagesGetSamples.java | 22 + .../SharedGalleryImagesListSamples.java | 20 + .../SnapshotsCreateOrUpdateSamples.java | 104 + .../generated/SnapshotsDeleteSamples.java | 20 + .../SnapshotsGetByResourceGroupSamples.java | 39 + .../SnapshotsGrantAccessSamples.java | 29 + .../SnapshotsListByResourceGroupSamples.java | 21 + .../generated/SnapshotsListSamples.java | 21 + .../SnapshotsRevokeAccessSamples.java | 20 + .../generated/SnapshotsUpdateSamples.java | 68 + .../generated/SshPublicKeysCreateSamples.java | 27 + .../generated/SshPublicKeysDeleteSamples.java | 38 + .../SshPublicKeysGenerateKeyPairSamples.java | 22 + ...shPublicKeysGetByResourceGroupSamples.java | 22 + ...hPublicKeysListByResourceGroupSamples.java | 34 + .../generated/SshPublicKeysListSamples.java | 34 + .../generated/SshPublicKeysUpdateSamples.java | 59 + .../generated/generated/UsageListSamples.java | 32 + ...rtualMachineExtensionImagesGetSamples.java | 44 + ...achineExtensionImagesListTypesSamples.java | 37 + ...ineExtensionImagesListVersionsSamples.java | 52 + ...achineExtensionsCreateOrUpdateSamples.java | 105 + ...VirtualMachineExtensionsDeleteSamples.java | 38 + .../VirtualMachineExtensionsGetSamples.java | 39 + .../VirtualMachineExtensionsListSamples.java | 38 + ...VirtualMachineExtensionsUpdateSamples.java | 51 + ...irtualMachineImagesEdgeZoneGetSamples.java | 52 + ...achineImagesEdgeZoneListOffersSamples.java | 43 + ...neImagesEdgeZoneListPublishersSamples.java | 38 + ...rtualMachineImagesEdgeZoneListSamples.java | 56 + ...lMachineImagesEdgeZoneListSkusSamples.java | 44 + .../VirtualMachineImagesGetSamples.java | 50 + ...ualMachineImagesListByEdgeZoneSamples.java | 38 + ...VirtualMachineImagesListOffersSamples.java | 37 + ...ualMachineImagesListPublishersSamples.java | 36 + .../VirtualMachineImagesListSamples.java | 47 + .../VirtualMachineImagesListSkusSamples.java | 38 + ...chineRunCommandsCreateOrUpdateSamples.java | 50 + ...irtualMachineRunCommandsDeleteSamples.java | 22 + ...RunCommandsGetByVirtualMachineSamples.java | 23 + .../VirtualMachineRunCommandsGetSamples.java | 22 + ...unCommandsListByVirtualMachineSamples.java | 23 + .../VirtualMachineRunCommandsListSamples.java | 21 + ...irtualMachineRunCommandsUpdateSamples.java | 51 + ...aleSetExtensionsCreateOrUpdateSamples.java | 64 + ...achineScaleSetExtensionsDeleteSamples.java | 42 + ...alMachineScaleSetExtensionsGetSamples.java | 44 + ...lMachineScaleSetExtensionsListSamples.java | 38 + ...achineScaleSetExtensionsUpdateSamples.java | 70 + ...eScaleSetRollingUpgradesCancelSamples.java | 34 + ...aleSetRollingUpgradesGetLatestSamples.java | 38 + ...gUpgradesStartExtensionUpgradeSamples.java | 23 + ...tRollingUpgradesStartOSUpgradeSamples.java | 38 + ...eSetVMExtensionsCreateOrUpdateSamples.java | 37 + ...hineScaleSetVMExtensionsDeleteSamples.java | 23 + ...MachineScaleSetVMExtensionsGetSamples.java | 24 + ...achineScaleSetVMExtensionsListSamples.java | 23 + ...hineScaleSetVMExtensionsUpdateSamples.java | 42 + ...SetVMRunCommandsCreateOrUpdateSamples.java | 58 + ...ineScaleSetVMRunCommandsDeleteSamples.java | 23 + ...achineScaleSetVMRunCommandsGetSamples.java | 24 + ...chineScaleSetVMRunCommandsListSamples.java | 23 + ...ineScaleSetVMRunCommandsUpdateSamples.java | 39 + ...alMachineScaleSetVMsDeallocateSamples.java | 39 + ...irtualMachineScaleSetVMsDeleteSamples.java | 23 + ...hineScaleSetVMsGetInstanceViewSamples.java | 26 + .../VirtualMachineScaleSetVMsGetSamples.java | 37 + .../VirtualMachineScaleSetVMsListSamples.java | 44 + ...eScaleSetVMsPerformMaintenanceSamples.java | 38 + ...tualMachineScaleSetVMsPowerOffSamples.java | 43 + ...tualMachineScaleSetVMsRedeploySamples.java | 42 + ...alMachineScaleSetVMsReimageAllSamples.java | 43 + ...rtualMachineScaleSetVMsReimageSamples.java | 45 + ...rtualMachineScaleSetVMsRestartSamples.java | 38 + ...VMsRetrieveBootDiagnosticsDataSamples.java | 24 + ...alMachineScaleSetVMsRunCommandSamples.java | 33 + ...ineScaleSetVMsSimulateEvictionSamples.java | 24 + ...VirtualMachineScaleSetVMsStartSamples.java | 38 + ...irtualMachineScaleSetVMsUpdateSamples.java | 470 + ...sConvertToSinglePlacementGroupSamples.java | 49 + ...MachineScaleSetsCreateOrUpdateSamples.java | 2730 +++ ...tualMachineScaleSetsDeallocateSamples.java | 46 + ...achineScaleSetsDeleteInstancesSamples.java | 53 + .../VirtualMachineScaleSetsDeleteSamples.java | 22 + ...FabricPlatformUpdateDomainWalkSamples.java | 40 + ...ineScaleSetsGetByResourceGroupSamples.java | 79 + ...achineScaleSetsGetInstanceViewSamples.java | 38 + ...neScaleSetsGetOSUpgradeHistorySamples.java | 36 + ...MachineScaleSetsListByLocationSamples.java | 21 + ...neScaleSetsListByResourceGroupSamples.java | 34 + .../VirtualMachineScaleSetsListSamples.java | 34 + ...irtualMachineScaleSetsListSkusSamples.java | 34 + ...ineScaleSetsPerformMaintenanceSamples.java | 43 + ...irtualMachineScaleSetsPowerOffSamples.java | 44 + ...VirtualMachineScaleSetsReapplySamples.java | 40 + ...irtualMachineScaleSetsRedeploySamples.java | 45 + ...tualMachineScaleSetsReimageAllSamples.java | 45 + ...VirtualMachineScaleSetsReimageSamples.java | 47 + ...VirtualMachineScaleSetsRestartSamples.java | 43 + ...tsSetOrchestrationServiceStateSamples.java | 54 + .../VirtualMachineScaleSetsStartSamples.java | 45 + ...achineScaleSetsUpdateInstancesSamples.java | 51 + .../VirtualMachineScaleSetsUpdateSamples.java | 391 + .../VirtualMachineSizesListSamples.java | 34 + .../VirtualMachinesAssessPatchesSamples.java | 21 + .../VirtualMachinesCaptureSamples.java | 54 + ...lMachinesConvertToManagedDisksSamples.java | 34 + .../VirtualMachinesCreateOrUpdateSamples.java | 2443 +++ .../VirtualMachinesDeallocateSamples.java | 34 + .../VirtualMachinesDeleteSamples.java | 20 + .../VirtualMachinesGeneralizeSamples.java | 22 + ...tualMachinesGetByResourceGroupSamples.java | 71 + .../VirtualMachinesInstallPatchesSamples.java | 44 + .../VirtualMachinesInstanceViewSamples.java | 34 + ...tualMachinesListAvailableSizesSamples.java | 21 + .../VirtualMachinesListByLocationSamples.java | 21 + ...ualMachinesListByResourceGroupSamples.java | 36 + .../generated/VirtualMachinesListSamples.java | 36 + ...tualMachinesPerformMaintenanceSamples.java | 34 + .../VirtualMachinesPowerOffSamples.java | 36 + .../VirtualMachinesReapplySamples.java | 21 + .../VirtualMachinesRedeploySamples.java | 34 + .../VirtualMachinesReimageSamples.java | 54 + .../VirtualMachinesRestartSamples.java | 34 + ...nesRetrieveBootDiagnosticsDataSamples.java | 23 + .../VirtualMachinesRunCommandSamples.java | 28 + ...irtualMachinesSimulateEvictionSamples.java | 23 + .../VirtualMachinesStartSamples.java | 34 + .../VirtualMachinesUpdateSamples.java | 152 + sdk/compute/ci.yml | 47 + sdk/compute/pom.xml | 15 + 1244 files changed, 254012 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/SAMPLE.md create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/pom.xml create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/ComputeManager.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/AvailabilitySetsClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CapacityReservationGroupsClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CapacityReservationsClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CloudServiceOperatingSystemsClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CloudServiceRoleInstancesClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CloudServiceRolesClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CloudServicesClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CloudServicesUpdateDomainsClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CommunityGalleriesClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CommunityGalleryImageVersionsClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CommunityGalleryImagesClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/ComputeManagementClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/DedicatedHostGroupsClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/DedicatedHostsClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/DiskAccessesClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/DiskEncryptionSetsClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/DiskRestorePointsClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/DisksClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/GalleriesClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/GalleryApplicationVersionsClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/GalleryApplicationsClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/GalleryImageVersionsClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/GalleryImagesClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/GallerySharingProfilesClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/ImagesClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/LogAnalyticsClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/OperationsClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/ProximityPlacementGroupsClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/ResourceSkusClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/RestorePointCollectionsClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/RestorePointsClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/SharedGalleriesClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/SharedGalleryImageVersionsClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/SharedGalleryImagesClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/SnapshotsClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/SshPublicKeysClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/UsagesClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineExtensionImagesClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineExtensionsClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineImagesClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineImagesEdgeZonesClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineRunCommandsClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineScaleSetExtensionsClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineScaleSetRollingUpgradesClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineScaleSetVMExtensionsClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineScaleSetVMRunCommandsClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineScaleSetVMsClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineScaleSetsClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineSizesClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachinesClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/AccessUriInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/AvailabilitySetInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/AvailabilitySetProperties.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/CapacityReservationGroupInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/CapacityReservationGroupProperties.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/CapacityReservationInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/CapacityReservationProperties.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/CloudServiceInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/CloudServiceInstanceViewInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/CloudServiceRoleInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/CommunityGalleryIdentifier.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/CommunityGalleryImageInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/CommunityGalleryImageProperties.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/CommunityGalleryImageVersionInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/CommunityGalleryImageVersionProperties.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/CommunityGalleryInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/ComputeOperationValueDisplay.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/DedicatedHostGroupProperties.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/DedicatedHostProperties.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/DiskAccessProperties.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/DiskEncryptionSetUpdateProperties.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/DiskProperties.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/DiskRestorePointProperties.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/DiskUpdateProperties.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/EncryptionSetProperties.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/GalleryApplicationProperties.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/GalleryApplicationVersionProperties.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/GalleryImageProperties.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/GalleryImageVersionProperties.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/GalleryProperties.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/ImageProperties.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/NetworkInterfaceReferenceProperties.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/OSFamilyInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/OSVersionInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/PrivateEndpointConnectionInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/PrivateEndpointConnectionProperties.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/PrivateLinkResourceProperties.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/ProximityPlacementGroupProperties.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RecoveryWalkResponseInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/ResourceSkuInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RestorePointCollectionInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RestorePointCollectionProperties.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RestorePointInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RestorePointProperties.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RetrieveBootDiagnosticsDataResultInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RoleInstanceInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RoleInstancePropertiesInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RoleInstanceViewInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RollingUpgradeStatusInfoInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RollingUpgradeStatusInfoProperties.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/SharedGalleryIdentifier.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/SharedGalleryImageProperties.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/SharedGalleryImageVersionProperties.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/SnapshotProperties.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/SnapshotUpdateProperties.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/SshPublicKeyResourceProperties.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/UpdateDomainInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/UpgradeOperationHistoricalStatusInfoInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/UsageInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineAssessPatchesResultInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineCaptureResultInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineExtensionImageInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineExtensionImageProperties.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/VirtualMachineExtensionProperties.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineExtensionUpdateProperties.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/VirtualMachineImageProperties.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/VirtualMachineNetworkInterfaceConfigurationProperties.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineNetworkInterfaceIpConfigurationProperties.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachinePropertiesInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachinePublicIpAddressConfigurationProperties.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/VirtualMachineRunCommandProperties.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/VirtualMachineScaleSetExtensionProperties.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/VirtualMachineScaleSetIpConfigurationProperties.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineScaleSetNetworkConfigurationProperties.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineScaleSetProperties.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineScaleSetPublicIpAddressConfigurationProperties.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/VirtualMachineScaleSetUpdateIpConfigurationProperties.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineScaleSetUpdateNetworkConfigurationProperties.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineScaleSetUpdateProperties.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineScaleSetUpdatePublicIpAddressConfigurationProperties.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/VirtualMachineScaleSetVMPropertiesInner.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/VmImagesInEdgeZoneListResultInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/package-info.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/package-info.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/AccessUriImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/AvailabilitySetImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/AvailabilitySetsClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/AvailabilitySetsImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CapacityReservationGroupImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CapacityReservationGroupsClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CapacityReservationGroupsImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CapacityReservationImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CapacityReservationsClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CapacityReservationsImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceInstanceViewImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceOperatingSystemsClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceOperatingSystemsImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceRoleImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceRoleInstancesClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceRoleInstancesImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceRolesClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceRolesImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServicesClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServicesImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServicesUpdateDomainsClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServicesUpdateDomainsImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CommunityGalleriesClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CommunityGalleriesImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CommunityGalleryImageImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CommunityGalleryImageVersionImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CommunityGalleryImageVersionsClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CommunityGalleryImageVersionsImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CommunityGalleryImagesClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CommunityGalleryImagesImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CommunityGalleryImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ComputeManagementClientBuilder.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ComputeManagementClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ComputeOperationValueImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DedicatedHostGroupImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DedicatedHostGroupsClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DedicatedHostGroupsImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DedicatedHostImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DedicatedHostsClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DedicatedHostsImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DiskAccessImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DiskAccessesClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DiskAccessesImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DiskEncryptionSetImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DiskEncryptionSetsClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DiskEncryptionSetsImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DiskImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DiskRestorePointImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DiskRestorePointsClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DiskRestorePointsImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DisksClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DisksImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleriesClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleriesImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryApplicationImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryApplicationVersionImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryApplicationVersionsClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryApplicationVersionsImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryApplicationsClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryApplicationsImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryImageImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryImageVersionImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryImageVersionsClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryImageVersionsImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryImagesClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryImagesImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GallerySharingProfilesClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GallerySharingProfilesImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ImageImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ImagesClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ImagesImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/LogAnalyticsClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/LogAnalyticsImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/LogAnalyticsOperationResultImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/OSFamilyImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/OSVersionImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/OperationsClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/OperationsImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/PrivateEndpointConnectionImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/PrivateLinkResourceListResultImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ProximityPlacementGroupImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ProximityPlacementGroupsClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ProximityPlacementGroupsImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RecoveryWalkResponseImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ResourceSkuImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ResourceSkusClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ResourceSkusImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RestorePointCollectionImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RestorePointCollectionsClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RestorePointCollectionsImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RestorePointImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RestorePointsClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RestorePointsImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RetrieveBootDiagnosticsDataResultImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RoleInstanceImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RoleInstancePropertiesImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RoleInstanceViewImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RollingUpgradeStatusInfoImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RunCommandDocumentBaseImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RunCommandDocumentImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RunCommandResultImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SharedGalleriesClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SharedGalleriesImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SharedGalleryImageImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SharedGalleryImageVersionImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SharedGalleryImageVersionsClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SharedGalleryImageVersionsImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SharedGalleryImagesClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SharedGalleryImagesImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SharedGalleryImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SharingUpdateImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SnapshotImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SnapshotsClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SnapshotsImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SshPublicKeyGenerateKeyPairResultImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SshPublicKeyResourceImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SshPublicKeysClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SshPublicKeysImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/UpdateDomainImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/UpgradeOperationHistoricalStatusInfoImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/UsageImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/UsagesClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/UsagesImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/Utils.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineAssessPatchesResultImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineCaptureResultImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineExtensionImageImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineExtensionImagesClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineExtensionImagesImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineExtensionImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineExtensionsClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineExtensionsImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineExtensionsListResultImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineImageImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineImageResourceImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineImagesClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineImagesEdgeZonesClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineImagesEdgeZonesImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineImagesImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineInstallPatchesResultImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineInstanceViewImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachinePropertiesImpl.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/VirtualMachineScaleSetVMPropertiesImpl.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/VmImagesInEdgeZoneListResultImpl.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/AlternativeOption.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AlternativeType.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/ApplicationProfile.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Architecture.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ArchitectureTypes.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AutomaticOSUpgradePolicy.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AutomaticOSUpgradeProperties.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AutomaticRepairsPolicy.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AvailabilitySet.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AvailabilitySetListResult.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AvailabilitySetUpdate.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AvailabilitySets.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AvailablePatchSummary.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/BillingProfile.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/BootDiagnostics.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/BootDiagnosticsInstanceView.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CachingTypes.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservation.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationGroup.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationGroupInstanceView.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationGroupInstanceViewTypes.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationGroupListResult.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationGroupUpdate.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationGroups.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationInstanceView.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationInstanceViewTypes.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationInstanceViewWithName.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationListResult.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationProfile.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationUpdate.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationUtilization.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservations.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudService.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceExtensionProfile.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceExtensionProperties.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceInstanceView.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceListResult.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceNetworkProfile.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceOperatingSystems.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceOsProfile.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceProperties.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceRole.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceRoleInstances.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceRoleListResult.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceRoleProfile.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceRoleProfileProperties.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceRoleProperties.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceRoleSku.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceRoles.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceSlotType.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceUpdate.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceUpgradeMode.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceVaultAndSecretReference.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceVaultCertificate.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceVaultSecretGroup.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServices.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServicesUpdateDomains.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CommunityGalleries.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CommunityGallery.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CommunityGalleryImage.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CommunityGalleryImageList.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CommunityGalleryImageVersion.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CommunityGalleryImageVersionList.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CommunityGalleryImageVersions.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CommunityGalleryImages.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CommunityGalleryInfo.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/ConfidentialVMEncryptionType.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ConsistencyModeTypes.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CopyCompletionError.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CopyCompletionErrorReason.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/DataAccessAuthMode.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/DedicatedHostGroupPropertiesAdditionalCapabilities.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/DedicatedHostSizeListResult.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHostUpdate.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHosts.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DeleteOptions.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiagnosticsProfile.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiffDiskOptions.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiffDiskPlacement.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiffDiskSettings.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Disallowed.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DisallowedConfiguration.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Disk.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskAccess.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskAccessList.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskAccessUpdate.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskAccesses.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskControllerTypes.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskCreateOption.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskCreateOptionTypes.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskDeleteOptionTypes.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskDetachOptionTypes.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskEncryptionSet.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskEncryptionSetIdentityType.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskEncryptionSetList.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskEncryptionSetParameters.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskEncryptionSetType.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskEncryptionSetUpdate.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskEncryptionSets.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskEncryptionSettings.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskImageEncryption.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskInstanceView.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskList.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskRestorePoint.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskRestorePointAttributes.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskRestorePointInstanceView.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/DiskRestorePointReplicationStatus.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskRestorePoints.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskSecurityProfile.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskSecurityTypes.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskSku.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskState.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskStorageAccountTypes.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskUpdate.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Disks.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Encryption.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/EncryptionImages.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/EncryptionSetIdentity.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/EncryptionSettingsCollection.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/EncryptionSettingsElement.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/EncryptionType.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ExecutionState.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ExpandTypeForListVMs.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ExpandTypesForGetCapacityReservationGroups.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ExpandTypesForGetVMScaleSets.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ExpandTypesForListVMs.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/ExtendedLocationType.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ExtendedLocationTypes.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Extension.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Galleries.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Gallery.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryApplication.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryApplicationCustomAction.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryApplicationCustomActionParameter.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryApplicationCustomActionParameterType.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/GalleryApplicationVersionPublishingProfile.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryApplicationVersionSafetyProfile.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/GalleryArtifactSafetyProfileBase.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryArtifactVersionFullSource.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/GalleryDiskImageSource.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryExpandParams.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryExtendedLocation.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryExtendedLocationType.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/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/GalleryImageVersionPublishingProfile.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryImageVersionSafetyProfile.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/GalleryProvisioningState.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/GalleryTargetExtendedLocation.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/ImageDeprecationStatus.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/ImageState.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ImageStorageProfile.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ImageUpdate.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Images.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/InnerError.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/InstanceSku.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/InstanceViewStatus.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/InstanceViewStatusesSummary.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/InstanceViewTypes.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/IntervalInMins.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/IpVersion.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/IpVersions.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/KeyForDiskEncryptionSet.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/KeyVaultAndKeyReference.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/KeyVaultAndSecretReference.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/KeyVaultKeyReference.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/KeyVaultSecretReference.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LastPatchInstallationSummary.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LinuxConfiguration.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LinuxParameters.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LinuxPatchAssessmentMode.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LinuxPatchSettings.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LinuxVMGuestPatchAutomaticByPlatformRebootSetting.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LinuxVMGuestPatchAutomaticByPlatformSettings.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LinuxVMGuestPatchMode.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ListUsagesResult.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LoadBalancerConfiguration.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LoadBalancerConfigurationProperties.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LoadBalancerFrontendIpConfiguration.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LoadBalancerFrontendIpConfigurationProperties.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LogAnalytics.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LogAnalyticsInputBase.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LogAnalyticsOperationResult.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LogAnalyticsOutput.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/MaintenanceOperationResultCodeTypes.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/MaintenanceRedeployStatus.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ManagedDiskParameters.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/NetworkAccessPolicy.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/NetworkApiVersion.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/NetworkInterfaceReference.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/NetworkProfile.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSDisk.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSDiskImage.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSDiskImageEncryption.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSDiskImageSecurityProfile.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSFamily.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSFamilyListResult.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSFamilyProperties.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSImageNotificationProfile.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/OSProfileProvisioningData.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSVersion.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSVersionListResult.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSVersionProperties.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSVersionPropertiesBase.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OperatingSystemStateTypes.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OperatingSystemType.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OperatingSystemTypes.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Operations.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OrchestrationMode.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OrchestrationServiceNames.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OrchestrationServiceState.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OrchestrationServiceStateAction.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OrchestrationServiceStateInput.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OrchestrationServiceSummary.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PassNames.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PatchAssessmentState.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PatchInstallationDetail.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PatchInstallationState.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PatchOperationStatus.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PatchSettings.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PirCommunityGalleryResource.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/PolicyViolation.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PolicyViolationCategory.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PriorityMixPolicy.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PrivateEndpoint.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PrivateEndpointConnection.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PrivateEndpointConnectionListResult.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PrivateEndpointConnectionProvisioningState.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PrivateEndpointServiceConnectionStatus.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PrivateLinkResource.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PrivateLinkResourceListResult.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PrivateLinkServiceConnectionState.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PropertyUpdatesInProgress.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ProtocolTypes.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ProximityPlacementGroup.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ProximityPlacementGroupListResult.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ProximityPlacementGroupPropertiesIntent.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ProximityPlacementGroupType.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ProximityPlacementGroupUpdate.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ProximityPlacementGroups.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ProxyOnlyResource.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PublicIpAddressSku.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PublicIpAddressSkuName.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PublicIpAddressSkuTier.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PublicIpAllocationMethod.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PublicNetworkAccess.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/RegionalSharingStatus.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RepairAction.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ReplicationMode.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ReplicationState.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ReplicationStatus.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ReplicationStatusTypes.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RequestRateByIntervalInput.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceIdentityType.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceInstanceViewStatus.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceRange.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSku.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSkuCapabilities.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSkuCapacity.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSkuCapacityScaleType.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSkuCosts.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSkuLocationInfo.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSkuRestrictionInfo.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSkuRestrictions.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSkuRestrictionsReasonCode.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSkuRestrictionsType.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSkuZoneDetails.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSkus.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSkusResult.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceUriList.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceWithOptionalLocation.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePoint.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointCollection.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointCollectionExpandOptions.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointCollectionListResult.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointCollectionSourceProperties.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointCollectionUpdate.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointCollections.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointEncryption.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointEncryptionType.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointExpandOptions.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointInstanceView.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointSourceMetadata.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointSourceVMDataDisk.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointSourceVMStorageProfile.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointSourceVmosDisk.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePoints.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RetrieveBootDiagnosticsDataResult.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RoleInstance.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RoleInstanceListResult.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RoleInstanceNetworkProfile.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RoleInstanceProperties.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RoleInstanceView.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RoleInstances.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RollbackStatusInfo.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RollingUpgradeActionType.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RollingUpgradePolicy.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RollingUpgradeProgressInfo.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RollingUpgradeRunningStatus.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RollingUpgradeStatusCode.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RollingUpgradeStatusInfo.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RunCommandDocument.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RunCommandDocumentBase.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RunCommandInput.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RunCommandInputParameter.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RunCommandListResult.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RunCommandManagedIdentity.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/SecurityEncryptionTypes.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SecurityPostureReference.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/ServiceArtifactReference.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/SharedGalleryDataDiskImage.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharedGalleryDiskImage.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharedGalleryHostCaching.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/SharedGalleryImageVersionStorageProfile.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/SharedGalleryOSDiskImage.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/SharingState.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharingStatus.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/SoftDeletePolicy.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SourceVault.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SpotRestorePolicy.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SshConfiguration.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SshPublicKey.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SshPublicKeyGenerateKeyPairResult.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SshPublicKeyResource.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SshPublicKeyUpdateResource.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SshPublicKeys.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SshPublicKeysGroupListResult.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/StatusCodeCount.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/StatusLevelTypes.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/StorageAccountType.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/StorageAccountTypes.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/StorageProfile.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SubResourceReadOnly.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SubResourceWithColocationStatus.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SupportedCapabilities.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/TargetRegion.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/TerminateNotificationProfile.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ThrottledRequestsInput.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UefiSettings.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UpdateDomain.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UpdateDomainListResult.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UpdateResource.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UpdateResourceDefinition.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UpgradeMode.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UpgradeOperationHistoricalStatusInfo.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UpgradeOperationHistoricalStatusInfoProperties.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UpgradeOperationHistoryStatus.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UpgradeOperationInvoker.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UpgradePolicy.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UpgradeState.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Usage.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UsageName.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Usages.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UserArtifactManage.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UserArtifactSettings.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/VMDiskSecurityProfile.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VMGalleryApplication.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/VMSizeProperties.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VaultCertificate.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VaultSecretGroup.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualHardDisk.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachine.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineAgentInstanceView.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineAssessPatchesResult.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineCaptureParameters.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineCaptureResult.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineEvictionPolicyTypes.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineExtension.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineExtensionHandlerInstanceView.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineExtensionImage.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineExtensionImages.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineExtensionInstanceView.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineExtensionUpdate.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineExtensions.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineExtensionsListResult.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineHealthStatus.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineIdentity.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineImage.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineImageFeature.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineImageResource.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineImages.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineImagesEdgeZones.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineInstallPatchesParameters.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineInstallPatchesResult.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineInstanceView.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineIpTag.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineListResult.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineNetworkInterfaceConfiguration.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineNetworkInterfaceDnsSettingsConfiguration.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineNetworkInterfaceIpConfiguration.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachinePatchStatus.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachinePriorityTypes.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineProperties.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachinePublicIpAddressConfiguration.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachinePublicIpAddressDnsSettingsConfiguration.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineReimageParameters.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineRunCommand.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineRunCommandInstanceView.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineRunCommandScriptSource.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineRunCommandUpdate.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineRunCommands.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineRunCommandsListResult.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSet.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetDataDisk.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetExtension.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetExtensionListResult.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetExtensionProfile.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetExtensionUpdate.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetExtensions.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetHardwareProfile.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/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/VirtualMachineScaleSetVMProperties.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/VmImagesInEdgeZoneListResult.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/WinRMConfiguration.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/WinRMListener.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/WindowsConfiguration.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/WindowsParameters.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/WindowsPatchAssessmentMode.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/WindowsVMGuestPatchAutomaticByPlatformRebootSetting.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/WindowsVMGuestPatchAutomaticByPlatformSettings.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/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/AvailabilitySetsCreateOrUpdateSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/AvailabilitySetsDeleteSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/AvailabilitySetsGetByResourceGroupSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/AvailabilitySetsListAvailableSizesSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/AvailabilitySetsListByResourceGroupSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/AvailabilitySetsListSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/AvailabilitySetsUpdateSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CapacityReservationGroupsCreateOrUpdateSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CapacityReservationGroupsDeleteSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CapacityReservationGroupsGetByResourceGroupSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CapacityReservationGroupsListByResourceGroupSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CapacityReservationGroupsListSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CapacityReservationGroupsUpdateSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CapacityReservationsCreateOrUpdateSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CapacityReservationsDeleteSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CapacityReservationsGetSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CapacityReservationsListByCapacityReservationGroupSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CapacityReservationsUpdateSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServiceOperatingSystemsGetOSFamilySamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServiceOperatingSystemsGetOSVersionSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServiceOperatingSystemsListOSFamiliesSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServiceOperatingSystemsListOSVersionsSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServiceRoleInstancesDeleteSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServiceRoleInstancesGetInstanceViewSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServiceRoleInstancesGetRemoteDesktopFileSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServiceRoleInstancesGetSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServiceRoleInstancesListSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServiceRoleInstancesRebuildSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServiceRoleInstancesReimageSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServiceRoleInstancesRestartSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServiceRolesGetSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServiceRolesListSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServicesCreateOrUpdateSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServicesDeleteInstancesSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServicesDeleteSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServicesGetByResourceGroupSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServicesGetInstanceViewSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServicesListByResourceGroupSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServicesListSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServicesPowerOffSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServicesRebuildSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServicesReimageSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServicesRestartSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServicesStartSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServicesUpdateDomainGetUpdateDomainSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServicesUpdateDomainListUpdateDomainsSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServicesUpdateDomainWalkUpdateDomainSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServicesUpdateSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CommunityGalleriesGetSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CommunityGalleryImageVersionsGetSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CommunityGalleryImageVersionsListSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CommunityGalleryImagesGetSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CommunityGalleryImagesListSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DedicatedHostGroupsCreateOrUpdateSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DedicatedHostGroupsDeleteSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DedicatedHostGroupsGetByResourceGroupSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DedicatedHostGroupsListByResourceGroupSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DedicatedHostGroupsListSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DedicatedHostGroupsUpdateSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DedicatedHostsCreateOrUpdateSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DedicatedHostsDeleteSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DedicatedHostsGetSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DedicatedHostsListAvailableSizesSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DedicatedHostsListByHostGroupSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DedicatedHostsRestartSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DedicatedHostsUpdateSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskAccessesCreateOrUpdateSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskAccessesDeleteAPrivateEndpointConnectionSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskAccessesDeleteSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskAccessesGetAPrivateEndpointConnectionSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskAccessesGetByResourceGroupSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskAccessesGetPrivateLinkResourcesSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskAccessesListByResourceGroupSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskAccessesListPrivateEndpointConnectionsSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskAccessesListSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskAccessesUpdateAPrivateEndpointConnectionSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskAccessesUpdateSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskEncryptionSetsCreateOrUpdateSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskEncryptionSetsDeleteSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskEncryptionSetsGetByResourceGroupSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskEncryptionSetsListAssociatedResourcesSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskEncryptionSetsListByResourceGroupSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskEncryptionSetsListSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskEncryptionSetsUpdateSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskRestorePointGetSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskRestorePointGrantAccessSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskRestorePointListByRestorePointSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskRestorePointRevokeAccessSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DisksCreateOrUpdateSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DisksDeleteSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DisksGetByResourceGroupSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DisksGrantAccessSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DisksListByResourceGroupSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DisksListSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DisksRevokeAccessSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DisksUpdateSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleriesCreateOrUpdateSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleriesDeleteSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleriesGetByResourceGroupSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleriesListByResourceGroupSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleriesListSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleriesUpdateSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryApplicationVersionsCreateOrUpdateSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryApplicationVersionsDeleteSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryApplicationVersionsGetSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryApplicationVersionsListByGalleryApplicationSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryApplicationVersionsUpdateSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryApplicationsCreateOrUpdateSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryApplicationsDeleteSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryApplicationsGetSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryApplicationsListByGallerySamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryApplicationsUpdateSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryImageVersionsCreateOrUpdateSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryImageVersionsDeleteSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryImageVersionsGetSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryImageVersionsListByGalleryImageSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryImageVersionsUpdateSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryImagesCreateOrUpdateSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryImagesDeleteSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryImagesGetSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryImagesListByGallerySamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryImagesUpdateSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GallerySharingProfileUpdateSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/ImagesCreateOrUpdateSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/ImagesDeleteSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/ImagesGetByResourceGroupSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/ImagesListByResourceGroupSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/ImagesListSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/ImagesUpdateSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/LogAnalyticsExportRequestRateByIntervalSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/LogAnalyticsExportThrottledRequestsSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/OperationsListSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/ProximityPlacementGroupsCreateOrUpdateSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/ProximityPlacementGroupsDeleteSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/ProximityPlacementGroupsGetByResourceGroupSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/ProximityPlacementGroupsListByResourceGroupSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/ProximityPlacementGroupsListSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/ProximityPlacementGroupsUpdateSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/ResourceSkusListSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/RestorePointCollectionsCreateOrUpdateSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/RestorePointCollectionsDeleteSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/RestorePointCollectionsGetByResourceGroupSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/RestorePointCollectionsListByResourceGroupSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/RestorePointCollectionsListSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/RestorePointCollectionsUpdateSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/RestorePointsCreateSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/RestorePointsDeleteSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/RestorePointsGetSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SharedGalleriesGetSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SharedGalleriesListSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SharedGalleryImageVersionsGetSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SharedGalleryImageVersionsListSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SharedGalleryImagesGetSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SharedGalleryImagesListSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SnapshotsCreateOrUpdateSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SnapshotsDeleteSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SnapshotsGetByResourceGroupSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SnapshotsGrantAccessSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SnapshotsListByResourceGroupSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SnapshotsListSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SnapshotsRevokeAccessSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SnapshotsUpdateSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SshPublicKeysCreateSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SshPublicKeysDeleteSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SshPublicKeysGenerateKeyPairSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SshPublicKeysGetByResourceGroupSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SshPublicKeysListByResourceGroupSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SshPublicKeysListSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SshPublicKeysUpdateSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/UsageListSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineExtensionImagesGetSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineExtensionImagesListTypesSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineExtensionImagesListVersionsSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineExtensionsCreateOrUpdateSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineExtensionsDeleteSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineExtensionsGetSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineExtensionsListSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineExtensionsUpdateSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineImagesEdgeZoneGetSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineImagesEdgeZoneListOffersSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineImagesEdgeZoneListPublishersSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineImagesEdgeZoneListSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineImagesEdgeZoneListSkusSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineImagesGetSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineImagesListByEdgeZoneSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineImagesListOffersSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineImagesListPublishersSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineImagesListSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineImagesListSkusSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineRunCommandsCreateOrUpdateSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineRunCommandsDeleteSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineRunCommandsGetByVirtualMachineSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineRunCommandsGetSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineRunCommandsListByVirtualMachineSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineRunCommandsListSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineRunCommandsUpdateSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetExtensionsCreateOrUpdateSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetExtensionsDeleteSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetExtensionsGetSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetExtensionsListSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetExtensionsUpdateSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetRollingUpgradesCancelSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetRollingUpgradesGetLatestSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetRollingUpgradesStartOSUpgradeSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMExtensionsCreateOrUpdateSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMExtensionsDeleteSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMExtensionsGetSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMExtensionsListSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMExtensionsUpdateSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMRunCommandsCreateOrUpdateSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMRunCommandsDeleteSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMRunCommandsGetSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMRunCommandsListSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMRunCommandsUpdateSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMsDeallocateSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMsDeleteSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMsGetInstanceViewSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMsGetSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMsListSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMsPerformMaintenanceSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMsPowerOffSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMsRedeploySamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMsReimageAllSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMsReimageSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMsRestartSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMsRetrieveBootDiagnosticsDataSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMsRunCommandSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMsSimulateEvictionSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMsStartSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMsUpdateSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsConvertToSinglePlacementGroupSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsCreateOrUpdateSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsDeallocateSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsDeleteInstancesSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsDeleteSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsGetByResourceGroupSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsGetInstanceViewSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsGetOSUpgradeHistorySamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsListByLocationSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsListByResourceGroupSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsListSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsListSkusSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsPerformMaintenanceSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsPowerOffSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsReapplySamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsRedeploySamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsReimageAllSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsReimageSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsRestartSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsSetOrchestrationServiceStateSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsStartSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsUpdateInstancesSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsUpdateSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineSizesListSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesAssessPatchesSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesCaptureSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesConvertToManagedDisksSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesCreateOrUpdateSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesDeallocateSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesDeleteSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesGeneralizeSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesGetByResourceGroupSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesInstallPatchesSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesInstanceViewSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesListAvailableSizesSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesListByLocationSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesListByResourceGroupSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesListSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesPerformMaintenanceSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesPowerOffSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesReapplySamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesRedeploySamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesReimageSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesRestartSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesRetrieveBootDiagnosticsDataSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesRunCommandSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesSimulateEvictionSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesStartSamples.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesUpdateSamples.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 205db5d9548a1..7a5335f9208f3 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -408,6 +408,7 @@ com.azure.resourcemanager:azure-resourcemanager-graphservices;1.0.0-beta.1;1.0.0 com.azure.resourcemanager:azure-resourcemanager-paloaltonetworks-ngfw;1.0.0-beta.1;1.0.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-newrelicobservability;1.0.0-beta.2;1.0.0-beta.3 com.azure.resourcemanager:azure-resourcemanager-qumulo;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-compute-generated;1.0.0-beta.1;1.0.0-beta.1 com.azure.tools:azure-sdk-archetype;1.0.0;1.2.0-beta.1 com.azure.tools:azure-sdk-build-tool;1.0.0-beta.1;1.0.0-beta.2 diff --git a/pom.xml b/pom.xml index f893e1394407d..77cdec582b410 100644 --- a/pom.xml +++ b/pom.xml @@ -41,6 +41,7 @@ sdk/cognitiveservices sdk/commerce sdk/communication + sdk/compute sdk/confidentialledger sdk/confluent sdk/connectedvmware 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..bbc5968c4627e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2023-04-20) + +- Azure Resource Manager Compute client library for Java. This package contains Microsoft Azure SDK for Compute Management SDK. Compute Client. Package tag package-2023-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..6846b7cca9258 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/README.md @@ -0,0 +1,105 @@ +# 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-2023-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] and [Azure Core Netty HTTP][azure_core_http_netty] packages provide the default implementation. + +### Authentication + +By default, Azure Active Directory token authentication depends on correct configuration of the following environment variables. + +- `AZURE_CLIENT_ID` for Azure client ID. +- `AZURE_TENANT_ID` for Azure tenant ID. +- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. + +In addition, Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. + +With above configuration, `azure` client can be authenticated using the 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 + +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/compute/azure-resourcemanager-compute-generated/SAMPLE.md) + + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide][cg]. + +This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact with any additional questions or comments. + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md +[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/compute/azure-resourcemanager-compute-generated/SAMPLE.md b/sdk/compute/azure-resourcemanager-compute-generated/SAMPLE.md new file mode 100644 index 0000000000000..0b96a100d4ab8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/SAMPLE.md @@ -0,0 +1,18242 @@ +# Code snippets and samples + + +## AvailabilitySets + +- [CreateOrUpdate](#availabilitysets_createorupdate) +- [Delete](#availabilitysets_delete) +- [GetByResourceGroup](#availabilitysets_getbyresourcegroup) +- [List](#availabilitysets_list) +- [ListAvailableSizes](#availabilitysets_listavailablesizes) +- [ListByResourceGroup](#availabilitysets_listbyresourcegroup) +- [Update](#availabilitysets_update) + +## CapacityReservationGroups + +- [CreateOrUpdate](#capacityreservationgroups_createorupdate) +- [Delete](#capacityreservationgroups_delete) +- [GetByResourceGroup](#capacityreservationgroups_getbyresourcegroup) +- [List](#capacityreservationgroups_list) +- [ListByResourceGroup](#capacityreservationgroups_listbyresourcegroup) +- [Update](#capacityreservationgroups_update) + +## CapacityReservations + +- [CreateOrUpdate](#capacityreservations_createorupdate) +- [Delete](#capacityreservations_delete) +- [Get](#capacityreservations_get) +- [ListByCapacityReservationGroup](#capacityreservations_listbycapacityreservationgroup) +- [Update](#capacityreservations_update) + +## CloudServiceOperatingSystems + +- [GetOSFamily](#cloudserviceoperatingsystems_getosfamily) +- [GetOSVersion](#cloudserviceoperatingsystems_getosversion) +- [ListOSFamilies](#cloudserviceoperatingsystems_listosfamilies) +- [ListOSVersions](#cloudserviceoperatingsystems_listosversions) + +## CloudServiceRoleInstances + +- [Delete](#cloudserviceroleinstances_delete) +- [Get](#cloudserviceroleinstances_get) +- [GetInstanceView](#cloudserviceroleinstances_getinstanceview) +- [GetRemoteDesktopFile](#cloudserviceroleinstances_getremotedesktopfile) +- [List](#cloudserviceroleinstances_list) +- [Rebuild](#cloudserviceroleinstances_rebuild) +- [Reimage](#cloudserviceroleinstances_reimage) +- [Restart](#cloudserviceroleinstances_restart) + +## CloudServiceRoles + +- [Get](#cloudserviceroles_get) +- [List](#cloudserviceroles_list) + +## CloudServices + +- [CreateOrUpdate](#cloudservices_createorupdate) +- [Delete](#cloudservices_delete) +- [DeleteInstances](#cloudservices_deleteinstances) +- [GetByResourceGroup](#cloudservices_getbyresourcegroup) +- [GetInstanceView](#cloudservices_getinstanceview) +- [List](#cloudservices_list) +- [ListByResourceGroup](#cloudservices_listbyresourcegroup) +- [PowerOff](#cloudservices_poweroff) +- [Rebuild](#cloudservices_rebuild) +- [Reimage](#cloudservices_reimage) +- [Restart](#cloudservices_restart) +- [Start](#cloudservices_start) +- [Update](#cloudservices_update) + +## CloudServicesUpdateDomain + +- [GetUpdateDomain](#cloudservicesupdatedomain_getupdatedomain) +- [ListUpdateDomains](#cloudservicesupdatedomain_listupdatedomains) +- [WalkUpdateDomain](#cloudservicesupdatedomain_walkupdatedomain) + +## CommunityGalleries + +- [Get](#communitygalleries_get) + +## CommunityGalleryImageVersions + +- [Get](#communitygalleryimageversions_get) +- [List](#communitygalleryimageversions_list) + +## CommunityGalleryImages + +- [Get](#communitygalleryimages_get) +- [List](#communitygalleryimages_list) + +## DedicatedHostGroups + +- [CreateOrUpdate](#dedicatedhostgroups_createorupdate) +- [Delete](#dedicatedhostgroups_delete) +- [GetByResourceGroup](#dedicatedhostgroups_getbyresourcegroup) +- [List](#dedicatedhostgroups_list) +- [ListByResourceGroup](#dedicatedhostgroups_listbyresourcegroup) +- [Update](#dedicatedhostgroups_update) + +## DedicatedHosts + +- [CreateOrUpdate](#dedicatedhosts_createorupdate) +- [Delete](#dedicatedhosts_delete) +- [Get](#dedicatedhosts_get) +- [ListAvailableSizes](#dedicatedhosts_listavailablesizes) +- [ListByHostGroup](#dedicatedhosts_listbyhostgroup) +- [Restart](#dedicatedhosts_restart) +- [Update](#dedicatedhosts_update) + +## DiskAccesses + +- [CreateOrUpdate](#diskaccesses_createorupdate) +- [Delete](#diskaccesses_delete) +- [DeleteAPrivateEndpointConnection](#diskaccesses_deleteaprivateendpointconnection) +- [GetAPrivateEndpointConnection](#diskaccesses_getaprivateendpointconnection) +- [GetByResourceGroup](#diskaccesses_getbyresourcegroup) +- [GetPrivateLinkResources](#diskaccesses_getprivatelinkresources) +- [List](#diskaccesses_list) +- [ListByResourceGroup](#diskaccesses_listbyresourcegroup) +- [ListPrivateEndpointConnections](#diskaccesses_listprivateendpointconnections) +- [Update](#diskaccesses_update) +- [UpdateAPrivateEndpointConnection](#diskaccesses_updateaprivateendpointconnection) + +## DiskEncryptionSets + +- [CreateOrUpdate](#diskencryptionsets_createorupdate) +- [Delete](#diskencryptionsets_delete) +- [GetByResourceGroup](#diskencryptionsets_getbyresourcegroup) +- [List](#diskencryptionsets_list) +- [ListAssociatedResources](#diskencryptionsets_listassociatedresources) +- [ListByResourceGroup](#diskencryptionsets_listbyresourcegroup) +- [Update](#diskencryptionsets_update) + +## DiskRestorePoint + +- [Get](#diskrestorepoint_get) +- [GrantAccess](#diskrestorepoint_grantaccess) +- [ListByRestorePoint](#diskrestorepoint_listbyrestorepoint) +- [RevokeAccess](#diskrestorepoint_revokeaccess) + +## Disks + +- [CreateOrUpdate](#disks_createorupdate) +- [Delete](#disks_delete) +- [GetByResourceGroup](#disks_getbyresourcegroup) +- [GrantAccess](#disks_grantaccess) +- [List](#disks_list) +- [ListByResourceGroup](#disks_listbyresourcegroup) +- [RevokeAccess](#disks_revokeaccess) +- [Update](#disks_update) + +## Galleries + +- [CreateOrUpdate](#galleries_createorupdate) +- [Delete](#galleries_delete) +- [GetByResourceGroup](#galleries_getbyresourcegroup) +- [List](#galleries_list) +- [ListByResourceGroup](#galleries_listbyresourcegroup) +- [Update](#galleries_update) + +## GalleryApplicationVersions + +- [CreateOrUpdate](#galleryapplicationversions_createorupdate) +- [Delete](#galleryapplicationversions_delete) +- [Get](#galleryapplicationversions_get) +- [ListByGalleryApplication](#galleryapplicationversions_listbygalleryapplication) +- [Update](#galleryapplicationversions_update) + +## GalleryApplications + +- [CreateOrUpdate](#galleryapplications_createorupdate) +- [Delete](#galleryapplications_delete) +- [Get](#galleryapplications_get) +- [ListByGallery](#galleryapplications_listbygallery) +- [Update](#galleryapplications_update) + +## GalleryImageVersions + +- [CreateOrUpdate](#galleryimageversions_createorupdate) +- [Delete](#galleryimageversions_delete) +- [Get](#galleryimageversions_get) +- [ListByGalleryImage](#galleryimageversions_listbygalleryimage) +- [Update](#galleryimageversions_update) + +## GalleryImages + +- [CreateOrUpdate](#galleryimages_createorupdate) +- [Delete](#galleryimages_delete) +- [Get](#galleryimages_get) +- [ListByGallery](#galleryimages_listbygallery) +- [Update](#galleryimages_update) + +## GallerySharingProfile + +- [Update](#gallerysharingprofile_update) + +## Images + +- [CreateOrUpdate](#images_createorupdate) +- [Delete](#images_delete) +- [GetByResourceGroup](#images_getbyresourcegroup) +- [List](#images_list) +- [ListByResourceGroup](#images_listbyresourcegroup) +- [Update](#images_update) + +## LogAnalytics + +- [ExportRequestRateByInterval](#loganalytics_exportrequestratebyinterval) +- [ExportThrottledRequests](#loganalytics_exportthrottledrequests) + +## Operations + +- [List](#operations_list) + +## ProximityPlacementGroups + +- [CreateOrUpdate](#proximityplacementgroups_createorupdate) +- [Delete](#proximityplacementgroups_delete) +- [GetByResourceGroup](#proximityplacementgroups_getbyresourcegroup) +- [List](#proximityplacementgroups_list) +- [ListByResourceGroup](#proximityplacementgroups_listbyresourcegroup) +- [Update](#proximityplacementgroups_update) + +## ResourceSkus + +- [List](#resourceskus_list) + +## RestorePointCollections + +- [CreateOrUpdate](#restorepointcollections_createorupdate) +- [Delete](#restorepointcollections_delete) +- [GetByResourceGroup](#restorepointcollections_getbyresourcegroup) +- [List](#restorepointcollections_list) +- [ListByResourceGroup](#restorepointcollections_listbyresourcegroup) +- [Update](#restorepointcollections_update) + +## RestorePoints + +- [Create](#restorepoints_create) +- [Delete](#restorepoints_delete) +- [Get](#restorepoints_get) + +## SharedGalleries + +- [Get](#sharedgalleries_get) +- [List](#sharedgalleries_list) + +## SharedGalleryImageVersions + +- [Get](#sharedgalleryimageversions_get) +- [List](#sharedgalleryimageversions_list) + +## SharedGalleryImages + +- [Get](#sharedgalleryimages_get) +- [List](#sharedgalleryimages_list) + +## Snapshots + +- [CreateOrUpdate](#snapshots_createorupdate) +- [Delete](#snapshots_delete) +- [GetByResourceGroup](#snapshots_getbyresourcegroup) +- [GrantAccess](#snapshots_grantaccess) +- [List](#snapshots_list) +- [ListByResourceGroup](#snapshots_listbyresourcegroup) +- [RevokeAccess](#snapshots_revokeaccess) +- [Update](#snapshots_update) + +## SshPublicKeys + +- [Create](#sshpublickeys_create) +- [Delete](#sshpublickeys_delete) +- [GenerateKeyPair](#sshpublickeys_generatekeypair) +- [GetByResourceGroup](#sshpublickeys_getbyresourcegroup) +- [List](#sshpublickeys_list) +- [ListByResourceGroup](#sshpublickeys_listbyresourcegroup) +- [Update](#sshpublickeys_update) + +## Usage + +- [List](#usage_list) + +## VirtualMachineExtensionImages + +- [Get](#virtualmachineextensionimages_get) +- [ListTypes](#virtualmachineextensionimages_listtypes) +- [ListVersions](#virtualmachineextensionimages_listversions) + +## VirtualMachineExtensions + +- [CreateOrUpdate](#virtualmachineextensions_createorupdate) +- [Delete](#virtualmachineextensions_delete) +- [Get](#virtualmachineextensions_get) +- [List](#virtualmachineextensions_list) +- [Update](#virtualmachineextensions_update) + +## VirtualMachineImages + +- [Get](#virtualmachineimages_get) +- [List](#virtualmachineimages_list) +- [ListByEdgeZone](#virtualmachineimages_listbyedgezone) +- [ListOffers](#virtualmachineimages_listoffers) +- [ListPublishers](#virtualmachineimages_listpublishers) +- [ListSkus](#virtualmachineimages_listskus) + +## VirtualMachineImagesEdgeZone + +- [Get](#virtualmachineimagesedgezone_get) +- [List](#virtualmachineimagesedgezone_list) +- [ListOffers](#virtualmachineimagesedgezone_listoffers) +- [ListPublishers](#virtualmachineimagesedgezone_listpublishers) +- [ListSkus](#virtualmachineimagesedgezone_listskus) + +## VirtualMachineRunCommands + +- [CreateOrUpdate](#virtualmachineruncommands_createorupdate) +- [Delete](#virtualmachineruncommands_delete) +- [Get](#virtualmachineruncommands_get) +- [GetByVirtualMachine](#virtualmachineruncommands_getbyvirtualmachine) +- [List](#virtualmachineruncommands_list) +- [ListByVirtualMachine](#virtualmachineruncommands_listbyvirtualmachine) +- [Update](#virtualmachineruncommands_update) + +## VirtualMachineScaleSetExtensions + +- [CreateOrUpdate](#virtualmachinescalesetextensions_createorupdate) +- [Delete](#virtualmachinescalesetextensions_delete) +- [Get](#virtualmachinescalesetextensions_get) +- [List](#virtualmachinescalesetextensions_list) +- [Update](#virtualmachinescalesetextensions_update) + +## VirtualMachineScaleSetRollingUpgrades + +- [Cancel](#virtualmachinescalesetrollingupgrades_cancel) +- [GetLatest](#virtualmachinescalesetrollingupgrades_getlatest) +- [StartExtensionUpgrade](#virtualmachinescalesetrollingupgrades_startextensionupgrade) +- [StartOSUpgrade](#virtualmachinescalesetrollingupgrades_startosupgrade) + +## VirtualMachineScaleSetVMExtensions + +- [CreateOrUpdate](#virtualmachinescalesetvmextensions_createorupdate) +- [Delete](#virtualmachinescalesetvmextensions_delete) +- [Get](#virtualmachinescalesetvmextensions_get) +- [List](#virtualmachinescalesetvmextensions_list) +- [Update](#virtualmachinescalesetvmextensions_update) + +## VirtualMachineScaleSetVMRunCommands + +- [CreateOrUpdate](#virtualmachinescalesetvmruncommands_createorupdate) +- [Delete](#virtualmachinescalesetvmruncommands_delete) +- [Get](#virtualmachinescalesetvmruncommands_get) +- [List](#virtualmachinescalesetvmruncommands_list) +- [Update](#virtualmachinescalesetvmruncommands_update) + +## VirtualMachineScaleSetVMs + +- [Deallocate](#virtualmachinescalesetvms_deallocate) +- [Delete](#virtualmachinescalesetvms_delete) +- [Get](#virtualmachinescalesetvms_get) +- [GetInstanceView](#virtualmachinescalesetvms_getinstanceview) +- [List](#virtualmachinescalesetvms_list) +- [PerformMaintenance](#virtualmachinescalesetvms_performmaintenance) +- [PowerOff](#virtualmachinescalesetvms_poweroff) +- [Redeploy](#virtualmachinescalesetvms_redeploy) +- [Reimage](#virtualmachinescalesetvms_reimage) +- [ReimageAll](#virtualmachinescalesetvms_reimageall) +- [Restart](#virtualmachinescalesetvms_restart) +- [RetrieveBootDiagnosticsData](#virtualmachinescalesetvms_retrievebootdiagnosticsdata) +- [RunCommand](#virtualmachinescalesetvms_runcommand) +- [SimulateEviction](#virtualmachinescalesetvms_simulateeviction) +- [Start](#virtualmachinescalesetvms_start) +- [Update](#virtualmachinescalesetvms_update) + +## VirtualMachineScaleSets + +- [ConvertToSinglePlacementGroup](#virtualmachinescalesets_converttosingleplacementgroup) +- [CreateOrUpdate](#virtualmachinescalesets_createorupdate) +- [Deallocate](#virtualmachinescalesets_deallocate) +- [Delete](#virtualmachinescalesets_delete) +- [DeleteInstances](#virtualmachinescalesets_deleteinstances) +- [ForceRecoveryServiceFabricPlatformUpdateDomainWalk](#virtualmachinescalesets_forcerecoveryservicefabricplatformupdatedomainwalk) +- [GetByResourceGroup](#virtualmachinescalesets_getbyresourcegroup) +- [GetInstanceView](#virtualmachinescalesets_getinstanceview) +- [GetOSUpgradeHistory](#virtualmachinescalesets_getosupgradehistory) +- [List](#virtualmachinescalesets_list) +- [ListByLocation](#virtualmachinescalesets_listbylocation) +- [ListByResourceGroup](#virtualmachinescalesets_listbyresourcegroup) +- [ListSkus](#virtualmachinescalesets_listskus) +- [PerformMaintenance](#virtualmachinescalesets_performmaintenance) +- [PowerOff](#virtualmachinescalesets_poweroff) +- [Reapply](#virtualmachinescalesets_reapply) +- [Redeploy](#virtualmachinescalesets_redeploy) +- [Reimage](#virtualmachinescalesets_reimage) +- [ReimageAll](#virtualmachinescalesets_reimageall) +- [Restart](#virtualmachinescalesets_restart) +- [SetOrchestrationServiceState](#virtualmachinescalesets_setorchestrationservicestate) +- [Start](#virtualmachinescalesets_start) +- [Update](#virtualmachinescalesets_update) +- [UpdateInstances](#virtualmachinescalesets_updateinstances) + +## VirtualMachineSizes + +- [List](#virtualmachinesizes_list) + +## VirtualMachines + +- [AssessPatches](#virtualmachines_assesspatches) +- [Capture](#virtualmachines_capture) +- [ConvertToManagedDisks](#virtualmachines_converttomanageddisks) +- [CreateOrUpdate](#virtualmachines_createorupdate) +- [Deallocate](#virtualmachines_deallocate) +- [Delete](#virtualmachines_delete) +- [Generalize](#virtualmachines_generalize) +- [GetByResourceGroup](#virtualmachines_getbyresourcegroup) +- [InstallPatches](#virtualmachines_installpatches) +- [InstanceView](#virtualmachines_instanceview) +- [List](#virtualmachines_list) +- [ListAvailableSizes](#virtualmachines_listavailablesizes) +- [ListByLocation](#virtualmachines_listbylocation) +- [ListByResourceGroup](#virtualmachines_listbyresourcegroup) +- [PerformMaintenance](#virtualmachines_performmaintenance) +- [PowerOff](#virtualmachines_poweroff) +- [Reapply](#virtualmachines_reapply) +- [Redeploy](#virtualmachines_redeploy) +- [Reimage](#virtualmachines_reimage) +- [Restart](#virtualmachines_restart) +- [RetrieveBootDiagnosticsData](#virtualmachines_retrievebootdiagnosticsdata) +- [RunCommand](#virtualmachines_runcommand) +- [SimulateEviction](#virtualmachines_simulateeviction) +- [Start](#virtualmachines_start) +- [Update](#virtualmachines_update) +### AvailabilitySets_CreateOrUpdate + +```java +/** Samples for AvailabilitySets CreateOrUpdate. */ +public final class AvailabilitySetsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/availabilitySetExamples/AvailabilitySet_Create.json + */ + /** + * Sample code: Create an availability set. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAnAvailabilitySet(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .availabilitySets() + .define("myAvailabilitySet") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withPlatformUpdateDomainCount(20) + .withPlatformFaultDomainCount(2) + .create(); + } +} +``` + +### AvailabilitySets_Delete + +```java +/** Samples for AvailabilitySets Delete. */ +public final class AvailabilitySetsDeleteSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/availabilitySetExamples/AvailabilitySet_Delete_MinimumSet_Gen.json + */ + /** + * Sample code: AvailabilitySet_Delete_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void availabilitySetDeleteMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .availabilitySets() + .deleteByResourceGroupWithResponse("rgcompute", "aaaaaaaaaaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/availabilitySetExamples/AvailabilitySet_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: AvailabilitySet_Delete_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void availabilitySetDeleteMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .availabilitySets() + .deleteByResourceGroupWithResponse("rgcompute", "aaaaaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } +} +``` + +### AvailabilitySets_GetByResourceGroup + +```java +/** Samples for AvailabilitySets GetByResourceGroup. */ +public final class AvailabilitySetsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/availabilitySetExamples/AvailabilitySet_Get_MaximumSet_Gen.json + */ + /** + * Sample code: AvailabilitySet_Get_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void availabilitySetGetMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .availabilitySets() + .getByResourceGroupWithResponse("rgcompute", "aaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/availabilitySetExamples/AvailabilitySet_Get_MinimumSet_Gen.json + */ + /** + * Sample code: AvailabilitySet_Get_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void availabilitySetGetMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .availabilitySets() + .getByResourceGroupWithResponse("rgcompute", "aaaaaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } +} +``` + +### AvailabilitySets_List + +```java +/** Samples for AvailabilitySets List. */ +public final class AvailabilitySetsListSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/availabilitySetExamples/AvailabilitySet_ListBySubscription.json + */ + /** + * Sample code: List availability sets in a subscription. + * + * @param manager Entry point to ComputeManager. + */ + public static void listAvailabilitySetsInASubscription( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.availabilitySets().list("virtualMachines\\$ref", com.azure.core.util.Context.NONE); + } +} +``` + +### AvailabilitySets_ListAvailableSizes + +```java +/** Samples for AvailabilitySets ListAvailableSizes. */ +public final class AvailabilitySetsListAvailableSizesSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/availabilitySetExamples/AvailabilitySet_ListAvailableSizes_MinimumSet_Gen.json + */ + /** + * Sample code: AvailabilitySet_ListAvailableSizes_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void availabilitySetListAvailableSizesMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.availabilitySets().listAvailableSizes("rgcompute", "aa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/availabilitySetExamples/AvailabilitySet_ListAvailableSizes_MaximumSet_Gen.json + */ + /** + * Sample code: AvailabilitySet_ListAvailableSizes_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void availabilitySetListAvailableSizesMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .availabilitySets() + .listAvailableSizes("rgcompute", "aaaaaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } +} +``` + +### AvailabilitySets_ListByResourceGroup + +```java +/** Samples for AvailabilitySets ListByResourceGroup. */ +public final class AvailabilitySetsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/availabilitySetExamples/AvailabilitySet_List_MaximumSet_Gen.json + */ + /** + * Sample code: AvailabilitySet_List_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void availabilitySetListMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.availabilitySets().listByResourceGroup("rgcompute", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/availabilitySetExamples/AvailabilitySet_List_MinimumSet_Gen.json + */ + /** + * Sample code: AvailabilitySet_List_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void availabilitySetListMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.availabilitySets().listByResourceGroup("rgcompute", com.azure.core.util.Context.NONE); + } +} +``` + +### AvailabilitySets_Update + +```java +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.compute.generated.models.AvailabilitySet; +import com.azure.resourcemanager.compute.generated.models.Sku; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for AvailabilitySets Update. */ +public final class AvailabilitySetsUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/availabilitySetExamples/AvailabilitySet_Update_MinimumSet_Gen.json + */ + /** + * Sample code: AvailabilitySet_Update_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void availabilitySetUpdateMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + AvailabilitySet resource = + manager + .availabilitySets() + .getByResourceGroupWithResponse("rgcompute", "aaaaaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().apply(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/availabilitySetExamples/AvailabilitySet_Update_MaximumSet_Gen.json + */ + /** + * Sample code: AvailabilitySet_Update_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void availabilitySetUpdateMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + AvailabilitySet resource = + manager + .availabilitySets() + .getByResourceGroupWithResponse("rgcompute", "aaaaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("key2574", "aaaaaaaa")) + .withSku(new Sku().withName("DSv3-Type1").withTier("aaa").withCapacity(7L)) + .withPlatformUpdateDomainCount(20) + .withPlatformFaultDomainCount(2) + .withVirtualMachines( + Arrays + .asList( + new SubResource() + .withId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"))) + .withProximityPlacementGroup( + new SubResource() + .withId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}")) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### CapacityReservationGroups_CreateOrUpdate + +```java +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for CapacityReservationGroups CreateOrUpdate. */ +public final class CapacityReservationGroupsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/capacityReservationExamples/CapacityReservationGroup_CreateOrUpdate.json + */ + /** + * Sample code: Create or update a capacity reservation group. + * + * @param manager Entry point to ComputeManager. + */ + public static void createOrUpdateACapacityReservationGroup( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .capacityReservationGroups() + .define("myCapacityReservationGroup") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withTags(mapOf("department", "finance")) + .withZones(Arrays.asList("1", "2")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### CapacityReservationGroups_Delete + +```java +/** Samples for CapacityReservationGroups Delete. */ +public final class CapacityReservationGroupsDeleteSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/capacityReservationExamples/CapacityReservationGroup_Delete_MinimumSet_Gen.json + */ + /** + * Sample code: CapacityReservationGroup_Delete_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void capacityReservationGroupDeleteMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .capacityReservationGroups() + .deleteByResourceGroupWithResponse( + "rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/capacityReservationExamples/CapacityReservationGroup_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: CapacityReservationGroup_Delete_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void capacityReservationGroupDeleteMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .capacityReservationGroups() + .deleteByResourceGroupWithResponse("rgcompute", "a", com.azure.core.util.Context.NONE); + } +} +``` + +### CapacityReservationGroups_GetByResourceGroup + +```java +import com.azure.resourcemanager.compute.generated.models.CapacityReservationGroupInstanceViewTypes; + +/** Samples for CapacityReservationGroups GetByResourceGroup. */ +public final class CapacityReservationGroupsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/capacityReservationExamples/CapacityReservationGroup_Get.json + */ + /** + * Sample code: Get a capacity reservation Group. + * + * @param manager Entry point to ComputeManager. + */ + public static void getACapacityReservationGroup( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .capacityReservationGroups() + .getByResourceGroupWithResponse( + "myResourceGroup", + "myCapacityReservationGroup", + CapacityReservationGroupInstanceViewTypes.INSTANCE_VIEW, + com.azure.core.util.Context.NONE); + } +} +``` + +### CapacityReservationGroups_List + +```java +import com.azure.resourcemanager.compute.generated.models.ExpandTypesForGetCapacityReservationGroups; + +/** Samples for CapacityReservationGroups List. */ +public final class CapacityReservationGroupsListSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/capacityReservationExamples/CapacityReservationGroup_ListBySubscription.json + */ + /** + * Sample code: List capacity reservation groups in subscription. + * + * @param manager Entry point to ComputeManager. + */ + public static void listCapacityReservationGroupsInSubscription( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .capacityReservationGroups() + .list(ExpandTypesForGetCapacityReservationGroups.VIRTUAL_MACHINES_REF, com.azure.core.util.Context.NONE); + } +} +``` + +### CapacityReservationGroups_ListByResourceGroup + +```java +import com.azure.resourcemanager.compute.generated.models.ExpandTypesForGetCapacityReservationGroups; + +/** Samples for CapacityReservationGroups ListByResourceGroup. */ +public final class CapacityReservationGroupsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/capacityReservationExamples/CapacityReservationGroup_ListByResourceGroup.json + */ + /** + * Sample code: List capacity reservation groups in resource group. + * + * @param manager Entry point to ComputeManager. + */ + public static void listCapacityReservationGroupsInResourceGroup( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .capacityReservationGroups() + .listByResourceGroup( + "myResourceGroup", + ExpandTypesForGetCapacityReservationGroups.VIRTUAL_MACHINES_REF, + com.azure.core.util.Context.NONE); + } +} +``` + +### CapacityReservationGroups_Update + +```java +import com.azure.resourcemanager.compute.generated.models.CapacityReservationGroup; +import java.util.HashMap; +import java.util.Map; + +/** Samples for CapacityReservationGroups Update. */ +public final class CapacityReservationGroupsUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/capacityReservationExamples/CapacityReservationGroup_Update_MinimumSet_Gen.json + */ + /** + * Sample code: CapacityReservationGroup_Update_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void capacityReservationGroupUpdateMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + CapacityReservationGroup resource = + manager + .capacityReservationGroups() + .getByResourceGroupWithResponse( + "rgcompute", "aaaaaaaaaaaaaaaaaaaaaa", null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update().apply(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/capacityReservationExamples/CapacityReservationGroup_Update_MaximumSet_Gen.json + */ + /** + * Sample code: CapacityReservationGroup_Update_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void capacityReservationGroupUpdateMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + CapacityReservationGroup resource = + manager + .capacityReservationGroups() + .getByResourceGroupWithResponse( + "rgcompute", "aaaaaaaaaaaaaaaaaaaaaa", null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key5355", "aaa")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### CapacityReservations_CreateOrUpdate + +```java +import com.azure.resourcemanager.compute.generated.models.Sku; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for CapacityReservations CreateOrUpdate. */ +public final class CapacityReservationsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/capacityReservationExamples/CapacityReservation_CreateOrUpdate.json + */ + /** + * Sample code: Create or update a capacity reservation . + * + * @param manager Entry point to ComputeManager. + */ + public static void createOrUpdateACapacityReservation( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .capacityReservations() + .define("myCapacityReservation") + .withRegion("westus") + .withExistingCapacityReservationGroup("myResourceGroup", "myCapacityReservationGroup") + .withSku(new Sku().withName("Standard_DS1_v2").withCapacity(4L)) + .withTags(mapOf("department", "HR")) + .withZones(Arrays.asList("1")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### CapacityReservations_Delete + +```java +/** Samples for CapacityReservations Delete. */ +public final class CapacityReservationsDeleteSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/capacityReservationExamples/CapacityReservation_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: CapacityReservation_Delete_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void capacityReservationDeleteMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .capacityReservations() + .delete("rgcompute", "aaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/capacityReservationExamples/CapacityReservation_Delete_MinimumSet_Gen.json + */ + /** + * Sample code: CapacityReservation_Delete_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void capacityReservationDeleteMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.capacityReservations().delete("rgcompute", "aaa", "aaaaaa", com.azure.core.util.Context.NONE); + } +} +``` + +### CapacityReservations_Get + +```java +import com.azure.resourcemanager.compute.generated.models.CapacityReservationInstanceViewTypes; + +/** Samples for CapacityReservations Get. */ +public final class CapacityReservationsGetSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/capacityReservationExamples/CapacityReservation_Get.json + */ + /** + * Sample code: Get a capacity reservation. + * + * @param manager Entry point to ComputeManager. + */ + public static void getACapacityReservation(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .capacityReservations() + .getWithResponse( + "myResourceGroup", + "myCapacityReservationGroup", + "myCapacityReservation", + CapacityReservationInstanceViewTypes.INSTANCE_VIEW, + com.azure.core.util.Context.NONE); + } +} +``` + +### CapacityReservations_ListByCapacityReservationGroup + +```java +/** Samples for CapacityReservations ListByCapacityReservationGroup. */ +public final class CapacityReservationsListByCapacityReservationGroupSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/capacityReservationExamples/CapacityReservation_ListByReservationGroup.json + */ + /** + * Sample code: List capacity reservations in reservation group. + * + * @param manager Entry point to ComputeManager. + */ + public static void listCapacityReservationsInReservationGroup( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .capacityReservations() + .listByCapacityReservationGroup( + "myResourceGroup", "myCapacityReservationGroup", com.azure.core.util.Context.NONE); + } +} +``` + +### CapacityReservations_Update + +```java +import com.azure.resourcemanager.compute.generated.models.CapacityReservation; +import com.azure.resourcemanager.compute.generated.models.Sku; +import java.util.HashMap; +import java.util.Map; + +/** Samples for CapacityReservations Update. */ +public final class CapacityReservationsUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/capacityReservationExamples/CapacityReservation_Update_MinimumSet_Gen.json + */ + /** + * Sample code: CapacityReservation_Update_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void capacityReservationUpdateMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + CapacityReservation resource = + manager + .capacityReservations() + .getWithResponse( + "rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaa", "aaa", null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update().apply(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/capacityReservationExamples/CapacityReservation_Update_MaximumSet_Gen.json + */ + /** + * Sample code: CapacityReservation_Update_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void capacityReservationUpdateMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + CapacityReservation resource = + manager + .capacityReservations() + .getWithResponse( + "rgcompute", "aaaaaaaaaa", "aaaaaaaaaaaaaaaaaaa", null, com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("key4974", "aaaaaaaaaaaaaaaa")) + .withSku(new Sku().withName("Standard_DS1_v2").withTier("aaa").withCapacity(7L)) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### CloudServiceOperatingSystems_GetOSFamily + +```java +/** Samples for CloudServiceOperatingSystems GetOSFamily. */ +public final class CloudServiceOperatingSystemsGetOSFamilySamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudServiceOSFamily_Get.json + */ + /** + * Sample code: Get Cloud Service OS Family. + * + * @param manager Entry point to ComputeManager. + */ + public static void getCloudServiceOSFamily(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .cloudServiceOperatingSystems() + .getOSFamilyWithResponse("westus2", "3", com.azure.core.util.Context.NONE); + } +} +``` + +### CloudServiceOperatingSystems_GetOSVersion + +```java +/** Samples for CloudServiceOperatingSystems GetOSVersion. */ +public final class CloudServiceOperatingSystemsGetOSVersionSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudServiceOSVersion_Get.json + */ + /** + * Sample code: Get Cloud Service OS Version. + * + * @param manager Entry point to ComputeManager. + */ + public static void getCloudServiceOSVersion(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .cloudServiceOperatingSystems() + .getOSVersionWithResponse("westus2", "WA-GUEST-OS-3.90_202010-02", com.azure.core.util.Context.NONE); + } +} +``` + +### CloudServiceOperatingSystems_ListOSFamilies + +```java +/** Samples for CloudServiceOperatingSystems ListOSFamilies. */ +public final class CloudServiceOperatingSystemsListOSFamiliesSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudServiceOSFamilies_List.json + */ + /** + * Sample code: List Cloud Service OS Families in a subscription. + * + * @param manager Entry point to ComputeManager. + */ + public static void listCloudServiceOSFamiliesInASubscription( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.cloudServiceOperatingSystems().listOSFamilies("westus2", com.azure.core.util.Context.NONE); + } +} +``` + +### CloudServiceOperatingSystems_ListOSVersions + +```java +/** Samples for CloudServiceOperatingSystems ListOSVersions. */ +public final class CloudServiceOperatingSystemsListOSVersionsSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudServiceOSVersion_List.json + */ + /** + * Sample code: List Cloud Service OS Versions in a subscription. + * + * @param manager Entry point to ComputeManager. + */ + public static void listCloudServiceOSVersionsInASubscription( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.cloudServiceOperatingSystems().listOSVersions("westus2", com.azure.core.util.Context.NONE); + } +} +``` + +### CloudServiceRoleInstances_Delete + +```java +/** Samples for CloudServiceRoleInstances Delete. */ +public final class CloudServiceRoleInstancesDeleteSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudServiceRoleInstance_Delete.json + */ + /** + * Sample code: Delete Cloud Service Role Instance. + * + * @param manager Entry point to ComputeManager. + */ + public static void deleteCloudServiceRoleInstance( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .cloudServiceRoleInstances() + .delete("{roleInstance-name}", "ConstosoRG", "{cs-name}", com.azure.core.util.Context.NONE); + } +} +``` + +### CloudServiceRoleInstances_Get + +```java +/** Samples for CloudServiceRoleInstances Get. */ +public final class CloudServiceRoleInstancesGetSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudServiceRoleInstance_Get.json + */ + /** + * Sample code: Get Cloud Service Role Instance. + * + * @param manager Entry point to ComputeManager. + */ + public static void getCloudServiceRoleInstance(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .cloudServiceRoleInstances() + .getWithResponse("{roleInstance-name}", "ConstosoRG", "{cs-name}", null, com.azure.core.util.Context.NONE); + } +} +``` + +### CloudServiceRoleInstances_GetInstanceView + +```java +/** Samples for CloudServiceRoleInstances GetInstanceView. */ +public final class CloudServiceRoleInstancesGetInstanceViewSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudServiceRoleInstance_Get_InstanceView.json + */ + /** + * Sample code: Get Instance View of Cloud Service Role Instance. + * + * @param manager Entry point to ComputeManager. + */ + public static void getInstanceViewOfCloudServiceRoleInstance( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .cloudServiceRoleInstances() + .getInstanceViewWithResponse( + "{roleInstance-name}", "ConstosoRG", "{cs-name}", com.azure.core.util.Context.NONE); + } +} +``` + +### CloudServiceRoleInstances_GetRemoteDesktopFile + +```java +/** Samples for CloudServiceRoleInstances GetRemoteDesktopFile. */ +public final class CloudServiceRoleInstancesGetRemoteDesktopFileSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudServiceRoleInstance_Get_RemoteDesktopFile.json + */ + /** + * Sample code: Get Cloud Service Role. + * + * @param manager Entry point to ComputeManager. + */ + public static void getCloudServiceRole(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .cloudServiceRoleInstances() + .getRemoteDesktopFileWithResponse( + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "rgcloudService", "aaaa", com.azure.core.util.Context.NONE); + } +} +``` + +### CloudServiceRoleInstances_List + +```java +/** Samples for CloudServiceRoleInstances List. */ +public final class CloudServiceRoleInstancesListSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudServiceRolesInstance_List.json + */ + /** + * Sample code: List Role Instances in a Cloud Service. + * + * @param manager Entry point to ComputeManager. + */ + public static void listRoleInstancesInACloudService( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.cloudServiceRoleInstances().list("ConstosoRG", "{cs-name}", null, com.azure.core.util.Context.NONE); + } +} +``` + +### CloudServiceRoleInstances_Rebuild + +```java +/** Samples for CloudServiceRoleInstances Rebuild. */ +public final class CloudServiceRoleInstancesRebuildSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudServiceRoleInstance_Rebuild.json + */ + /** + * Sample code: Rebuild Cloud Service Role Instance. + * + * @param manager Entry point to ComputeManager. + */ + public static void rebuildCloudServiceRoleInstance( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .cloudServiceRoleInstances() + .rebuild("{roleInstance-name}", "ConstosoRG", "{cs-name}", com.azure.core.util.Context.NONE); + } +} +``` + +### CloudServiceRoleInstances_Reimage + +```java +/** Samples for CloudServiceRoleInstances Reimage. */ +public final class CloudServiceRoleInstancesReimageSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudServiceRoleInstance_Reimage.json + */ + /** + * Sample code: Reimage Cloud Service Role Instance. + * + * @param manager Entry point to ComputeManager. + */ + public static void reimageCloudServiceRoleInstance( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .cloudServiceRoleInstances() + .reimage("{roleInstance-name}", "ConstosoRG", "{cs-name}", com.azure.core.util.Context.NONE); + } +} +``` + +### CloudServiceRoleInstances_Restart + +```java +/** Samples for CloudServiceRoleInstances Restart. */ +public final class CloudServiceRoleInstancesRestartSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudServiceRoleInstance_Restart.json + */ + /** + * Sample code: Restart Cloud Service Role Instance. + * + * @param manager Entry point to ComputeManager. + */ + public static void restartCloudServiceRoleInstance( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .cloudServiceRoleInstances() + .restart("{roleInstance-name}", "ConstosoRG", "{cs-name}", com.azure.core.util.Context.NONE); + } +} +``` + +### CloudServiceRoles_Get + +```java +/** Samples for CloudServiceRoles Get. */ +public final class CloudServiceRolesGetSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudServiceRole_Get.json + */ + /** + * Sample code: Get Cloud Service Role. + * + * @param manager Entry point to ComputeManager. + */ + public static void getCloudServiceRole(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .cloudServiceRoles() + .getWithResponse("{role-name}", "ConstosoRG", "{cs-name}", com.azure.core.util.Context.NONE); + } +} +``` + +### CloudServiceRoles_List + +```java +/** Samples for CloudServiceRoles List. */ +public final class CloudServiceRolesListSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudServiceRole_List.json + */ + /** + * Sample code: List Roles in a Cloud Service. + * + * @param manager Entry point to ComputeManager. + */ + public static void listRolesInACloudService(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.cloudServiceRoles().list("ConstosoRG", "{cs-name}", com.azure.core.util.Context.NONE); + } +} +``` + +### CloudServices_CreateOrUpdate + +```java +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.compute.generated.models.CloudServiceExtensionProfile; +import com.azure.resourcemanager.compute.generated.models.CloudServiceExtensionProperties; +import com.azure.resourcemanager.compute.generated.models.CloudServiceNetworkProfile; +import com.azure.resourcemanager.compute.generated.models.CloudServiceOsProfile; +import com.azure.resourcemanager.compute.generated.models.CloudServiceProperties; +import com.azure.resourcemanager.compute.generated.models.CloudServiceRoleProfile; +import com.azure.resourcemanager.compute.generated.models.CloudServiceRoleProfileProperties; +import com.azure.resourcemanager.compute.generated.models.CloudServiceRoleSku; +import com.azure.resourcemanager.compute.generated.models.CloudServiceUpgradeMode; +import com.azure.resourcemanager.compute.generated.models.CloudServiceVaultCertificate; +import com.azure.resourcemanager.compute.generated.models.CloudServiceVaultSecretGroup; +import com.azure.resourcemanager.compute.generated.models.Extension; +import com.azure.resourcemanager.compute.generated.models.LoadBalancerConfiguration; +import com.azure.resourcemanager.compute.generated.models.LoadBalancerConfigurationProperties; +import com.azure.resourcemanager.compute.generated.models.LoadBalancerFrontendIpConfiguration; +import com.azure.resourcemanager.compute.generated.models.LoadBalancerFrontendIpConfigurationProperties; +import java.util.Arrays; + +/** Samples for CloudServices CreateOrUpdate. */ +public final class CloudServicesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudService_Create_WithSingleRole.json + */ + /** + * Sample code: Create New Cloud Service with Single Role. + * + * @param manager Entry point to ComputeManager. + */ + public static void createNewCloudServiceWithSingleRole( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .cloudServices() + .define("{cs-name}") + .withRegion("westus") + .withExistingResourceGroup("ConstosoRG") + .withProperties( + new CloudServiceProperties() + .withPackageUrl("{PackageUrl}") + .withConfiguration("{ServiceConfiguration}") + .withUpgradeMode(CloudServiceUpgradeMode.AUTO) + .withRoleProfile( + new CloudServiceRoleProfile() + .withRoles( + Arrays + .asList( + new CloudServiceRoleProfileProperties() + .withName("ContosoFrontend") + .withSku( + new CloudServiceRoleSku() + .withName("Standard_D1_v2") + .withTier("Standard") + .withCapacity(1L))))) + .withNetworkProfile( + new CloudServiceNetworkProfile() + .withLoadBalancerConfigurations( + Arrays + .asList( + new LoadBalancerConfiguration() + .withName("myLoadBalancer") + .withProperties( + new LoadBalancerConfigurationProperties() + .withFrontendIpConfigurations( + Arrays + .asList( + new LoadBalancerFrontendIpConfiguration() + .withName("myfe") + .withProperties( + new LoadBalancerFrontendIpConfigurationProperties() + .withPublicIpAddress( + new SubResource() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/myPublicIP")))))))))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudService_Create_WithSingleRoleAndCertificate.json + */ + /** + * Sample code: Create New Cloud Service with Single Role and Certificate from Key Vault. + * + * @param manager Entry point to ComputeManager. + */ + public static void createNewCloudServiceWithSingleRoleAndCertificateFromKeyVault( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .cloudServices() + .define("{cs-name}") + .withRegion("westus") + .withExistingResourceGroup("ConstosoRG") + .withProperties( + new CloudServiceProperties() + .withPackageUrl("{PackageUrl}") + .withConfiguration("{ServiceConfiguration}") + .withUpgradeMode(CloudServiceUpgradeMode.AUTO) + .withRoleProfile( + new CloudServiceRoleProfile() + .withRoles( + Arrays + .asList( + new CloudServiceRoleProfileProperties() + .withName("ContosoFrontend") + .withSku( + new CloudServiceRoleSku() + .withName("Standard_D1_v2") + .withTier("Standard") + .withCapacity(1L))))) + .withOsProfile( + new CloudServiceOsProfile() + .withSecrets( + Arrays + .asList( + new CloudServiceVaultSecretGroup() + .withSourceVault( + new SubResource() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.KeyVault/vaults/{keyvault-name}")) + .withVaultCertificates( + Arrays + .asList( + new CloudServiceVaultCertificate() + .withCertificateUrl( + "https://{keyvault-name}.vault.azure.net:443/secrets/ContosoCertificate/{secret-id}")))))) + .withNetworkProfile( + new CloudServiceNetworkProfile() + .withLoadBalancerConfigurations( + Arrays + .asList( + new LoadBalancerConfiguration() + .withName("contosolb") + .withProperties( + new LoadBalancerConfigurationProperties() + .withFrontendIpConfigurations( + Arrays + .asList( + new LoadBalancerFrontendIpConfiguration() + .withName("contosofe") + .withProperties( + new LoadBalancerFrontendIpConfigurationProperties() + .withPublicIpAddress( + new SubResource() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip")))))))))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudService_Create_WithSingleRoleAndRDP.json + */ + /** + * Sample code: Create New Cloud Service with Single Role and RDP Extension. + * + * @param manager Entry point to ComputeManager. + */ + public static void createNewCloudServiceWithSingleRoleAndRDPExtension( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .cloudServices() + .define("{cs-name}") + .withRegion("westus") + .withExistingResourceGroup("ConstosoRG") + .withProperties( + new CloudServiceProperties() + .withPackageUrl("{PackageUrl}") + .withConfiguration("{ServiceConfiguration}") + .withUpgradeMode(CloudServiceUpgradeMode.AUTO) + .withRoleProfile( + new CloudServiceRoleProfile() + .withRoles( + Arrays + .asList( + new CloudServiceRoleProfileProperties() + .withName("ContosoFrontend") + .withSku( + new CloudServiceRoleSku() + .withName("Standard_D1_v2") + .withTier("Standard") + .withCapacity(1L))))) + .withNetworkProfile( + new CloudServiceNetworkProfile() + .withLoadBalancerConfigurations( + Arrays + .asList( + new LoadBalancerConfiguration() + .withName("contosolb") + .withProperties( + new LoadBalancerConfigurationProperties() + .withFrontendIpConfigurations( + Arrays + .asList( + new LoadBalancerFrontendIpConfiguration() + .withName("contosofe") + .withProperties( + new LoadBalancerFrontendIpConfigurationProperties() + .withPublicIpAddress( + new SubResource() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip"))))))))) + .withExtensionProfile( + new CloudServiceExtensionProfile() + .withExtensions( + Arrays + .asList( + new Extension() + .withName("RDPExtension") + .withProperties( + new CloudServiceExtensionProperties() + .withPublisher("Microsoft.Windows.Azure.Extensions") + .withType("RDP") + .withTypeHandlerVersion("1.2") + .withAutoUpgradeMinorVersion(false) + .withSettings( + "UserAzure10/22/2021" + + " 15:05:45") + .withProtectedSettings( + "{password}")))))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudService_Create_WithMultiRole.json + */ + /** + * Sample code: Create New Cloud Service with Multiple Roles. + * + * @param manager Entry point to ComputeManager. + */ + public static void createNewCloudServiceWithMultipleRoles( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .cloudServices() + .define("{cs-name}") + .withRegion("westus") + .withExistingResourceGroup("ConstosoRG") + .withProperties( + new CloudServiceProperties() + .withPackageUrl("{PackageUrl}") + .withConfiguration("{ServiceConfiguration}") + .withUpgradeMode(CloudServiceUpgradeMode.AUTO) + .withRoleProfile( + new CloudServiceRoleProfile() + .withRoles( + Arrays + .asList( + new CloudServiceRoleProfileProperties() + .withName("ContosoFrontend") + .withSku( + new CloudServiceRoleSku() + .withName("Standard_D1_v2") + .withTier("Standard") + .withCapacity(1L)), + new CloudServiceRoleProfileProperties() + .withName("ContosoBackend") + .withSku( + new CloudServiceRoleSku() + .withName("Standard_D1_v2") + .withTier("Standard") + .withCapacity(1L))))) + .withNetworkProfile( + new CloudServiceNetworkProfile() + .withLoadBalancerConfigurations( + Arrays + .asList( + new LoadBalancerConfiguration() + .withName("contosolb") + .withProperties( + new LoadBalancerConfigurationProperties() + .withFrontendIpConfigurations( + Arrays + .asList( + new LoadBalancerFrontendIpConfiguration() + .withName("contosofe") + .withProperties( + new LoadBalancerFrontendIpConfigurationProperties() + .withPublicIpAddress( + new SubResource() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip")))))))))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudService_Create_WithMultiRole_WithZones.json + */ + /** + * Sample code: Create New Cloud Service with Multiple Roles in a specific availability zone. + * + * @param manager Entry point to ComputeManager. + */ + public static void createNewCloudServiceWithMultipleRolesInASpecificAvailabilityZone( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .cloudServices() + .define("{cs-name}") + .withRegion("westus") + .withExistingResourceGroup("ConstosoRG") + .withProperties( + new CloudServiceProperties() + .withPackageUrl("{PackageUrl}") + .withConfiguration("{ServiceConfiguration}") + .withUpgradeMode(CloudServiceUpgradeMode.AUTO) + .withRoleProfile( + new CloudServiceRoleProfile() + .withRoles( + Arrays + .asList( + new CloudServiceRoleProfileProperties() + .withName("ContosoFrontend") + .withSku( + new CloudServiceRoleSku() + .withName("Standard_D1_v2") + .withTier("Standard") + .withCapacity(1L)), + new CloudServiceRoleProfileProperties() + .withName("ContosoBackend") + .withSku( + new CloudServiceRoleSku() + .withName("Standard_D1_v2") + .withTier("Standard") + .withCapacity(1L))))) + .withNetworkProfile( + new CloudServiceNetworkProfile() + .withLoadBalancerConfigurations( + Arrays + .asList( + new LoadBalancerConfiguration() + .withName("contosolb") + .withProperties( + new LoadBalancerConfigurationProperties() + .withFrontendIpConfigurations( + Arrays + .asList( + new LoadBalancerFrontendIpConfiguration() + .withName("contosofe") + .withProperties( + new LoadBalancerFrontendIpConfigurationProperties() + .withPublicIpAddress( + new SubResource() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip")))))))))) + .withZones(Arrays.asList("1")) + .create(); + } +} +``` + +### CloudServices_Delete + +```java +/** Samples for CloudServices Delete. */ +public final class CloudServicesDeleteSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudService_Delete.json + */ + /** + * Sample code: Delete Cloud Service. + * + * @param manager Entry point to ComputeManager. + */ + public static void deleteCloudService(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.cloudServices().delete("ConstosoRG", "{cs-name}", com.azure.core.util.Context.NONE); + } +} +``` + +### CloudServices_DeleteInstances + +```java +import com.azure.resourcemanager.compute.generated.models.RoleInstances; +import java.util.Arrays; + +/** Samples for CloudServices DeleteInstances. */ +public final class CloudServicesDeleteInstancesSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudServiceRoleInstance_Delete_ByCloudService.json + */ + /** + * Sample code: Delete Cloud Service Role Instances in a Cloud Service. + * + * @param manager Entry point to ComputeManager. + */ + public static void deleteCloudServiceRoleInstancesInACloudService( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .cloudServices() + .deleteInstances( + "ConstosoRG", + "{cs-name}", + new RoleInstances().withRoleInstances(Arrays.asList("ContosoFrontend_IN_0", "ContosoBackend_IN_1")), + com.azure.core.util.Context.NONE); + } +} +``` + +### CloudServices_GetByResourceGroup + +```java +/** Samples for CloudServices GetByResourceGroup. */ +public final class CloudServicesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudService_Get_WithMultiRoleAndRDP.json + */ + /** + * Sample code: Get Cloud Service with Multiple Roles and RDP Extension. + * + * @param manager Entry point to ComputeManager. + */ + public static void getCloudServiceWithMultipleRolesAndRDPExtension( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .cloudServices() + .getByResourceGroupWithResponse("ConstosoRG", "{cs-name}", com.azure.core.util.Context.NONE); + } +} +``` + +### CloudServices_GetInstanceView + +```java +/** Samples for CloudServices GetInstanceView. */ +public final class CloudServicesGetInstanceViewSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudService_Get_InstanceViewWithMultiRole.json + */ + /** + * Sample code: Get Cloud Service Instance View with Multiple Roles. + * + * @param manager Entry point to ComputeManager. + */ + public static void getCloudServiceInstanceViewWithMultipleRoles( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .cloudServices() + .getInstanceViewWithResponse("ConstosoRG", "{cs-name}", com.azure.core.util.Context.NONE); + } +} +``` + +### CloudServices_List + +```java +/** Samples for CloudServices List. */ +public final class CloudServicesListSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudService_List_BySubscription.json + */ + /** + * Sample code: List Cloud Services in a Subscription. + * + * @param manager Entry point to ComputeManager. + */ + public static void listCloudServicesInASubscription( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.cloudServices().list(com.azure.core.util.Context.NONE); + } +} +``` + +### CloudServices_ListByResourceGroup + +```java +/** Samples for CloudServices ListByResourceGroup. */ +public final class CloudServicesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudService_List_ByResourceGroup.json + */ + /** + * Sample code: List Cloud Services in a Resource Group. + * + * @param manager Entry point to ComputeManager. + */ + public static void listCloudServicesInAResourceGroup( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.cloudServices().listByResourceGroup("ConstosoRG", com.azure.core.util.Context.NONE); + } +} +``` + +### CloudServices_PowerOff + +```java +/** Samples for CloudServices PowerOff. */ +public final class CloudServicesPowerOffSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudService_PowerOff.json + */ + /** + * Sample code: Stop or PowerOff Cloud Service. + * + * @param manager Entry point to ComputeManager. + */ + public static void stopOrPowerOffCloudService(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.cloudServices().powerOff("ConstosoRG", "{cs-name}", com.azure.core.util.Context.NONE); + } +} +``` + +### CloudServices_Rebuild + +```java +import com.azure.resourcemanager.compute.generated.models.RoleInstances; +import java.util.Arrays; + +/** Samples for CloudServices Rebuild. */ +public final class CloudServicesRebuildSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudServiceRoleInstance_Rebuild_ByCloudService.json + */ + /** + * Sample code: Rebuild Cloud Service Role Instances in a Cloud Service. + * + * @param manager Entry point to ComputeManager. + */ + public static void rebuildCloudServiceRoleInstancesInACloudService( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .cloudServices() + .rebuild( + "ConstosoRG", + "{cs-name}", + new RoleInstances().withRoleInstances(Arrays.asList("ContosoFrontend_IN_0", "ContosoBackend_IN_1")), + com.azure.core.util.Context.NONE); + } +} +``` + +### CloudServices_Reimage + +```java +import com.azure.resourcemanager.compute.generated.models.RoleInstances; +import java.util.Arrays; + +/** Samples for CloudServices Reimage. */ +public final class CloudServicesReimageSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudServiceRoleInstance_Reimage_ByCloudService.json + */ + /** + * Sample code: Reimage Cloud Service Role Instances in a Cloud Service. + * + * @param manager Entry point to ComputeManager. + */ + public static void reimageCloudServiceRoleInstancesInACloudService( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .cloudServices() + .reimage( + "ConstosoRG", + "{cs-name}", + new RoleInstances().withRoleInstances(Arrays.asList("ContosoFrontend_IN_0", "ContosoBackend_IN_1")), + com.azure.core.util.Context.NONE); + } +} +``` + +### CloudServices_Restart + +```java +import com.azure.resourcemanager.compute.generated.models.RoleInstances; +import java.util.Arrays; + +/** Samples for CloudServices Restart. */ +public final class CloudServicesRestartSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudServiceRoleInstance_Restart_ByCloudService.json + */ + /** + * Sample code: Restart Cloud Service Role Instances in a Cloud Service. + * + * @param manager Entry point to ComputeManager. + */ + public static void restartCloudServiceRoleInstancesInACloudService( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .cloudServices() + .restart( + "ConstosoRG", + "{cs-name}", + new RoleInstances().withRoleInstances(Arrays.asList("ContosoFrontend_IN_0", "ContosoBackend_IN_1")), + com.azure.core.util.Context.NONE); + } +} +``` + +### CloudServices_Start + +```java +/** Samples for CloudServices Start. */ +public final class CloudServicesStartSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudService_Start.json + */ + /** + * Sample code: Start Cloud Service. + * + * @param manager Entry point to ComputeManager. + */ + public static void startCloudService(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.cloudServices().start("ConstosoRG", "{cs-name}", com.azure.core.util.Context.NONE); + } +} +``` + +### CloudServices_Update + +```java +import com.azure.resourcemanager.compute.generated.models.CloudService; +import java.util.HashMap; +import java.util.Map; + +/** Samples for CloudServices Update. */ +public final class CloudServicesUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudService_Update_ToIncludeTags.json + */ + /** + * Sample code: Update existing Cloud Service to add tags. + * + * @param manager Entry point to ComputeManager. + */ + public static void updateExistingCloudServiceToAddTags( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + CloudService resource = + manager + .cloudServices() + .getByResourceGroupWithResponse("ConstosoRG", "{cs-name}", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("Documentation", "RestAPI")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### CloudServicesUpdateDomain_GetUpdateDomain + +```java +/** Samples for CloudServicesUpdateDomain GetUpdateDomain. */ +public final class CloudServicesUpdateDomainGetUpdateDomainSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudServiceUpdateDomain_Get.json + */ + /** + * Sample code: Get Cloud Service Update Domain. + * + * @param manager Entry point to ComputeManager. + */ + public static void getCloudServiceUpdateDomain(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .cloudServicesUpdateDomains() + .getUpdateDomainWithResponse("ConstosoRG", "{cs-name}", 1, com.azure.core.util.Context.NONE); + } +} +``` + +### CloudServicesUpdateDomain_ListUpdateDomains + +```java +/** Samples for CloudServicesUpdateDomain ListUpdateDomains. */ +public final class CloudServicesUpdateDomainListUpdateDomainsSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudServiceUpdateDomain_List.json + */ + /** + * Sample code: List Update Domains in Cloud Service. + * + * @param manager Entry point to ComputeManager. + */ + public static void listUpdateDomainsInCloudService( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .cloudServicesUpdateDomains() + .listUpdateDomains("ConstosoRG", "{cs-name}", com.azure.core.util.Context.NONE); + } +} +``` + +### CloudServicesUpdateDomain_WalkUpdateDomain + +```java +/** Samples for CloudServicesUpdateDomain WalkUpdateDomain. */ +public final class CloudServicesUpdateDomainWalkUpdateDomainSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudServiceUpdateDomain_Update.json + */ + /** + * Sample code: Update Cloud Service to specified Domain. + * + * @param manager Entry point to ComputeManager. + */ + public static void updateCloudServiceToSpecifiedDomain( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .cloudServicesUpdateDomains() + .walkUpdateDomain("ConstosoRG", "{cs-name}", 1, null, com.azure.core.util.Context.NONE); + } +} +``` + +### CommunityGalleries_Get + +```java +/** Samples for CommunityGalleries Get. */ +public final class CommunityGalleriesGetSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/communityGalleryExamples/CommunityGallery_Get.json + */ + /** + * Sample code: Get a community gallery. + * + * @param manager Entry point to ComputeManager. + */ + public static void getACommunityGallery(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .communityGalleries() + .getWithResponse("myLocation", "publicGalleryName", com.azure.core.util.Context.NONE); + } +} +``` + +### CommunityGalleryImageVersions_Get + +```java +/** Samples for CommunityGalleryImageVersions Get. */ +public final class CommunityGalleryImageVersionsGetSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/communityGalleryExamples/CommunityGalleryImageVersion_Get.json + */ + /** + * Sample code: Get a community gallery image version. + * + * @param manager Entry point to ComputeManager. + */ + public static void getACommunityGalleryImageVersion( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .communityGalleryImageVersions() + .getWithResponse( + "myLocation", + "publicGalleryName", + "myGalleryImageName", + "myGalleryImageVersionName", + com.azure.core.util.Context.NONE); + } +} +``` + +### CommunityGalleryImageVersions_List + +```java +/** Samples for CommunityGalleryImageVersions List. */ +public final class CommunityGalleryImageVersionsListSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/communityGalleryExamples/CommunityGalleryImageVersion_List.json + */ + /** + * Sample code: List community gallery image versions. + * + * @param manager Entry point to ComputeManager. + */ + public static void listCommunityGalleryImageVersions( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .communityGalleryImageVersions() + .list("myLocation", "publicGalleryName", "myGalleryImageName", com.azure.core.util.Context.NONE); + } +} +``` + +### CommunityGalleryImages_Get + +```java +/** Samples for CommunityGalleryImages Get. */ +public final class CommunityGalleryImagesGetSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/communityGalleryExamples/CommunityGalleryImage_Get.json + */ + /** + * Sample code: Get a community gallery image. + * + * @param manager Entry point to ComputeManager. + */ + public static void getACommunityGalleryImage(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .communityGalleryImages() + .getWithResponse("myLocation", "publicGalleryName", "myGalleryImageName", com.azure.core.util.Context.NONE); + } +} +``` + +### CommunityGalleryImages_List + +```java +/** Samples for CommunityGalleryImages List. */ +public final class CommunityGalleryImagesListSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/communityGalleryExamples/CommunityGalleryImage_List.json + */ + /** + * Sample code: List community gallery images. + * + * @param manager Entry point to ComputeManager. + */ + public static void listCommunityGalleryImages(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.communityGalleryImages().list("myLocation", "publicGalleryName", com.azure.core.util.Context.NONE); + } +} +``` + +### DedicatedHostGroups_CreateOrUpdate + +```java +import com.azure.resourcemanager.compute.generated.models.DedicatedHostGroupPropertiesAdditionalCapabilities; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for DedicatedHostGroups CreateOrUpdate. */ +public final class DedicatedHostGroupsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_CreateOrUpdate.json + */ + /** + * Sample code: Create or update a dedicated host group. + * + * @param manager Entry point to ComputeManager. + */ + public static void createOrUpdateADedicatedHostGroup( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .dedicatedHostGroups() + .define("myDedicatedHostGroup") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withTags(mapOf("department", "finance")) + .withZones(Arrays.asList("1")) + .withPlatformFaultDomainCount(3) + .withSupportAutomaticPlacement(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_CreateOrUpdate_WithUltraSSD.json + */ + /** + * Sample code: Create or update a dedicated host group with Ultra SSD support. + * + * @param manager Entry point to ComputeManager. + */ + public static void createOrUpdateADedicatedHostGroupWithUltraSSDSupport( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .dedicatedHostGroups() + .define("myDedicatedHostGroup") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withTags(mapOf("department", "finance")) + .withZones(Arrays.asList("1")) + .withPlatformFaultDomainCount(3) + .withSupportAutomaticPlacement(true) + .withAdditionalCapabilities( + new DedicatedHostGroupPropertiesAdditionalCapabilities().withUltraSsdEnabled(true)) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### DedicatedHostGroups_Delete + +```java +/** Samples for DedicatedHostGroups Delete. */ +public final class DedicatedHostGroupsDeleteSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: DedicatedHostGroup_Delete_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void dedicatedHostGroupDeleteMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .dedicatedHostGroups() + .deleteByResourceGroupWithResponse("rgcompute", "a", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_Delete_MinimumSet_Gen.json + */ + /** + * Sample code: DedicatedHostGroup_Delete_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void dedicatedHostGroupDeleteMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .dedicatedHostGroups() + .deleteByResourceGroupWithResponse("rgcompute", "aaaa", com.azure.core.util.Context.NONE); + } +} +``` + +### DedicatedHostGroups_GetByResourceGroup + +```java +/** Samples for DedicatedHostGroups GetByResourceGroup. */ +public final class DedicatedHostGroupsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_Get_UltraSSDEnabledDedicatedHostGroup.json + */ + /** + * Sample code: Create an ultraSSDEnabled dedicated host group. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAnUltraSSDEnabledDedicatedHostGroup( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .dedicatedHostGroups() + .getByResourceGroupWithResponse( + "myResourceGroup", "myDedicatedHostGroup", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_Get.json + */ + /** + * Sample code: Create a dedicated host group. + * + * @param manager Entry point to ComputeManager. + */ + public static void createADedicatedHostGroup(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .dedicatedHostGroups() + .getByResourceGroupWithResponse( + "myResourceGroup", "myDedicatedHostGroup", null, com.azure.core.util.Context.NONE); + } +} +``` + +### DedicatedHostGroups_List + +```java +/** Samples for DedicatedHostGroups List. */ +public final class DedicatedHostGroupsListSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_ListBySubscription_MaximumSet_Gen.json + */ + /** + * Sample code: DedicatedHostGroup_ListBySubscription_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void dedicatedHostGroupListBySubscriptionMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.dedicatedHostGroups().list(com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_ListBySubscription_MinimumSet_Gen.json + */ + /** + * Sample code: DedicatedHostGroup_ListBySubscription_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void dedicatedHostGroupListBySubscriptionMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.dedicatedHostGroups().list(com.azure.core.util.Context.NONE); + } +} +``` + +### DedicatedHostGroups_ListByResourceGroup + +```java +/** Samples for DedicatedHostGroups ListByResourceGroup. */ +public final class DedicatedHostGroupsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_ListByResourceGroup_MaximumSet_Gen.json + */ + /** + * Sample code: DedicatedHostGroup_ListByResourceGroup_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void dedicatedHostGroupListByResourceGroupMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.dedicatedHostGroups().listByResourceGroup("rgcompute", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_ListByResourceGroup_MinimumSet_Gen.json + */ + /** + * Sample code: DedicatedHostGroup_ListByResourceGroup_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void dedicatedHostGroupListByResourceGroupMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.dedicatedHostGroups().listByResourceGroup("rgcompute", com.azure.core.util.Context.NONE); + } +} +``` + +### DedicatedHostGroups_Update + +```java +import com.azure.resourcemanager.compute.generated.models.DedicatedHostGroup; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for DedicatedHostGroups Update. */ +public final class DedicatedHostGroupsUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_Update_MaximumSet_Gen.json + */ + /** + * Sample code: DedicatedHostGroup_Update_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void dedicatedHostGroupUpdateMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + DedicatedHostGroup resource = + manager + .dedicatedHostGroups() + .getByResourceGroupWithResponse("rgcompute", "aaaa", null, com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("key9921", "aaaaaaaaaa")) + .withZones(Arrays.asList("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa")) + .withPlatformFaultDomainCount(3) + .withSupportAutomaticPlacement(true) + .apply(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_Update_MinimumSet_Gen.json + */ + /** + * Sample code: DedicatedHostGroup_Update_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void dedicatedHostGroupUpdateMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + DedicatedHostGroup resource = + manager + .dedicatedHostGroups() + .getByResourceGroupWithResponse("rgcompute", "aaaaaaaaaaa", null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update().apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### DedicatedHosts_CreateOrUpdate + +```java +import com.azure.resourcemanager.compute.generated.models.Sku; +import java.util.HashMap; +import java.util.Map; + +/** Samples for DedicatedHosts CreateOrUpdate. */ +public final class DedicatedHostsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/dedicatedHostExamples/DedicatedHost_CreateOrUpdate.json + */ + /** + * Sample code: Create or update a dedicated host . + * + * @param manager Entry point to ComputeManager. + */ + public static void createOrUpdateADedicatedHost( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .dedicatedHosts() + .define("myDedicatedHost") + .withRegion("westus") + .withExistingHostGroup("myResourceGroup", "myDedicatedHostGroup") + .withSku(new Sku().withName("DSv3-Type1")) + .withTags(mapOf("department", "HR")) + .withPlatformFaultDomain(1) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### DedicatedHosts_Delete + +```java +/** Samples for DedicatedHosts Delete. */ +public final class DedicatedHostsDeleteSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/dedicatedHostExamples/DedicatedHost_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: DedicatedHost_Delete_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void dedicatedHostDeleteMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.dedicatedHosts().delete("rgcompute", "aaaaaa", "aaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/dedicatedHostExamples/DedicatedHost_Delete_MinimumSet_Gen.json + */ + /** + * Sample code: DedicatedHost_Delete_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void dedicatedHostDeleteMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.dedicatedHosts().delete("rgcompute", "aaaaaaaaaaaaaaa", "aaaaa", com.azure.core.util.Context.NONE); + } +} +``` + +### DedicatedHosts_Get + +```java +import com.azure.resourcemanager.compute.generated.models.InstanceViewTypes; + +/** Samples for DedicatedHosts Get. */ +public final class DedicatedHostsGetSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/dedicatedHostExamples/DedicatedHost_Get.json + */ + /** + * Sample code: Get a dedicated host. + * + * @param manager Entry point to ComputeManager. + */ + public static void getADedicatedHost(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .dedicatedHosts() + .getWithResponse( + "myResourceGroup", + "myDedicatedHostGroup", + "myHost", + InstanceViewTypes.INSTANCE_VIEW, + com.azure.core.util.Context.NONE); + } +} +``` + +### DedicatedHosts_ListAvailableSizes + +```java +/** Samples for DedicatedHosts ListAvailableSizes. */ +public final class DedicatedHostsListAvailableSizesSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/dedicatedHostExamples/DedicatedHost_ListAvailableSizes.json + */ + /** + * Sample code: Get Available Dedicated Host Sizes. + * + * @param manager Entry point to ComputeManager. + */ + public static void getAvailableDedicatedHostSizes( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .dedicatedHosts() + .listAvailableSizes("myResourceGroup", "myDedicatedHostGroup", "myHost", com.azure.core.util.Context.NONE); + } +} +``` + +### DedicatedHosts_ListByHostGroup + +```java +/** Samples for DedicatedHosts ListByHostGroup. */ +public final class DedicatedHostsListByHostGroupSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/dedicatedHostExamples/DedicatedHost_ListByHostGroup_MaximumSet_Gen.json + */ + /** + * Sample code: DedicatedHost_ListByHostGroup_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void dedicatedHostListByHostGroupMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .dedicatedHosts() + .listByHostGroup("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/dedicatedHostExamples/DedicatedHost_ListByHostGroup_MinimumSet_Gen.json + */ + /** + * Sample code: DedicatedHost_ListByHostGroup_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void dedicatedHostListByHostGroupMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.dedicatedHosts().listByHostGroup("rgcompute", "aaaa", com.azure.core.util.Context.NONE); + } +} +``` + +### DedicatedHosts_Restart + +```java +/** Samples for DedicatedHosts Restart. */ +public final class DedicatedHostsRestartSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/dedicatedHostExamples/DedicatedHost_Restart.json + */ + /** + * Sample code: Restart Dedicated Host. + * + * @param manager Entry point to ComputeManager. + */ + public static void restartDedicatedHost(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .dedicatedHosts() + .restart("myResourceGroup", "myDedicatedHostGroup", "myHost", com.azure.core.util.Context.NONE); + } +} +``` + +### DedicatedHosts_Update + +```java +import com.azure.resourcemanager.compute.generated.models.DedicatedHost; +import com.azure.resourcemanager.compute.generated.models.DedicatedHostLicenseTypes; +import com.azure.resourcemanager.compute.generated.models.Sku; +import java.util.HashMap; +import java.util.Map; + +/** Samples for DedicatedHosts Update. */ +public final class DedicatedHostsUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/dedicatedHostExamples/DedicatedHost_Update_Resize.json + */ + /** + * Sample code: DedicatedHost_Update_Resize. + * + * @param manager Entry point to ComputeManager. + */ + public static void dedicatedHostUpdateResize(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + DedicatedHost resource = + manager + .dedicatedHosts() + .getWithResponse( + "rgcompute", "aaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaa", null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withSku(new Sku().withName("DSv3-Type1")).apply(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/dedicatedHostExamples/DedicatedHost_Update_MaximumSet_Gen.json + */ + /** + * Sample code: DedicatedHost_Update_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void dedicatedHostUpdateMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + DedicatedHost resource = + manager + .dedicatedHosts() + .getWithResponse( + "rgcompute", "aaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaa", null, com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("key8813", "aaaaaaaaaaaaaaaaaaaaaaaaaaa")) + .withPlatformFaultDomain(1) + .withAutoReplaceOnFailure(true) + .withLicenseType(DedicatedHostLicenseTypes.WINDOWS_SERVER_HYBRID) + .apply(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/dedicatedHostExamples/DedicatedHost_Update_MinimumSet_Gen.json + */ + /** + * Sample code: DedicatedHost_Update_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void dedicatedHostUpdateMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + DedicatedHost resource = + manager + .dedicatedHosts() + .getWithResponse( + "rgcompute", "aa", "aaaaaaaaaaaaaaaaaaaaaaaaaa", null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update().apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### DiskAccesses_CreateOrUpdate + +```java +/** Samples for DiskAccesses CreateOrUpdate. */ +public final class DiskAccessesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskAccessExamples/DiskAccess_Create.json + */ + /** + * Sample code: Create a disk access resource. + * + * @param manager Entry point to ComputeManager. + */ + public static void createADiskAccessResource(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .diskAccesses() + .define("myDiskAccess") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .create(); + } +} +``` + +### DiskAccesses_Delete + +```java +/** Samples for DiskAccesses Delete. */ +public final class DiskAccessesDeleteSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskAccessExamples/DiskAccess_Delete.json + */ + /** + * Sample code: Delete a disk access resource. + * + * @param manager Entry point to ComputeManager. + */ + public static void deleteADiskAccessResource(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.diskAccesses().delete("myResourceGroup", "myDiskAccess", com.azure.core.util.Context.NONE); + } +} +``` + +### DiskAccesses_DeleteAPrivateEndpointConnection + +```java +/** Samples for DiskAccesses DeleteAPrivateEndpointConnection. */ +public final class DiskAccessesDeleteAPrivateEndpointConnectionSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskAccessExamples/DiskAccessPrivateEndpointConnection_Delete.json + */ + /** + * Sample code: Delete a private endpoint connection under a disk access resource. + * + * @param manager Entry point to ComputeManager. + */ + public static void deleteAPrivateEndpointConnectionUnderADiskAccessResource( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .diskAccesses() + .deleteAPrivateEndpointConnection( + "myResourceGroup", "myDiskAccess", "myPrivateEndpointConnection", com.azure.core.util.Context.NONE); + } +} +``` + +### DiskAccesses_GetAPrivateEndpointConnection + +```java +/** Samples for DiskAccesses GetAPrivateEndpointConnection. */ +public final class DiskAccessesGetAPrivateEndpointConnectionSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskAccessExamples/DiskAccessPrivateEndpointConnection_Get.json + */ + /** + * Sample code: Get information about a private endpoint connection under a disk access resource. + * + * @param manager Entry point to ComputeManager. + */ + public static void getInformationAboutAPrivateEndpointConnectionUnderADiskAccessResource( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .diskAccesses() + .getAPrivateEndpointConnectionWithResponse( + "myResourceGroup", "myDiskAccess", "myPrivateEndpointConnection", com.azure.core.util.Context.NONE); + } +} +``` + +### DiskAccesses_GetByResourceGroup + +```java +/** Samples for DiskAccesses GetByResourceGroup. */ +public final class DiskAccessesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskAccessExamples/DiskAccess_Get.json + */ + /** + * Sample code: Get information about a disk access resource. + * + * @param manager Entry point to ComputeManager. + */ + public static void getInformationAboutADiskAccessResource( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .diskAccesses() + .getByResourceGroupWithResponse("myResourceGroup", "myDiskAccess", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskAccessExamples/DiskAccess_Get_WithPrivateEndpoints.json + */ + /** + * Sample code: Get information about a disk access resource with private endpoints. + * + * @param manager Entry point to ComputeManager. + */ + public static void getInformationAboutADiskAccessResourceWithPrivateEndpoints( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .diskAccesses() + .getByResourceGroupWithResponse("myResourceGroup", "myDiskAccess", com.azure.core.util.Context.NONE); + } +} +``` + +### DiskAccesses_GetPrivateLinkResources + +```java +/** Samples for DiskAccesses GetPrivateLinkResources. */ +public final class DiskAccessesGetPrivateLinkResourcesSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskAccessExamples/DiskAccessPrivateLinkResources_Get.json + */ + /** + * Sample code: List all possible private link resources under disk access resource. + * + * @param manager Entry point to ComputeManager. + */ + public static void listAllPossiblePrivateLinkResourcesUnderDiskAccessResource( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .diskAccesses() + .getPrivateLinkResourcesWithResponse("myResourceGroup", "myDiskAccess", com.azure.core.util.Context.NONE); + } +} +``` + +### DiskAccesses_List + +```java +/** Samples for DiskAccesses List. */ +public final class DiskAccessesListSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskAccessExamples/DiskAccess_ListBySubscription.json + */ + /** + * Sample code: List all disk access resources in a subscription. + * + * @param manager Entry point to ComputeManager. + */ + public static void listAllDiskAccessResourcesInASubscription( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.diskAccesses().list(com.azure.core.util.Context.NONE); + } +} +``` + +### DiskAccesses_ListByResourceGroup + +```java +/** Samples for DiskAccesses ListByResourceGroup. */ +public final class DiskAccessesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskAccessExamples/DiskAccess_ListByResourceGroup.json + */ + /** + * Sample code: List all disk access resources in a resource group. + * + * @param manager Entry point to ComputeManager. + */ + public static void listAllDiskAccessResourcesInAResourceGroup( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.diskAccesses().listByResourceGroup("myResourceGroup", com.azure.core.util.Context.NONE); + } +} +``` + +### DiskAccesses_ListPrivateEndpointConnections + +```java +/** Samples for DiskAccesses ListPrivateEndpointConnections. */ +public final class DiskAccessesListPrivateEndpointConnectionsSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskAccessExamples/DiskAccessPrivateEndpointConnection_ListByDiskAccess.json + */ + /** + * Sample code: Get information about a private endpoint connection under a disk access resource. + * + * @param manager Entry point to ComputeManager. + */ + public static void getInformationAboutAPrivateEndpointConnectionUnderADiskAccessResource( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .diskAccesses() + .listPrivateEndpointConnections("myResourceGroup", "myDiskAccess", com.azure.core.util.Context.NONE); + } +} +``` + +### DiskAccesses_Update + +```java +import com.azure.resourcemanager.compute.generated.models.DiskAccess; +import java.util.HashMap; +import java.util.Map; + +/** Samples for DiskAccesses Update. */ +public final class DiskAccessesUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskAccessExamples/DiskAccess_Update.json + */ + /** + * Sample code: Update a disk access resource. + * + * @param manager Entry point to ComputeManager. + */ + public static void updateADiskAccessResource(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + DiskAccess resource = + manager + .diskAccesses() + .getByResourceGroupWithResponse("myResourceGroup", "myDiskAccess", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("department", "Development", "project", "PrivateEndpoints")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### DiskAccesses_UpdateAPrivateEndpointConnection + +```java +import com.azure.resourcemanager.compute.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.compute.generated.models.PrivateEndpointServiceConnectionStatus; +import com.azure.resourcemanager.compute.generated.models.PrivateLinkServiceConnectionState; + +/** Samples for DiskAccesses UpdateAPrivateEndpointConnection. */ +public final class DiskAccessesUpdateAPrivateEndpointConnectionSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskAccessExamples/DiskAccessPrivateEndpointConnection_Approve.json + */ + /** + * Sample code: Approve a Private Endpoint Connection under a disk access resource. + * + * @param manager Entry point to ComputeManager. + */ + public static void approveAPrivateEndpointConnectionUnderADiskAccessResource( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .diskAccesses() + .updateAPrivateEndpointConnection( + "myResourceGroup", + "myDiskAccess", + "myPrivateEndpointConnection", + new PrivateEndpointConnectionInner() + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState() + .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withDescription("Approving myPrivateEndpointConnection")), + com.azure.core.util.Context.NONE); + } +} +``` + +### DiskEncryptionSets_CreateOrUpdate + +```java +import com.azure.resourcemanager.compute.generated.models.DiskEncryptionSetIdentityType; +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.azure.resourcemanager.compute.generated.models.SourceVault; +import com.azure.resourcemanager.compute.generated.models.UserAssignedIdentitiesValue; +import java.util.HashMap; +import java.util.Map; + +/** Samples for DiskEncryptionSets CreateOrUpdate. */ +public final class DiskEncryptionSetsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Create_WithKeyVaultFromADifferentTenant.json + */ + /** + * Sample code: Create a disk encryption set with key vault from a different tenant. + * + * @param manager Entry point to ComputeManager. + */ + public static void createADiskEncryptionSetWithKeyVaultFromADifferentTenant( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .diskEncryptionSets() + .define("myDiskEncryptionSet") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withIdentity( + new EncryptionSetIdentity() + .withType(DiskEncryptionSetIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}", + new UserAssignedIdentitiesValue()))) + .withEncryptionType(DiskEncryptionSetType.ENCRYPTION_AT_REST_WITH_CUSTOMER_KEY) + .withActiveKey(new KeyForDiskEncryptionSet().withKeyUrl("fakeTokenPlaceholder")) + .withFederatedClientId("00000000-0000-0000-0000-000000000000") + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Create.json + */ + /** + * Sample code: Create a disk encryption set. + * + * @param manager Entry point to ComputeManager. + */ + public static void createADiskEncryptionSet(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .diskEncryptionSets() + .define("myDiskEncryptionSet") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withIdentity(new EncryptionSetIdentity().withType(DiskEncryptionSetIdentityType.SYSTEM_ASSIGNED)) + .withEncryptionType(DiskEncryptionSetType.ENCRYPTION_AT_REST_WITH_CUSTOMER_KEY) + .withActiveKey( + new KeyForDiskEncryptionSet() + .withSourceVault( + new SourceVault() + .withId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault")) + .withKeyUrl("fakeTokenPlaceholder")) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Create_WithKeyVaultFromADifferentSubscription.json + */ + /** + * Sample code: Create a disk encryption set with key vault from a different subscription. + * + * @param manager Entry point to ComputeManager. + */ + public static void createADiskEncryptionSetWithKeyVaultFromADifferentSubscription( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .diskEncryptionSets() + .define("myDiskEncryptionSet") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withIdentity(new EncryptionSetIdentity().withType(DiskEncryptionSetIdentityType.SYSTEM_ASSIGNED)) + .withEncryptionType(DiskEncryptionSetType.ENCRYPTION_AT_REST_WITH_CUSTOMER_KEY) + .withActiveKey(new KeyForDiskEncryptionSet().withKeyUrl("fakeTokenPlaceholder")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### DiskEncryptionSets_Delete + +```java +/** Samples for DiskEncryptionSets Delete. */ +public final class DiskEncryptionSetsDeleteSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Delete.json + */ + /** + * Sample code: Delete a disk encryption set. + * + * @param manager Entry point to ComputeManager. + */ + public static void deleteADiskEncryptionSet(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.diskEncryptionSets().delete("myResourceGroup", "myDiskEncryptionSet", com.azure.core.util.Context.NONE); + } +} +``` + +### DiskEncryptionSets_GetByResourceGroup + +```java +/** Samples for DiskEncryptionSets GetByResourceGroup. */ +public final class DiskEncryptionSetsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Get.json + */ + /** + * Sample code: Get information about a disk encryption set. + * + * @param manager Entry point to ComputeManager. + */ + public static void getInformationAboutADiskEncryptionSet( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .diskEncryptionSets() + .getByResourceGroupWithResponse("myResourceGroup", "myDiskEncryptionSet", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Get_WithAutoKeyRotationError.json + */ + /** + * Sample code: Get information about a disk encryption set when auto-key rotation failed. + * + * @param manager Entry point to ComputeManager. + */ + public static void getInformationAboutADiskEncryptionSetWhenAutoKeyRotationFailed( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .diskEncryptionSets() + .getByResourceGroupWithResponse("myResourceGroup", "myDiskEncryptionSet", com.azure.core.util.Context.NONE); + } +} +``` + +### DiskEncryptionSets_List + +```java +/** Samples for DiskEncryptionSets List. */ +public final class DiskEncryptionSetsListSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_ListBySubscription.json + */ + /** + * Sample code: List all disk encryption sets in a subscription. + * + * @param manager Entry point to ComputeManager. + */ + public static void listAllDiskEncryptionSetsInASubscription( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.diskEncryptionSets().list(com.azure.core.util.Context.NONE); + } +} +``` + +### DiskEncryptionSets_ListAssociatedResources + +```java +/** Samples for DiskEncryptionSets ListAssociatedResources. */ +public final class DiskEncryptionSetsListAssociatedResourcesSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_ListAssociatedResources.json + */ + /** + * Sample code: List all resources that are encrypted with this disk encryption set. + * + * @param manager Entry point to ComputeManager. + */ + public static void listAllResourcesThatAreEncryptedWithThisDiskEncryptionSet( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .diskEncryptionSets() + .listAssociatedResources("myResourceGroup", "myDiskEncryptionSet", com.azure.core.util.Context.NONE); + } +} +``` + +### DiskEncryptionSets_ListByResourceGroup + +```java +/** Samples for DiskEncryptionSets ListByResourceGroup. */ +public final class DiskEncryptionSetsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_ListByResourceGroup.json + */ + /** + * Sample code: List all disk encryption sets in a resource group. + * + * @param manager Entry point to ComputeManager. + */ + public static void listAllDiskEncryptionSetsInAResourceGroup( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.diskEncryptionSets().listByResourceGroup("myResourceGroup", com.azure.core.util.Context.NONE); + } +} +``` + +### DiskEncryptionSets_Update + +```java +import com.azure.resourcemanager.compute.generated.models.DiskEncryptionSet; +import com.azure.resourcemanager.compute.generated.models.DiskEncryptionSetIdentityType; +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.azure.resourcemanager.compute.generated.models.SourceVault; +import java.util.HashMap; +import java.util.Map; + +/** Samples for DiskEncryptionSets Update. */ +public final class DiskEncryptionSetsUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Update_WithRotationToLatestKeyVersionEnabled.json + */ + /** + * Sample code: Update a disk encryption set with rotationToLatestKeyVersionEnabled set to true - Succeeded. + * + * @param manager Entry point to ComputeManager. + */ + public static void updateADiskEncryptionSetWithRotationToLatestKeyVersionEnabledSetToTrueSucceeded( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + DiskEncryptionSet resource = + manager + .diskEncryptionSets() + .getByResourceGroupWithResponse( + "myResourceGroup", "myDiskEncryptionSet", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withIdentity(new EncryptionSetIdentity().withType(DiskEncryptionSetIdentityType.SYSTEM_ASSIGNED)) + .withEncryptionType(DiskEncryptionSetType.ENCRYPTION_AT_REST_WITH_CUSTOMER_KEY) + .withActiveKey(new KeyForDiskEncryptionSet().withKeyUrl("fakeTokenPlaceholder")) + .withRotationToLatestKeyVersionEnabled(true) + .apply(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Update_WithRotationToLatestKeyVersionEnabledInProgress.json + */ + /** + * Sample code: Update a disk encryption set with rotationToLatestKeyVersionEnabled set to true - Updating. + * + * @param manager Entry point to ComputeManager. + */ + public static void updateADiskEncryptionSetWithRotationToLatestKeyVersionEnabledSetToTrueUpdating( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + DiskEncryptionSet resource = + manager + .diskEncryptionSets() + .getByResourceGroupWithResponse( + "myResourceGroup", "myDiskEncryptionSet", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withIdentity(new EncryptionSetIdentity().withType(DiskEncryptionSetIdentityType.SYSTEM_ASSIGNED)) + .withEncryptionType(DiskEncryptionSetType.ENCRYPTION_AT_REST_WITH_CUSTOMER_KEY) + .withActiveKey(new KeyForDiskEncryptionSet().withKeyUrl("fakeTokenPlaceholder")) + .withRotationToLatestKeyVersionEnabled(true) + .apply(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Update.json + */ + /** + * Sample code: Update a disk encryption set. + * + * @param manager Entry point to ComputeManager. + */ + public static void updateADiskEncryptionSet(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + DiskEncryptionSet resource = + manager + .diskEncryptionSets() + .getByResourceGroupWithResponse( + "myResourceGroup", "myDiskEncryptionSet", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("department", "Development", "project", "Encryption")) + .withEncryptionType(DiskEncryptionSetType.ENCRYPTION_AT_REST_WITH_CUSTOMER_KEY) + .withActiveKey( + new KeyForDiskEncryptionSet() + .withSourceVault( + new SourceVault() + .withId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault")) + .withKeyUrl("fakeTokenPlaceholder")) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### DiskRestorePoint_Get + +```java +/** Samples for DiskRestorePoint Get. */ +public final class DiskRestorePointGetSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskRestorePointExamples/DiskRestorePoint_Get_WhenSourceResourceIsFromDifferentRegion.json + */ + /** + * Sample code: Get an incremental disk restorePoint when source resource is from a different region. + * + * @param manager Entry point to ComputeManager. + */ + public static void getAnIncrementalDiskRestorePointWhenSourceResourceIsFromADifferentRegion( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .diskRestorePoints() + .getWithResponse( + "myResourceGroup", + "rpc", + "vmrp", + "TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskRestorePointExamples/DiskRestorePoint_Get.json + */ + /** + * Sample code: Get an incremental disk restorePoint resource. + * + * @param manager Entry point to ComputeManager. + */ + public static void getAnIncrementalDiskRestorePointResource( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .diskRestorePoints() + .getWithResponse( + "myResourceGroup", + "rpc", + "vmrp", + "TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745", + com.azure.core.util.Context.NONE); + } +} +``` + +### DiskRestorePoint_GrantAccess + +```java +import com.azure.resourcemanager.compute.generated.models.AccessLevel; +import com.azure.resourcemanager.compute.generated.models.GrantAccessData; + +/** Samples for DiskRestorePoint GrantAccess. */ +public final class DiskRestorePointGrantAccessSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskRestorePointExamples/DiskRestorePoint_BeginGetAccess.json + */ + /** + * Sample code: Grants access to a diskRestorePoint. + * + * @param manager Entry point to ComputeManager. + */ + public static void grantsAccessToADiskRestorePoint( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .diskRestorePoints() + .grantAccess( + "myResourceGroup", + "rpc", + "vmrp", + "TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745", + new GrantAccessData().withAccess(AccessLevel.READ).withDurationInSeconds(300), + com.azure.core.util.Context.NONE); + } +} +``` + +### DiskRestorePoint_ListByRestorePoint + +```java +/** Samples for DiskRestorePoint ListByRestorePoint. */ +public final class DiskRestorePointListByRestorePointSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskRestorePointExamples/DiskRestorePoint_ListByVmRestorePoint.json + */ + /** + * Sample code: Get an incremental disk restorePoint resource. + * + * @param manager Entry point to ComputeManager. + */ + public static void getAnIncrementalDiskRestorePointResource( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .diskRestorePoints() + .listByRestorePoint("myResourceGroup", "rpc", "vmrp", com.azure.core.util.Context.NONE); + } +} +``` + +### DiskRestorePoint_RevokeAccess + +```java +/** Samples for DiskRestorePoint RevokeAccess. */ +public final class DiskRestorePointRevokeAccessSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskRestorePointExamples/DiskRestorePoint_EndGetAccess.json + */ + /** + * Sample code: Revokes access to a diskRestorePoint. + * + * @param manager Entry point to ComputeManager. + */ + public static void revokesAccessToADiskRestorePoint( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .diskRestorePoints() + .revokeAccess( + "myResourceGroup", + "rpc", + "vmrp", + "TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745", + com.azure.core.util.Context.NONE); + } +} +``` + +### Disks_CreateOrUpdate + +```java +import com.azure.resourcemanager.compute.generated.models.CreationData; +import com.azure.resourcemanager.compute.generated.models.DataAccessAuthMode; +import com.azure.resourcemanager.compute.generated.models.DiskCreateOption; +import com.azure.resourcemanager.compute.generated.models.DiskSecurityProfile; +import com.azure.resourcemanager.compute.generated.models.DiskSecurityTypes; +import com.azure.resourcemanager.compute.generated.models.DiskSku; +import com.azure.resourcemanager.compute.generated.models.DiskStorageAccountTypes; +import com.azure.resourcemanager.compute.generated.models.Encryption; +import com.azure.resourcemanager.compute.generated.models.EncryptionType; +import com.azure.resourcemanager.compute.generated.models.ExtendedLocation; +import com.azure.resourcemanager.compute.generated.models.ExtendedLocationTypes; +import com.azure.resourcemanager.compute.generated.models.ImageDiskReference; +import com.azure.resourcemanager.compute.generated.models.NetworkAccessPolicy; +import com.azure.resourcemanager.compute.generated.models.OperatingSystemTypes; + +/** Samples for Disks CreateOrUpdate. */ +public final class DisksCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_Create_ByImportingBlobFromADifferentSubscription.json + */ + /** + * Sample code: Create a managed disk by importing an unmanaged blob from a different subscription. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAManagedDiskByImportingAnUnmanagedBlobFromADifferentSubscription( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .disks() + .define("myDisk") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withCreationData( + new CreationData() + .withCreateOption(DiskCreateOption.IMPORT) + .withStorageAccountId( + "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount") + .withSourceUri("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd")) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_Create_FromImportSecure.json + */ + /** + * Sample code: Create a managed disk from ImportSecure create option. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAManagedDiskFromImportSecureCreateOption( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .disks() + .define("myDisk") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withOsType(OperatingSystemTypes.WINDOWS) + .withCreationData( + new CreationData() + .withCreateOption(DiskCreateOption.IMPORT_SECURE) + .withStorageAccountId( + "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount") + .withSourceUri("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd") + .withSecurityDataUri("https://mystorageaccount.blob.core.windows.net/osimages/vmgs.vhd")) + .withSecurityProfile( + new DiskSecurityProfile() + .withSecurityType(DiskSecurityTypes.CONFIDENTIAL_VM_VMGUEST_STATE_ONLY_ENCRYPTED_WITH_PLATFORM_KEY)) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_Create_WithDiskAccess.json + */ + /** + * Sample code: Create a managed disk and associate with disk access resource. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAManagedDiskAndAssociateWithDiskAccessResource( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .disks() + .define("myDisk") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withCreationData(new CreationData().withCreateOption(DiskCreateOption.EMPTY)) + .withDiskSizeGB(200) + .withNetworkAccessPolicy(NetworkAccessPolicy.ALLOW_PRIVATE) + .withDiskAccessId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskAccesses/{existing-diskAccess-name}") + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_Create_WithDiskEncryptionSet.json + */ + /** + * Sample code: Create a managed disk and associate with disk encryption set. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAManagedDiskAndAssociateWithDiskEncryptionSet( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .disks() + .define("myDisk") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withCreationData(new CreationData().withCreateOption(DiskCreateOption.EMPTY)) + .withDiskSizeGB(200) + .withEncryption( + new Encryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}")) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_Create_FromAnExistingManagedDisk.json + */ + /** + * Sample code: Create a managed disk from an existing managed disk in the same or different subscription. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAManagedDiskFromAnExistingManagedDiskInTheSameOrDifferentSubscription( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .disks() + .define("myDisk2") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withCreationData( + new CreationData() + .withCreateOption(DiskCreateOption.COPY) + .withSourceResourceId( + "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk1")) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_Create_PerformancePlus.json + */ + /** + * Sample code: Create a managed disk with performancePlus. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAManagedDiskWithPerformancePlus( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .disks() + .define("myDisk") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withCreationData(new CreationData().withCreateOption(DiskCreateOption.UPLOAD).withPerformancePlus(true)) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_Create_WithPremiumV2_LRSAccountType.json + */ + /** + * Sample code: Create a managed disk with premium v2 account type. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAManagedDiskWithPremiumV2AccountType( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .disks() + .define("myPremiumV2Disk") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withSku(new DiskSku().withName(DiskStorageAccountTypes.PREMIUM_V2_LRS)) + .withCreationData(new CreationData().withCreateOption(DiskCreateOption.EMPTY)) + .withDiskSizeGB(200) + .withDiskIopsReadWrite(125L) + .withDiskMBpsReadWrite(3000L) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_Create_WithSecurityProfile.json + */ + /** + * Sample code: Create a managed disk with security profile. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAManagedDiskWithSecurityProfile( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .disks() + .define("myDisk") + .withRegion("North Central US") + .withExistingResourceGroup("myResourceGroup") + .withOsType(OperatingSystemTypes.WINDOWS) + .withCreationData( + new CreationData() + .withCreateOption(DiskCreateOption.FROM_IMAGE) + .withImageReference( + new ImageDiskReference() + .withId( + "/Subscriptions/{subscriptionId}/Providers/Microsoft.Compute/Locations/uswest/Publishers/Microsoft/ArtifactTypes/VMImage/Offers/{offer}"))) + .withSecurityProfile(new DiskSecurityProfile().withSecurityType(DiskSecurityTypes.TRUSTED_LAUNCH)) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_Create_WithLogicalSectorSize.json + */ + /** + * Sample code: Create an ultra managed disk with logicalSectorSize 512E. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAnUltraManagedDiskWithLogicalSectorSize512E( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .disks() + .define("myDisk") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withSku(new DiskSku().withName(DiskStorageAccountTypes.ULTRA_SSD_LRS)) + .withCreationData(new CreationData().withCreateOption(DiskCreateOption.EMPTY).withLogicalSectorSize(512)) + .withDiskSizeGB(200) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_Create_FromAPlatformImage.json + */ + /** + * Sample code: Create a managed disk from a platform image. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAManagedDiskFromAPlatformImage( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .disks() + .define("myDisk") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withOsType(OperatingSystemTypes.WINDOWS) + .withCreationData( + new CreationData() + .withCreateOption(DiskCreateOption.FROM_IMAGE) + .withImageReference( + new ImageDiskReference() + .withId( + "/Subscriptions/{subscriptionId}/Providers/Microsoft.Compute/Locations/westus/Publishers/{publisher}/ArtifactTypes/VMImage/Offers/{offer}/Skus/{sku}/Versions/1.0.0"))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_Create_FromAnAzureComputeGalleryDirectSharedImage.json + */ + /** + * Sample code: Create a managed disk from an Azure Compute Gallery direct shared image. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAManagedDiskFromAnAzureComputeGalleryDirectSharedImage( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .disks() + .define("myDisk") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withOsType(OperatingSystemTypes.WINDOWS) + .withCreationData( + new CreationData() + .withCreateOption(DiskCreateOption.FROM_IMAGE) + .withGalleryImageReference( + new ImageDiskReference() + .withSharedGalleryImageId( + "/SharedGalleries/{sharedGalleryUniqueName}/Images/{imageName}/Versions/1.0.0"))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_Create_Empty.json + */ + /** + * Sample code: Create an empty managed disk. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAnEmptyManagedDisk(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .disks() + .define("myDisk") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withCreationData(new CreationData().withCreateOption(DiskCreateOption.EMPTY)) + .withDiskSizeGB(200) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_Create_ByImportingBlobFromTheSameSubscription.json + */ + /** + * Sample code: Create a managed disk by importing an unmanaged blob from the same subscription. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAManagedDiskByImportingAnUnmanagedBlobFromTheSameSubscription( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .disks() + .define("myDisk") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withCreationData( + new CreationData() + .withCreateOption(DiskCreateOption.IMPORT) + .withSourceUri("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd")) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_Create_FromUploadPreparedSecure.json + */ + /** + * Sample code: Create a managed disk from UploadPreparedSecure create option. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAManagedDiskFromUploadPreparedSecureCreateOption( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .disks() + .define("myDisk") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withOsType(OperatingSystemTypes.WINDOWS) + .withCreationData( + new CreationData() + .withCreateOption(DiskCreateOption.UPLOAD_PREPARED_SECURE) + .withUploadSizeBytes(10737418752L)) + .withSecurityProfile(new DiskSecurityProfile().withSecurityType(DiskSecurityTypes.TRUSTED_LAUNCH)) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_Create_WithOptimizedForFrequentAttach.json + */ + /** + * Sample code: Create a managed disk with optimizedForFrequentAttach. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAManagedDiskWithOptimizedForFrequentAttach( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .disks() + .define("myDisk") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withCreationData(new CreationData().withCreateOption(DiskCreateOption.EMPTY)) + .withDiskSizeGB(200) + .withOptimizedForFrequentAttach(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_Create_ByCopyingASnapshot.json + */ + /** + * Sample code: Create a managed disk by copying a snapshot. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAManagedDiskByCopyingASnapshot( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .disks() + .define("myDisk") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withCreationData( + new CreationData() + .withCreateOption(DiskCreateOption.COPY) + .withSourceResourceId( + "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot")) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_Create_WithUltraSSD_ReadOnly.json + */ + /** + * Sample code: Create a managed disk with ultra account type with readOnly property set. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAManagedDiskWithUltraAccountTypeWithReadOnlyPropertySet( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .disks() + .define("myUltraReadOnlyDisk") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withSku(new DiskSku().withName(DiskStorageAccountTypes.ULTRA_SSD_LRS)) + .withCreationData(new CreationData().withCreateOption(DiskCreateOption.EMPTY).withLogicalSectorSize(4096)) + .withDiskSizeGB(200) + .withDiskIopsReadWrite(125L) + .withDiskMBpsReadWrite(3000L) + .withEncryption(new Encryption().withType(EncryptionType.ENCRYPTION_AT_REST_WITH_PLATFORM_KEY)) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_Create_ConfidentialVMSupportedDiskEncryptedWithCMK.json + */ + /** + * Sample code: Create a confidential VM supported disk encrypted with customer managed key. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAConfidentialVMSupportedDiskEncryptedWithCustomerManagedKey( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .disks() + .define("myDisk") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withOsType(OperatingSystemTypes.WINDOWS) + .withCreationData( + new CreationData() + .withCreateOption(DiskCreateOption.FROM_IMAGE) + .withImageReference( + new ImageDiskReference() + .withId( + "/Subscriptions/{subscriptionId}/Providers/Microsoft.Compute/Locations/westus/Publishers/{publisher}/ArtifactTypes/VMImage/Offers/{offer}/Skus/{sku}/Versions/1.0.0"))) + .withSecurityProfile( + new DiskSecurityProfile() + .withSecurityType(DiskSecurityTypes.CONFIDENTIAL_VM_DISK_ENCRYPTED_WITH_CUSTOMER_KEY) + .withSecureVMDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}")) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_Create_WithSSDZRSAccountType.json + */ + /** + * Sample code: Create a managed disk with ssd zrs account type. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAManagedDiskWithSsdZrsAccountType( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .disks() + .define("myDisk") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withSku(new DiskSku().withName(DiskStorageAccountTypes.PREMIUM_ZRS)) + .withCreationData(new CreationData().withCreateOption(DiskCreateOption.EMPTY)) + .withDiskSizeGB(200) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_Create_InExtendedLocation.json + */ + /** + * Sample code: Create an empty managed disk in extended location. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAnEmptyManagedDiskInExtendedLocation( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .disks() + .define("myDisk") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withExtendedLocation( + new ExtendedLocation().withName("{edge-zone-id}").withType(ExtendedLocationTypes.EDGE_ZONE)) + .withCreationData(new CreationData().withCreateOption(DiskCreateOption.EMPTY)) + .withDiskSizeGB(200) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_Create_FromAnAzureComputeGalleryCommunityImage.json + */ + /** + * Sample code: Create a managed disk from an Azure Compute Gallery community image. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAManagedDiskFromAnAzureComputeGalleryCommunityImage( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .disks() + .define("myDisk") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withOsType(OperatingSystemTypes.WINDOWS) + .withCreationData( + new CreationData() + .withCreateOption(DiskCreateOption.FROM_IMAGE) + .withGalleryImageReference( + new ImageDiskReference() + .withCommunityGalleryImageId( + "/CommunityGalleries/{communityGalleryPublicGalleryName}/Images/{imageName}/Versions/1.0.0"))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_Create_UploadDisk.json + */ + /** + * Sample code: Create a managed upload disk. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAManagedUploadDisk(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .disks() + .define("myDisk") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withCreationData( + new CreationData().withCreateOption(DiskCreateOption.UPLOAD).withUploadSizeBytes(10737418752L)) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_Create_FromAnAzureComputeGalleryImage.json + */ + /** + * Sample code: Create a managed disk from an Azure Compute Gallery image. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAManagedDiskFromAnAzureComputeGalleryImage( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .disks() + .define("myDisk") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withOsType(OperatingSystemTypes.WINDOWS) + .withCreationData( + new CreationData() + .withCreateOption(DiskCreateOption.FROM_IMAGE) + .withGalleryImageReference( + new ImageDiskReference() + .withId( + "/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/Providers/Microsoft.Compute/Galleries/{galleryName}/Images/{imageName}/Versions/1.0.0"))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_Create_WithDataAccessAuthMode.json + */ + /** + * Sample code: Create a managed disk with dataAccessAuthMode. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAManagedDiskWithDataAccessAuthMode( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .disks() + .define("myDisk") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withCreationData(new CreationData().withCreateOption(DiskCreateOption.EMPTY)) + .withDiskSizeGB(200) + .withDataAccessAuthMode(DataAccessAuthMode.AZURE_ACTIVE_DIRECTORY) + .create(); + } +} +``` + +### Disks_Delete + +```java +/** Samples for Disks Delete. */ +public final class DisksDeleteSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_Delete.json + */ + /** + * Sample code: Delete a managed disk. + * + * @param manager Entry point to ComputeManager. + */ + public static void deleteAManagedDisk(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.disks().delete("myResourceGroup", "myDisk", com.azure.core.util.Context.NONE); + } +} +``` + +### Disks_GetByResourceGroup + +```java +/** Samples for Disks GetByResourceGroup. */ +public final class DisksGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_Get.json + */ + /** + * Sample code: Get information about a managed disk. + * + * @param manager Entry point to ComputeManager. + */ + public static void getInformationAboutAManagedDisk( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .disks() + .getByResourceGroupWithResponse("myResourceGroup", "myManagedDisk", com.azure.core.util.Context.NONE); + } +} +``` + +### Disks_GrantAccess + +```java +import com.azure.resourcemanager.compute.generated.models.AccessLevel; +import com.azure.resourcemanager.compute.generated.models.GrantAccessData; + +/** Samples for Disks GrantAccess. */ +public final class DisksGrantAccessSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_BeginGetAccess.json + */ + /** + * Sample code: Get a sas on a managed disk. + * + * @param manager Entry point to ComputeManager. + */ + public static void getASasOnAManagedDisk(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .disks() + .grantAccess( + "myResourceGroup", + "myDisk", + new GrantAccessData().withAccess(AccessLevel.READ).withDurationInSeconds(300), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_BeginGetAccess_WithVMGuestState.json + */ + /** + * Sample code: Get sas on managed disk and VM guest state. + * + * @param manager Entry point to ComputeManager. + */ + public static void getSasOnManagedDiskAndVMGuestState( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .disks() + .grantAccess( + "myResourceGroup", + "myDisk", + new GrantAccessData() + .withAccess(AccessLevel.READ) + .withDurationInSeconds(300) + .withGetSecureVMGuestStateSas(true), + com.azure.core.util.Context.NONE); + } +} +``` + +### Disks_List + +```java +/** Samples for Disks List. */ +public final class DisksListSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_ListBySubscription.json + */ + /** + * Sample code: List all managed disks in a subscription. + * + * @param manager Entry point to ComputeManager. + */ + public static void listAllManagedDisksInASubscription( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.disks().list(com.azure.core.util.Context.NONE); + } +} +``` + +### Disks_ListByResourceGroup + +```java +/** Samples for Disks ListByResourceGroup. */ +public final class DisksListByResourceGroupSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_ListByResourceGroup.json + */ + /** + * Sample code: List all managed disks in a resource group. + * + * @param manager Entry point to ComputeManager. + */ + public static void listAllManagedDisksInAResourceGroup( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.disks().listByResourceGroup("myResourceGroup", com.azure.core.util.Context.NONE); + } +} +``` + +### Disks_RevokeAccess + +```java +/** Samples for Disks RevokeAccess. */ +public final class DisksRevokeAccessSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_EndGetAccess.json + */ + /** + * Sample code: Revoke access to a managed disk. + * + * @param manager Entry point to ComputeManager. + */ + public static void revokeAccessToAManagedDisk(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.disks().revokeAccess("myResourceGroup", "myDisk", com.azure.core.util.Context.NONE); + } +} +``` + +### Disks_Update + +```java +import com.azure.resourcemanager.compute.generated.models.Architecture; +import com.azure.resourcemanager.compute.generated.models.Disk; +import com.azure.resourcemanager.compute.generated.models.NetworkAccessPolicy; +import com.azure.resourcemanager.compute.generated.models.PurchasePlanAutoGenerated; +import com.azure.resourcemanager.compute.generated.models.SupportedCapabilities; + +/** Samples for Disks Update. */ +public final class DisksUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_Update_ToAddArchitecture.json + */ + /** + * Sample code: Update a managed disk to add architecture. + * + * @param manager Entry point to ComputeManager. + */ + public static void updateAManagedDiskToAddArchitecture( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + Disk resource = + manager + .disks() + .getByResourceGroupWithResponse("myResourceGroup", "myDisk", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withSupportedCapabilities(new SupportedCapabilities().withArchitecture(Architecture.ARM64)) + .apply(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_Update_DisableBursting.json + */ + /** + * Sample code: Update a managed disk to disable bursting. + * + * @param manager Entry point to ComputeManager. + */ + public static void updateAManagedDiskToDisableBursting( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + Disk resource = + manager + .disks() + .getByResourceGroupWithResponse("myResourceGroup", "myDisk", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withBurstingEnabled(false).apply(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_Update_AddPurchasePlan.json + */ + /** + * Sample code: Update a managed disk to add purchase plan. + * + * @param manager Entry point to ComputeManager. + */ + public static void updateAManagedDiskToAddPurchasePlan( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + Disk resource = + manager + .disks() + .getByResourceGroupWithResponse("myResourceGroup", "myDisk", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withPurchasePlan( + new PurchasePlanAutoGenerated() + .withName("myPurchasePlanName") + .withPublisher("myPurchasePlanPublisher") + .withProduct("myPurchasePlanProduct") + .withPromotionCode("fakeTokenPlaceholder")) + .apply(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_Update_ChangeTier.json + */ + /** + * Sample code: Update a managed disk to change tier. + * + * @param manager Entry point to ComputeManager. + */ + public static void updateAManagedDiskToChangeTier( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + Disk resource = + manager + .disks() + .getByResourceGroupWithResponse("myResourceGroup", "myDisk", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTier("P30").apply(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_CreateOrUpdate_BurstingEnabled.json + */ + /** + * Sample code: Create or update a bursting enabled managed disk. + * + * @param manager Entry point to ComputeManager. + */ + public static void createOrUpdateABurstingEnabledManagedDisk( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + Disk resource = + manager + .disks() + .getByResourceGroupWithResponse("myResourceGroup", "myDisk", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withDiskSizeGB(1024).withBurstingEnabled(true).apply(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_Update_AddSupportsHibernation.json + */ + /** + * Sample code: Update a managed disk to add supportsHibernation. + * + * @param manager Entry point to ComputeManager. + */ + public static void updateAManagedDiskToAddSupportsHibernation( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + Disk resource = + manager + .disks() + .getByResourceGroupWithResponse("myResourceGroup", "myDisk", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withSupportsHibernation(true).apply(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_Update_RemoveDiskAccess.json + */ + /** + * Sample code: Update managed disk to remove disk access resource association. + * + * @param manager Entry point to ComputeManager. + */ + public static void updateManagedDiskToRemoveDiskAccessResourceAssociation( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + Disk resource = + manager + .disks() + .getByResourceGroupWithResponse("myResourceGroup", "myDisk", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withNetworkAccessPolicy(NetworkAccessPolicy.ALLOW_ALL).apply(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_Update_AddDiskControllerTypes.json + */ + /** + * Sample code: Update a managed disk with diskControllerTypes. + * + * @param manager Entry point to ComputeManager. + */ + public static void updateAManagedDiskWithDiskControllerTypes( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + Disk resource = + manager + .disks() + .getByResourceGroupWithResponse("myResourceGroup", "myDisk", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withSupportedCapabilities(new SupportedCapabilities().withDiskControllerTypes("SCSI")) + .apply(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_Update_AddAcceleratedNetworking.json + */ + /** + * Sample code: Update a managed disk to add accelerated networking. + * + * @param manager Entry point to ComputeManager. + */ + public static void updateAManagedDiskToAddAcceleratedNetworking( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + Disk resource = + manager + .disks() + .getByResourceGroupWithResponse("myResourceGroup", "myDisk", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withSupportedCapabilities(new SupportedCapabilities().withAcceleratedNetwork(false)).apply(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_Update_DisableOptimizedForFrequentAttach.json + */ + /** + * Sample code: Update a managed disk to disable optimizedForFrequentAttach. + * + * @param manager Entry point to ComputeManager. + */ + public static void updateAManagedDiskToDisableOptimizedForFrequentAttach( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + Disk resource = + manager + .disks() + .getByResourceGroupWithResponse("myResourceGroup", "myDisk", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withOptimizedForFrequentAttach(false).apply(); + } +} +``` + +### Galleries_CreateOrUpdate + +```java +import com.azure.resourcemanager.compute.generated.models.CommunityGalleryInfo; +import com.azure.resourcemanager.compute.generated.models.GallerySharingPermissionTypes; +import com.azure.resourcemanager.compute.generated.models.SharingProfile; +import com.azure.resourcemanager.compute.generated.models.SoftDeletePolicy; + +/** Samples for Galleries CreateOrUpdate. */ +public final class GalleriesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/CommunityGallery_Create.json + */ + /** + * Sample code: Create a community gallery. + * + * @param manager Entry point to ComputeManager. + */ + public static void createACommunityGallery(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .galleries() + .define("myGalleryName") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withDescription("This is the gallery description.") + .withSharingProfile( + new SharingProfile() + .withPermissions(GallerySharingPermissionTypes.COMMUNITY) + .withCommunityGalleryInfo( + new CommunityGalleryInfo() + .withPublisherUri("uri") + .withPublisherContact("pir@microsoft.com") + .withEula("eula") + .withPublicNamePrefix("PirPublic"))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/Gallery_Create_WithSharingProfile.json + */ + /** + * Sample code: Create or update a simple gallery with sharing profile. + * + * @param manager Entry point to ComputeManager. + */ + public static void createOrUpdateASimpleGalleryWithSharingProfile( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .galleries() + .define("myGalleryName") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withDescription("This is the gallery description.") + .withSharingProfile(new SharingProfile().withPermissions(GallerySharingPermissionTypes.GROUPS)) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/Gallery_Create.json + */ + /** + * Sample code: Create or update a simple gallery. + * + * @param manager Entry point to ComputeManager. + */ + public static void createOrUpdateASimpleGallery( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .galleries() + .define("myGalleryName") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withDescription("This is the gallery description.") + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/Gallery_Create_SoftDeletionEnabled.json + */ + /** + * Sample code: Create or update a simple gallery with soft deletion enabled. + * + * @param manager Entry point to ComputeManager. + */ + public static void createOrUpdateASimpleGalleryWithSoftDeletionEnabled( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .galleries() + .define("myGalleryName") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withDescription("This is the gallery description.") + .withSoftDeletePolicy(new SoftDeletePolicy().withIsSoftDeleteEnabled(true)) + .create(); + } +} +``` + +### Galleries_Delete + +```java +/** Samples for Galleries Delete. */ +public final class GalleriesDeleteSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/Gallery_Delete.json + */ + /** + * Sample code: Delete a gallery. + * + * @param manager Entry point to ComputeManager. + */ + public static void deleteAGallery(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.galleries().delete("myResourceGroup", "myGalleryName", com.azure.core.util.Context.NONE); + } +} +``` + +### Galleries_GetByResourceGroup + +```java +import com.azure.resourcemanager.compute.generated.models.GalleryExpandParams; +import com.azure.resourcemanager.compute.generated.models.SelectPermissions; + +/** Samples for Galleries GetByResourceGroup. */ +public final class GalleriesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/CommunityGallery_Get.json + */ + /** + * Sample code: Get a community gallery. + * + * @param manager Entry point to ComputeManager. + */ + public static void getACommunityGallery(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .galleries() + .getByResourceGroupWithResponse( + "myResourceGroup", "myGalleryName", null, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/Gallery_Get_WithSelectPermissions.json + */ + /** + * Sample code: Get a gallery with select permissions. + * + * @param manager Entry point to ComputeManager. + */ + public static void getAGalleryWithSelectPermissions( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .galleries() + .getByResourceGroupWithResponse( + "myResourceGroup", + "myGalleryName", + SelectPermissions.PERMISSIONS, + null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/Gallery_Get.json + */ + /** + * Sample code: Get a gallery. + * + * @param manager Entry point to ComputeManager. + */ + public static void getAGallery(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .galleries() + .getByResourceGroupWithResponse( + "myResourceGroup", "myGalleryName", null, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/Gallery_Get_WithExpandSharingProfileGroups.json + */ + /** + * Sample code: Get a gallery with expand sharingProfile groups. + * + * @param manager Entry point to ComputeManager. + */ + public static void getAGalleryWithExpandSharingProfileGroups( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .galleries() + .getByResourceGroupWithResponse( + "myResourceGroup", + "myGalleryName", + null, + GalleryExpandParams.SHARING_PROFILE_GROUPS, + com.azure.core.util.Context.NONE); + } +} +``` + +### Galleries_List + +```java +/** Samples for Galleries List. */ +public final class GalleriesListSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/Gallery_ListBySubscription.json + */ + /** + * Sample code: List galleries in a subscription. + * + * @param manager Entry point to ComputeManager. + */ + public static void listGalleriesInASubscription( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.galleries().list(com.azure.core.util.Context.NONE); + } +} +``` + +### Galleries_ListByResourceGroup + +```java +/** Samples for Galleries ListByResourceGroup. */ +public final class GalleriesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/Gallery_ListByResourceGroup.json + */ + /** + * Sample code: List galleries in a resource group. + * + * @param manager Entry point to ComputeManager. + */ + public static void listGalleriesInAResourceGroup( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.galleries().listByResourceGroup("myResourceGroup", com.azure.core.util.Context.NONE); + } +} +``` + +### Galleries_Update + +```java +import com.azure.resourcemanager.compute.generated.models.Gallery; + +/** Samples for Galleries Update. */ +public final class GalleriesUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/Gallery_Update.json + */ + /** + * Sample code: Update a simple gallery. + * + * @param manager Entry point to ComputeManager. + */ + public static void updateASimpleGallery(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + Gallery resource = + manager + .galleries() + .getByResourceGroupWithResponse( + "myResourceGroup", "myGalleryName", null, null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withDescription("This is the gallery description.").apply(); + } +} +``` + +### GalleryApplicationVersions_CreateOrUpdate + +```java +import com.azure.resourcemanager.compute.generated.models.GalleryApplicationCustomAction; +import com.azure.resourcemanager.compute.generated.models.GalleryApplicationCustomActionParameter; +import com.azure.resourcemanager.compute.generated.models.GalleryApplicationCustomActionParameterType; +import com.azure.resourcemanager.compute.generated.models.GalleryApplicationVersionPublishingProfile; +import com.azure.resourcemanager.compute.generated.models.GalleryApplicationVersionSafetyProfile; +import com.azure.resourcemanager.compute.generated.models.StorageAccountType; +import com.azure.resourcemanager.compute.generated.models.TargetRegion; +import com.azure.resourcemanager.compute.generated.models.UserArtifactManage; +import com.azure.resourcemanager.compute.generated.models.UserArtifactSource; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** Samples for GalleryApplicationVersions CreateOrUpdate. */ +public final class GalleryApplicationVersionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/GalleryApplicationVersion_Create.json + */ + /** + * Sample code: Create or update a simple gallery Application Version. + * + * @param manager Entry point to ComputeManager. + */ + public static void createOrUpdateASimpleGalleryApplicationVersion( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .galleryApplicationVersions() + .define("1.0.0") + .withRegion("West US") + .withExistingApplication("myResourceGroup", "myGalleryName", "myGalleryApplicationName") + .withPublishingProfile( + new GalleryApplicationVersionPublishingProfile() + .withTargetRegions( + Arrays + .asList( + new TargetRegion() + .withName("West US") + .withRegionalReplicaCount(1) + .withStorageAccountType(StorageAccountType.STANDARD_LRS) + .withExcludeFromLatest(false))) + .withReplicaCount(1) + .withEndOfLifeDate(OffsetDateTime.parse("2019-07-01T07:00:00Z")) + .withStorageAccountType(StorageAccountType.STANDARD_LRS) + .withSource( + new UserArtifactSource() + .withMediaLink( + "https://mystorageaccount.blob.core.windows.net/mycontainer/package.zip?{sasKey}")) + .withManageActions( + new UserArtifactManage() + .withInstall( + "powershell -command \"Expand-Archive -Path package.zip -DestinationPath C:\\package\"") + .withRemove("del C:\\package ")) + .withCustomActions( + Arrays + .asList( + new GalleryApplicationCustomAction() + .withName("myCustomAction") + .withScript("myCustomActionScript") + .withDescription("This is the custom action description.") + .withParameters( + Arrays + .asList( + new GalleryApplicationCustomActionParameter() + .withName("myCustomActionParameter") + .withRequired(false) + .withType(GalleryApplicationCustomActionParameterType.STRING) + .withDefaultValue("default value of parameter.") + .withDescription("This is the description of the parameter")))))) + .withSafetyProfile( + new GalleryApplicationVersionSafetyProfile().withAllowDeletionOfReplicatedLocations(false)) + .create(); + } +} +``` + +### GalleryApplicationVersions_Delete + +```java +/** Samples for GalleryApplicationVersions Delete. */ +public final class GalleryApplicationVersionsDeleteSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/GalleryApplicationVersion_Delete.json + */ + /** + * Sample code: Delete a gallery Application Version. + * + * @param manager Entry point to ComputeManager. + */ + public static void deleteAGalleryApplicationVersion( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .galleryApplicationVersions() + .delete( + "myResourceGroup", + "myGalleryName", + "myGalleryApplicationName", + "1.0.0", + com.azure.core.util.Context.NONE); + } +} +``` + +### GalleryApplicationVersions_Get + +```java +import com.azure.resourcemanager.compute.generated.models.ReplicationStatusTypes; + +/** Samples for GalleryApplicationVersions Get. */ +public final class GalleryApplicationVersionsGetSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/GalleryApplicationVersion_Get.json + */ + /** + * Sample code: Get a gallery Application Version. + * + * @param manager Entry point to ComputeManager. + */ + public static void getAGalleryApplicationVersion( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .galleryApplicationVersions() + .getWithResponse( + "myResourceGroup", + "myGalleryName", + "myGalleryApplicationName", + "1.0.0", + null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/GalleryApplicationVersion_Get_WithReplicationStatus.json + */ + /** + * Sample code: Get a gallery Application Version with replication status. + * + * @param manager Entry point to ComputeManager. + */ + public static void getAGalleryApplicationVersionWithReplicationStatus( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .galleryApplicationVersions() + .getWithResponse( + "myResourceGroup", + "myGalleryName", + "myGalleryApplicationName", + "1.0.0", + ReplicationStatusTypes.REPLICATION_STATUS, + com.azure.core.util.Context.NONE); + } +} +``` + +### GalleryApplicationVersions_ListByGalleryApplication + +```java +/** Samples for GalleryApplicationVersions ListByGalleryApplication. */ +public final class GalleryApplicationVersionsListByGalleryApplicationSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/GalleryApplicationVersion_ListByGalleryApplication.json + */ + /** + * Sample code: List gallery Application Versions in a gallery Application Definition. + * + * @param manager Entry point to ComputeManager. + */ + public static void listGalleryApplicationVersionsInAGalleryApplicationDefinition( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .galleryApplicationVersions() + .listByGalleryApplication( + "myResourceGroup", "myGalleryName", "myGalleryApplicationName", com.azure.core.util.Context.NONE); + } +} +``` + +### GalleryApplicationVersions_Update + +```java +import com.azure.resourcemanager.compute.generated.models.GalleryApplicationVersion; +import com.azure.resourcemanager.compute.generated.models.GalleryApplicationVersionPublishingProfile; +import com.azure.resourcemanager.compute.generated.models.GalleryApplicationVersionSafetyProfile; +import com.azure.resourcemanager.compute.generated.models.StorageAccountType; +import com.azure.resourcemanager.compute.generated.models.TargetRegion; +import com.azure.resourcemanager.compute.generated.models.UserArtifactManage; +import com.azure.resourcemanager.compute.generated.models.UserArtifactSource; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** Samples for GalleryApplicationVersions Update. */ +public final class GalleryApplicationVersionsUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/GalleryApplicationVersion_Update.json + */ + /** + * Sample code: Update a simple gallery Application Version. + * + * @param manager Entry point to ComputeManager. + */ + public static void updateASimpleGalleryApplicationVersion( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + GalleryApplicationVersion resource = + manager + .galleryApplicationVersions() + .getWithResponse( + "myResourceGroup", + "myGalleryName", + "myGalleryApplicationName", + "1.0.0", + null, + com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withPublishingProfile( + new GalleryApplicationVersionPublishingProfile() + .withTargetRegions( + Arrays + .asList( + new TargetRegion() + .withName("West US") + .withRegionalReplicaCount(1) + .withStorageAccountType(StorageAccountType.STANDARD_LRS) + .withExcludeFromLatest(false))) + .withReplicaCount(1) + .withEndOfLifeDate(OffsetDateTime.parse("2019-07-01T07:00:00Z")) + .withStorageAccountType(StorageAccountType.STANDARD_LRS) + .withSource( + new UserArtifactSource() + .withMediaLink( + "https://mystorageaccount.blob.core.windows.net/mycontainer/package.zip?{sasKey}")) + .withManageActions( + new UserArtifactManage() + .withInstall( + "powershell -command \"Expand-Archive -Path package.zip -DestinationPath C:\\package\"") + .withRemove("del C:\\package "))) + .withSafetyProfile( + new GalleryApplicationVersionSafetyProfile().withAllowDeletionOfReplicatedLocations(false)) + .apply(); + } +} +``` + +### GalleryApplications_CreateOrUpdate + +```java +import com.azure.resourcemanager.compute.generated.models.GalleryApplicationCustomAction; +import com.azure.resourcemanager.compute.generated.models.GalleryApplicationCustomActionParameter; +import com.azure.resourcemanager.compute.generated.models.GalleryApplicationCustomActionParameterType; +import com.azure.resourcemanager.compute.generated.models.OperatingSystemTypes; +import java.util.Arrays; + +/** Samples for GalleryApplications CreateOrUpdate. */ +public final class GalleryApplicationsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/GalleryApplication_Create.json + */ + /** + * Sample code: Create or update a simple gallery Application. + * + * @param manager Entry point to ComputeManager. + */ + public static void createOrUpdateASimpleGalleryApplication( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .galleryApplications() + .define("myGalleryApplicationName") + .withRegion("West US") + .withExistingGallery("myResourceGroup", "myGalleryName") + .withDescription("This is the gallery application description.") + .withEula("This is the gallery application EULA.") + .withPrivacyStatementUri("myPrivacyStatementUri}") + .withReleaseNoteUri("myReleaseNoteUri") + .withSupportedOSType(OperatingSystemTypes.WINDOWS) + .withCustomActions( + Arrays + .asList( + new GalleryApplicationCustomAction() + .withName("myCustomAction") + .withScript("myCustomActionScript") + .withDescription("This is the custom action description.") + .withParameters( + Arrays + .asList( + new GalleryApplicationCustomActionParameter() + .withName("myCustomActionParameter") + .withRequired(false) + .withType(GalleryApplicationCustomActionParameterType.STRING) + .withDefaultValue("default value of parameter.") + .withDescription("This is the description of the parameter"))))) + .create(); + } +} +``` + +### GalleryApplications_Delete + +```java +/** Samples for GalleryApplications Delete. */ +public final class GalleryApplicationsDeleteSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/GalleryApplication_Delete.json + */ + /** + * Sample code: Delete a gallery Application. + * + * @param manager Entry point to ComputeManager. + */ + public static void deleteAGalleryApplication(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .galleryApplications() + .delete("myResourceGroup", "myGalleryName", "myGalleryApplicationName", com.azure.core.util.Context.NONE); + } +} +``` + +### GalleryApplications_Get + +```java +/** Samples for GalleryApplications Get. */ +public final class GalleryApplicationsGetSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/GalleryApplication_Get.json + */ + /** + * Sample code: Get a gallery Application. + * + * @param manager Entry point to ComputeManager. + */ + public static void getAGalleryApplication(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .galleryApplications() + .getWithResponse( + "myResourceGroup", "myGalleryName", "myGalleryApplicationName", com.azure.core.util.Context.NONE); + } +} +``` + +### GalleryApplications_ListByGallery + +```java +/** Samples for GalleryApplications ListByGallery. */ +public final class GalleryApplicationsListByGallerySamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/GalleryApplication_ListByGallery.json + */ + /** + * Sample code: List gallery Applications in a gallery. + * + * @param manager Entry point to ComputeManager. + */ + public static void listGalleryApplicationsInAGallery( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .galleryApplications() + .listByGallery("myResourceGroup", "myGalleryName", com.azure.core.util.Context.NONE); + } +} +``` + +### GalleryApplications_Update + +```java +import com.azure.resourcemanager.compute.generated.models.GalleryApplication; +import com.azure.resourcemanager.compute.generated.models.GalleryApplicationCustomAction; +import com.azure.resourcemanager.compute.generated.models.GalleryApplicationCustomActionParameter; +import com.azure.resourcemanager.compute.generated.models.GalleryApplicationCustomActionParameterType; +import com.azure.resourcemanager.compute.generated.models.OperatingSystemTypes; +import java.util.Arrays; + +/** Samples for GalleryApplications Update. */ +public final class GalleryApplicationsUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/GalleryApplication_Update.json + */ + /** + * Sample code: Update a simple gallery Application. + * + * @param manager Entry point to ComputeManager. + */ + public static void updateASimpleGalleryApplication( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + GalleryApplication resource = + manager + .galleryApplications() + .getWithResponse( + "myResourceGroup", "myGalleryName", "myGalleryApplicationName", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withDescription("This is the gallery application description.") + .withEula("This is the gallery application EULA.") + .withPrivacyStatementUri("myPrivacyStatementUri}") + .withReleaseNoteUri("myReleaseNoteUri") + .withSupportedOSType(OperatingSystemTypes.WINDOWS) + .withCustomActions( + Arrays + .asList( + new GalleryApplicationCustomAction() + .withName("myCustomAction") + .withScript("myCustomActionScript") + .withDescription("This is the custom action description.") + .withParameters( + Arrays + .asList( + new GalleryApplicationCustomActionParameter() + .withName("myCustomActionParameter") + .withRequired(false) + .withType(GalleryApplicationCustomActionParameterType.STRING) + .withDefaultValue("default value of parameter.") + .withDescription("This is the description of the parameter"))))) + .apply(); + } +} +``` + +### GalleryImageVersions_CreateOrUpdate + +```java +import com.azure.resourcemanager.compute.generated.models.DataDiskImageEncryption; +import com.azure.resourcemanager.compute.generated.models.EncryptionImages; +import com.azure.resourcemanager.compute.generated.models.GalleryArtifactVersionFullSource; +import com.azure.resourcemanager.compute.generated.models.GalleryDataDiskImage; +import com.azure.resourcemanager.compute.generated.models.GalleryDiskImageSource; +import com.azure.resourcemanager.compute.generated.models.GalleryImageVersionPublishingProfile; +import com.azure.resourcemanager.compute.generated.models.GalleryImageVersionSafetyProfile; +import com.azure.resourcemanager.compute.generated.models.GalleryImageVersionStorageProfile; +import com.azure.resourcemanager.compute.generated.models.GalleryOSDiskImage; +import com.azure.resourcemanager.compute.generated.models.HostCaching; +import com.azure.resourcemanager.compute.generated.models.OSDiskImageEncryption; +import com.azure.resourcemanager.compute.generated.models.ReplicationMode; +import com.azure.resourcemanager.compute.generated.models.StorageAccountType; +import com.azure.resourcemanager.compute.generated.models.TargetRegion; +import java.util.Arrays; + +/** Samples for GalleryImageVersions CreateOrUpdate. */ +public final class GalleryImageVersionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/GalleryImageVersion_Create_WithShallowReplicationMode.json + */ + /** + * Sample code: Create or update a simple Gallery Image Version using shallow replication mode. + * + * @param manager Entry point to ComputeManager. + */ + public static void createOrUpdateASimpleGalleryImageVersionUsingShallowReplicationMode( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .galleryImageVersions() + .define("1.0.0") + .withRegion("West US") + .withExistingImage("myResourceGroup", "myGalleryName", "myGalleryImageName") + .withPublishingProfile( + new GalleryImageVersionPublishingProfile() + .withTargetRegions( + Arrays + .asList( + new TargetRegion() + .withName("West US") + .withRegionalReplicaCount(1) + .withExcludeFromLatest(false))) + .withReplicationMode(ReplicationMode.SHALLOW)) + .withStorageProfile( + new GalleryImageVersionStorageProfile() + .withSource( + new GalleryArtifactVersionFullSource() + .withId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}"))) + .withSafetyProfile(new GalleryImageVersionSafetyProfile().withAllowDeletionOfReplicatedLocations(false)) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/GalleryImageVersion_Create_WithVHD.json + */ + /** + * Sample code: Create or update a simple Gallery Image Version using vhd as a source. + * + * @param manager Entry point to ComputeManager. + */ + public static void createOrUpdateASimpleGalleryImageVersionUsingVhdAsASource( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .galleryImageVersions() + .define("1.0.0") + .withRegion("West US") + .withExistingImage("myResourceGroup", "myGalleryName", "myGalleryImageName") + .withPublishingProfile( + new GalleryImageVersionPublishingProfile() + .withTargetRegions( + Arrays + .asList( + new TargetRegion() + .withName("West US") + .withRegionalReplicaCount(1) + .withEncryption( + new EncryptionImages() + .withOsDiskImage( + new OSDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myDiskEncryptionSet")) + .withDataDiskImages( + Arrays + .asList( + new DataDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherDiskEncryptionSet") + .withLun(1)))) + .withExcludeFromLatest(false), + new TargetRegion() + .withName("East US") + .withRegionalReplicaCount(2) + .withStorageAccountType(StorageAccountType.STANDARD_ZRS) + .withExcludeFromLatest(false)))) + .withStorageProfile( + new GalleryImageVersionStorageProfile() + .withOsDiskImage( + new GalleryOSDiskImage() + .withHostCaching(HostCaching.READ_ONLY) + .withSource( + new GalleryDiskImageSource() + .withId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/{storageAccount}") + .withUri( + "https://gallerysourcencus.blob.core.windows.net/myvhds/Windows-Server-2012-R2-20171216-en.us-128GB.vhd"))) + .withDataDiskImages( + Arrays + .asList( + new GalleryDataDiskImage() + .withHostCaching(HostCaching.NONE) + .withSource( + new GalleryDiskImageSource() + .withId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/{storageAccount}") + .withUri( + "https://gallerysourcencus.blob.core.windows.net/myvhds/Windows-Server-2012-R2-20171216-en.us-128GB.vhd")) + .withLun(1)))) + .withSafetyProfile(new GalleryImageVersionSafetyProfile().withAllowDeletionOfReplicatedLocations(false)) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/GalleryImageVersion_Create_WithVmAsSource.json + */ + /** + * Sample code: Create or update a simple Gallery Image Version using VM as source. + * + * @param manager Entry point to ComputeManager. + */ + public static void createOrUpdateASimpleGalleryImageVersionUsingVMAsSource( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .galleryImageVersions() + .define("1.0.0") + .withRegion("West US") + .withExistingImage("myResourceGroup", "myGalleryName", "myGalleryImageName") + .withPublishingProfile( + new GalleryImageVersionPublishingProfile() + .withTargetRegions( + Arrays + .asList( + new TargetRegion() + .withName("West US") + .withRegionalReplicaCount(2) + .withEncryption( + new EncryptionImages() + .withOsDiskImage( + new OSDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet")) + .withDataDiskImages( + Arrays + .asList( + new DataDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet") + .withLun(0), + new DataDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet") + .withLun(1)))) + .withExcludeFromLatest(false), + new TargetRegion() + .withName("East US") + .withRegionalReplicaCount(2) + .withStorageAccountType(StorageAccountType.STANDARD_ZRS) + .withEncryption( + new EncryptionImages() + .withOsDiskImage( + new OSDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet")) + .withDataDiskImages( + Arrays + .asList( + new DataDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet") + .withLun(0), + new DataDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet") + .withLun(1)))) + .withExcludeFromLatest(false)))) + .withStorageProfile( + new GalleryImageVersionStorageProfile() + .withSource( + new GalleryArtifactVersionFullSource() + .withId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/virtualMachines/{vmName}"))) + .withSafetyProfile(new GalleryImageVersionSafetyProfile().withAllowDeletionOfReplicatedLocations(false)) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/GalleryImageVersion_Create_WithImageVersionAsSource.json + */ + /** + * Sample code: Create or update a simple Gallery Image Version using shared image as source. + * + * @param manager Entry point to ComputeManager. + */ + public static void createOrUpdateASimpleGalleryImageVersionUsingSharedImageAsSource( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .galleryImageVersions() + .define("1.0.0") + .withRegion("West US") + .withExistingImage("myResourceGroup", "myGalleryName", "myGalleryImageName") + .withPublishingProfile( + new GalleryImageVersionPublishingProfile() + .withTargetRegions( + Arrays + .asList( + new TargetRegion() + .withName("West US") + .withRegionalReplicaCount(1) + .withEncryption( + new EncryptionImages() + .withOsDiskImage( + new OSDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet")) + .withDataDiskImages( + Arrays + .asList( + new DataDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet") + .withLun(0), + new DataDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet") + .withLun(1)))) + .withExcludeFromLatest(false), + new TargetRegion() + .withName("East US") + .withRegionalReplicaCount(2) + .withStorageAccountType(StorageAccountType.STANDARD_ZRS) + .withEncryption( + new EncryptionImages() + .withOsDiskImage( + new OSDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet")) + .withDataDiskImages( + Arrays + .asList( + new DataDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet") + .withLun(0), + new DataDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet") + .withLun(1)))) + .withExcludeFromLatest(false)))) + .withStorageProfile( + new GalleryImageVersionStorageProfile() + .withSource( + new GalleryArtifactVersionFullSource() + .withId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageDefinitionName}/versions/{versionName}"))) + .withSafetyProfile(new GalleryImageVersionSafetyProfile().withAllowDeletionOfReplicatedLocations(false)) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/GalleryImageVersion_Create_WithSnapshotsAsSource.json + */ + /** + * Sample code: Create or update a simple Gallery Image Version using mix of disks and snapshots as a source. + * + * @param manager Entry point to ComputeManager. + */ + public static void createOrUpdateASimpleGalleryImageVersionUsingMixOfDisksAndSnapshotsAsASource( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .galleryImageVersions() + .define("1.0.0") + .withRegion("West US") + .withExistingImage("myResourceGroup", "myGalleryName", "myGalleryImageName") + .withPublishingProfile( + new GalleryImageVersionPublishingProfile() + .withTargetRegions( + Arrays + .asList( + new TargetRegion() + .withName("West US") + .withRegionalReplicaCount(1) + .withEncryption( + new EncryptionImages() + .withOsDiskImage( + new OSDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet")) + .withDataDiskImages( + Arrays + .asList( + new DataDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet") + .withLun(1)))) + .withExcludeFromLatest(false), + new TargetRegion() + .withName("East US") + .withRegionalReplicaCount(2) + .withStorageAccountType(StorageAccountType.STANDARD_ZRS) + .withEncryption( + new EncryptionImages() + .withOsDiskImage( + new OSDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet")) + .withDataDiskImages( + Arrays + .asList( + new DataDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet") + .withLun(1)))) + .withExcludeFromLatest(false)))) + .withStorageProfile( + new GalleryImageVersionStorageProfile() + .withOsDiskImage( + new GalleryOSDiskImage() + .withHostCaching(HostCaching.READ_ONLY) + .withSource( + new GalleryDiskImageSource() + .withId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/snapshots/{osSnapshotName}"))) + .withDataDiskImages( + Arrays + .asList( + new GalleryDataDiskImage() + .withHostCaching(HostCaching.NONE) + .withSource( + new GalleryDiskImageSource() + .withId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/disks/{dataDiskName}")) + .withLun(1)))) + .withSafetyProfile(new GalleryImageVersionSafetyProfile().withAllowDeletionOfReplicatedLocations(false)) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/GalleryImageVersion_Create_WithSnapshotsAsSource.json + */ + /** + * Sample code: Create or update a simple Gallery Image Version using snapshots as a source. + * + * @param manager Entry point to ComputeManager. + */ + public static void createOrUpdateASimpleGalleryImageVersionUsingSnapshotsAsASource( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .galleryImageVersions() + .define("1.0.0") + .withRegion("West US") + .withExistingImage("myResourceGroup", "myGalleryName", "myGalleryImageName") + .withPublishingProfile( + new GalleryImageVersionPublishingProfile() + .withTargetRegions( + Arrays + .asList( + new TargetRegion() + .withName("West US") + .withRegionalReplicaCount(1) + .withEncryption( + new EncryptionImages() + .withOsDiskImage( + new OSDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet")) + .withDataDiskImages( + Arrays + .asList( + new DataDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet") + .withLun(1)))) + .withExcludeFromLatest(false), + new TargetRegion() + .withName("East US") + .withRegionalReplicaCount(2) + .withStorageAccountType(StorageAccountType.STANDARD_ZRS) + .withEncryption( + new EncryptionImages() + .withOsDiskImage( + new OSDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet")) + .withDataDiskImages( + Arrays + .asList( + new DataDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet") + .withLun(1)))) + .withExcludeFromLatest(false)))) + .withStorageProfile( + new GalleryImageVersionStorageProfile() + .withOsDiskImage( + new GalleryOSDiskImage() + .withHostCaching(HostCaching.READ_ONLY) + .withSource( + new GalleryDiskImageSource() + .withId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/snapshots/{osSnapshotName}"))) + .withDataDiskImages( + Arrays + .asList( + new GalleryDataDiskImage() + .withHostCaching(HostCaching.NONE) + .withSource( + new GalleryDiskImageSource() + .withId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/disks/{dataDiskName}")) + .withLun(1)))) + .withSafetyProfile(new GalleryImageVersionSafetyProfile().withAllowDeletionOfReplicatedLocations(false)) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/GalleryImageVersion_Create_WithTargetExtendedLocations.json + */ + /** + * Sample code: Create or update a simple gallery image version with target extended locations specified. + * + * @param manager Entry point to ComputeManager. + */ + public static void createOrUpdateASimpleGalleryImageVersionWithTargetExtendedLocationsSpecified( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .galleryImageVersions() + .define("1.0.0") + .withRegion("West US") + .withExistingImage("myResourceGroup", "myGalleryName", "myGalleryImageName") + .withPublishingProfile( + new GalleryImageVersionPublishingProfile() + .withTargetRegions( + Arrays + .asList( + new TargetRegion() + .withName("West US") + .withRegionalReplicaCount(1) + .withEncryption( + new EncryptionImages() + .withOsDiskImage( + new OSDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet")) + .withDataDiskImages( + Arrays + .asList( + new DataDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet") + .withLun(0), + new DataDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet") + .withLun(1)))) + .withExcludeFromLatest(false), + new TargetRegion() + .withName("East US") + .withRegionalReplicaCount(2) + .withStorageAccountType(StorageAccountType.STANDARD_ZRS) + .withEncryption( + new EncryptionImages() + .withOsDiskImage( + new OSDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet")) + .withDataDiskImages( + Arrays + .asList( + new DataDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet") + .withLun(0), + new DataDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet") + .withLun(1)))) + .withExcludeFromLatest(false)))) + .withStorageProfile( + new GalleryImageVersionStorageProfile() + .withSource( + new GalleryArtifactVersionFullSource() + .withId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}"))) + .withSafetyProfile(new GalleryImageVersionSafetyProfile().withAllowDeletionOfReplicatedLocations(false)) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/GalleryImageVersion_Create_WithCommunityImageVersionAsSource.json + */ + /** + * Sample code: Create or update a simple Gallery Image Version using community gallery image as source. + * + * @param manager Entry point to ComputeManager. + */ + public static void createOrUpdateASimpleGalleryImageVersionUsingCommunityGalleryImageAsSource( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .galleryImageVersions() + .define("1.0.0") + .withRegion("West US") + .withExistingImage("myResourceGroup", "myGalleryName", "myGalleryImageName") + .withPublishingProfile( + new GalleryImageVersionPublishingProfile() + .withTargetRegions( + Arrays + .asList( + new TargetRegion() + .withName("West US") + .withRegionalReplicaCount(1) + .withEncryption( + new EncryptionImages() + .withOsDiskImage( + new OSDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet")) + .withDataDiskImages( + Arrays + .asList( + new DataDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet") + .withLun(0), + new DataDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet") + .withLun(1)))) + .withExcludeFromLatest(false), + new TargetRegion() + .withName("East US") + .withRegionalReplicaCount(2) + .withStorageAccountType(StorageAccountType.STANDARD_ZRS) + .withEncryption( + new EncryptionImages() + .withOsDiskImage( + new OSDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet")) + .withDataDiskImages( + Arrays + .asList( + new DataDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet") + .withLun(0), + new DataDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet") + .withLun(1)))) + .withExcludeFromLatest(false)))) + .withStorageProfile( + new GalleryImageVersionStorageProfile() + .withSource( + new GalleryArtifactVersionFullSource() + .withCommunityGalleryImageId( + "/communityGalleries/{communityGalleryName}/images/{communityGalleryImageName}"))) + .withSafetyProfile(new GalleryImageVersionSafetyProfile().withAllowDeletionOfReplicatedLocations(false)) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/GalleryImageVersion_Create.json + */ + /** + * Sample code: Create or update a simple Gallery Image Version using managed image as source. + * + * @param manager Entry point to ComputeManager. + */ + public static void createOrUpdateASimpleGalleryImageVersionUsingManagedImageAsSource( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .galleryImageVersions() + .define("1.0.0") + .withRegion("West US") + .withExistingImage("myResourceGroup", "myGalleryName", "myGalleryImageName") + .withPublishingProfile( + new GalleryImageVersionPublishingProfile() + .withTargetRegions( + Arrays + .asList( + new TargetRegion() + .withName("West US") + .withRegionalReplicaCount(1) + .withEncryption( + new EncryptionImages() + .withOsDiskImage( + new OSDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet")) + .withDataDiskImages( + Arrays + .asList( + new DataDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet") + .withLun(0), + new DataDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet") + .withLun(1)))) + .withExcludeFromLatest(false), + new TargetRegion() + .withName("East US") + .withRegionalReplicaCount(2) + .withStorageAccountType(StorageAccountType.STANDARD_ZRS) + .withEncryption( + new EncryptionImages() + .withOsDiskImage( + new OSDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet")) + .withDataDiskImages( + Arrays + .asList( + new DataDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet") + .withLun(0), + new DataDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet") + .withLun(1)))) + .withExcludeFromLatest(false)))) + .withStorageProfile( + new GalleryImageVersionStorageProfile() + .withSource( + new GalleryArtifactVersionFullSource() + .withId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}"))) + .withSafetyProfile(new GalleryImageVersionSafetyProfile().withAllowDeletionOfReplicatedLocations(false)) + .create(); + } +} +``` + +### GalleryImageVersions_Delete + +```java +/** Samples for GalleryImageVersions Delete. */ +public final class GalleryImageVersionsDeleteSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/GalleryImageVersion_Delete.json + */ + /** + * Sample code: Delete a gallery image version. + * + * @param manager Entry point to ComputeManager. + */ + public static void deleteAGalleryImageVersion(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .galleryImageVersions() + .delete( + "myResourceGroup", "myGalleryName", "myGalleryImageName", "1.0.0", com.azure.core.util.Context.NONE); + } +} +``` + +### GalleryImageVersions_Get + +```java +import com.azure.resourcemanager.compute.generated.models.ReplicationStatusTypes; + +/** Samples for GalleryImageVersions Get. */ +public final class GalleryImageVersionsGetSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/GalleryImageVersion_Get_WithVhdAsSource.json + */ + /** + * Sample code: Get a gallery image version with vhd as a source. + * + * @param manager Entry point to ComputeManager. + */ + public static void getAGalleryImageVersionWithVhdAsASource( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .galleryImageVersions() + .getWithResponse( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/GalleryImageVersion_Get.json + */ + /** + * Sample code: Get a gallery image version. + * + * @param manager Entry point to ComputeManager. + */ + public static void getAGalleryImageVersion(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .galleryImageVersions() + .getWithResponse( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/GalleryImageVersion_Get_WithReplicationStatus.json + */ + /** + * Sample code: Get a gallery image version with replication status. + * + * @param manager Entry point to ComputeManager. + */ + public static void getAGalleryImageVersionWithReplicationStatus( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .galleryImageVersions() + .getWithResponse( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + ReplicationStatusTypes.REPLICATION_STATUS, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/GalleryImageVersion_Get_WithSnapshotsAsSource.json + */ + /** + * Sample code: Get a gallery image version with snapshots as a source. + * + * @param manager Entry point to ComputeManager. + */ + public static void getAGalleryImageVersionWithSnapshotsAsASource( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .galleryImageVersions() + .getWithResponse( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + null, + com.azure.core.util.Context.NONE); + } +} +``` + +### GalleryImageVersions_ListByGalleryImage + +```java +/** Samples for GalleryImageVersions ListByGalleryImage. */ +public final class GalleryImageVersionsListByGalleryImageSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/GalleryImageVersion_ListByGalleryImage.json + */ + /** + * Sample code: List gallery image versions in a gallery image definition. + * + * @param manager Entry point to ComputeManager. + */ + public static void listGalleryImageVersionsInAGalleryImageDefinition( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .galleryImageVersions() + .listByGalleryImage( + "myResourceGroup", "myGalleryName", "myGalleryImageName", com.azure.core.util.Context.NONE); + } +} +``` + +### GalleryImageVersions_Update + +```java +import com.azure.resourcemanager.compute.generated.models.GalleryArtifactVersionFullSource; +import com.azure.resourcemanager.compute.generated.models.GalleryImageVersion; +import com.azure.resourcemanager.compute.generated.models.GalleryImageVersionPublishingProfile; +import com.azure.resourcemanager.compute.generated.models.GalleryImageVersionStorageProfile; +import com.azure.resourcemanager.compute.generated.models.StorageAccountType; +import com.azure.resourcemanager.compute.generated.models.TargetRegion; +import java.util.Arrays; + +/** Samples for GalleryImageVersions Update. */ +public final class GalleryImageVersionsUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/GalleryImageVersion_Update.json + */ + /** + * Sample code: Update a simple Gallery Image Version (Managed Image as source). + * + * @param manager Entry point to ComputeManager. + */ + public static void updateASimpleGalleryImageVersionManagedImageAsSource( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + GalleryImageVersion resource = + manager + .galleryImageVersions() + .getWithResponse( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + null, + com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withPublishingProfile( + new GalleryImageVersionPublishingProfile() + .withTargetRegions( + Arrays + .asList( + new TargetRegion().withName("West US").withRegionalReplicaCount(1), + new TargetRegion() + .withName("East US") + .withRegionalReplicaCount(2) + .withStorageAccountType(StorageAccountType.STANDARD_ZRS)))) + .withStorageProfile( + new GalleryImageVersionStorageProfile() + .withSource( + new GalleryArtifactVersionFullSource() + .withId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}"))) + .apply(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/GalleryImageVersion_Update_WithoutSourceId.json + */ + /** + * Sample code: Update a simple Gallery Image Version without source id. + * + * @param manager Entry point to ComputeManager. + */ + public static void updateASimpleGalleryImageVersionWithoutSourceId( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + GalleryImageVersion resource = + manager + .galleryImageVersions() + .getWithResponse( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + null, + com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withPublishingProfile( + new GalleryImageVersionPublishingProfile() + .withTargetRegions( + Arrays + .asList( + new TargetRegion().withName("West US").withRegionalReplicaCount(1), + new TargetRegion() + .withName("East US") + .withRegionalReplicaCount(2) + .withStorageAccountType(StorageAccountType.STANDARD_ZRS)))) + .withStorageProfile(new GalleryImageVersionStorageProfile()) + .apply(); + } +} +``` + +### GalleryImages_CreateOrUpdate + +```java +import com.azure.resourcemanager.compute.generated.models.GalleryImageIdentifier; +import com.azure.resourcemanager.compute.generated.models.HyperVGeneration; +import com.azure.resourcemanager.compute.generated.models.OperatingSystemStateTypes; +import com.azure.resourcemanager.compute.generated.models.OperatingSystemTypes; + +/** Samples for GalleryImages CreateOrUpdate. */ +public final class GalleryImagesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/GalleryImage_Create.json + */ + /** + * Sample code: Create or update a simple gallery image. + * + * @param manager Entry point to ComputeManager. + */ + public static void createOrUpdateASimpleGalleryImage( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .galleryImages() + .define("myGalleryImageName") + .withRegion("West US") + .withExistingGallery("myResourceGroup", "myGalleryName") + .withOsType(OperatingSystemTypes.WINDOWS) + .withOsState(OperatingSystemStateTypes.GENERALIZED) + .withHyperVGeneration(HyperVGeneration.V1) + .withIdentifier( + new GalleryImageIdentifier() + .withPublisher("myPublisherName") + .withOffer("myOfferName") + .withSku("mySkuName")) + .create(); + } +} +``` + +### GalleryImages_Delete + +```java +/** Samples for GalleryImages Delete. */ +public final class GalleryImagesDeleteSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/GalleryImage_Delete.json + */ + /** + * Sample code: Delete a gallery image. + * + * @param manager Entry point to ComputeManager. + */ + public static void deleteAGalleryImage(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .galleryImages() + .delete("myResourceGroup", "myGalleryName", "myGalleryImageName", com.azure.core.util.Context.NONE); + } +} +``` + +### GalleryImages_Get + +```java +/** Samples for GalleryImages Get. */ +public final class GalleryImagesGetSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/GalleryImage_Get.json + */ + /** + * Sample code: Get a gallery image. + * + * @param manager Entry point to ComputeManager. + */ + public static void getAGalleryImage(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .galleryImages() + .getWithResponse( + "myResourceGroup", "myGalleryName", "myGalleryImageName", com.azure.core.util.Context.NONE); + } +} +``` + +### GalleryImages_ListByGallery + +```java +/** Samples for GalleryImages ListByGallery. */ +public final class GalleryImagesListByGallerySamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/GalleryImage_ListByGallery.json + */ + /** + * Sample code: List gallery images in a gallery. + * + * @param manager Entry point to ComputeManager. + */ + public static void listGalleryImagesInAGallery(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.galleryImages().listByGallery("myResourceGroup", "myGalleryName", com.azure.core.util.Context.NONE); + } +} +``` + +### GalleryImages_Update + +```java +import com.azure.resourcemanager.compute.generated.models.GalleryImage; +import com.azure.resourcemanager.compute.generated.models.GalleryImageIdentifier; +import com.azure.resourcemanager.compute.generated.models.HyperVGeneration; +import com.azure.resourcemanager.compute.generated.models.OperatingSystemStateTypes; +import com.azure.resourcemanager.compute.generated.models.OperatingSystemTypes; + +/** Samples for GalleryImages Update. */ +public final class GalleryImagesUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/GalleryImage_Update.json + */ + /** + * Sample code: Update a simple gallery image. + * + * @param manager Entry point to ComputeManager. + */ + public static void updateASimpleGalleryImage(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + GalleryImage resource = + manager + .galleryImages() + .getWithResponse( + "myResourceGroup", "myGalleryName", "myGalleryImageName", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withOsType(OperatingSystemTypes.WINDOWS) + .withOsState(OperatingSystemStateTypes.GENERALIZED) + .withHyperVGeneration(HyperVGeneration.V1) + .withIdentifier( + new GalleryImageIdentifier() + .withPublisher("myPublisherName") + .withOffer("myOfferName") + .withSku("mySkuName")) + .apply(); + } +} +``` + +### GallerySharingProfile_Update + +```java +import com.azure.resourcemanager.compute.generated.fluent.models.SharingUpdateInner; +import com.azure.resourcemanager.compute.generated.models.SharingProfileGroup; +import com.azure.resourcemanager.compute.generated.models.SharingProfileGroupTypes; +import com.azure.resourcemanager.compute.generated.models.SharingUpdateOperationTypes; +import java.util.Arrays; + +/** Samples for GallerySharingProfile Update. */ +public final class GallerySharingProfileUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/Gallery_EnableCommunityGallery.json + */ + /** + * Sample code: share a gallery to community. + * + * @param manager Entry point to ComputeManager. + */ + public static void shareAGalleryToCommunity(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .gallerySharingProfiles() + .update( + "myResourceGroup", + "myGalleryName", + new SharingUpdateInner().withOperationType(SharingUpdateOperationTypes.ENABLE_COMMUNITY), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/Gallery_ResetSharingProfile.json + */ + /** + * Sample code: reset sharing profile of a gallery. + * + * @param manager Entry point to ComputeManager. + */ + public static void resetSharingProfileOfAGallery( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .gallerySharingProfiles() + .update( + "myResourceGroup", + "myGalleryName", + new SharingUpdateInner().withOperationType(SharingUpdateOperationTypes.RESET), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/Gallery_AddToSharingProfile.json + */ + /** + * Sample code: Add sharing id to the sharing profile of a gallery. + * + * @param manager Entry point to ComputeManager. + */ + public static void addSharingIdToTheSharingProfileOfAGallery( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .gallerySharingProfiles() + .update( + "myResourceGroup", + "myGalleryName", + new SharingUpdateInner() + .withOperationType(SharingUpdateOperationTypes.ADD) + .withGroups( + Arrays + .asList( + new SharingProfileGroup() + .withType(SharingProfileGroupTypes.SUBSCRIPTIONS) + .withIds( + Arrays + .asList( + "34a4ab42-0d72-47d9-bd1a-aed207386dac", + "380fd389-260b-41aa-bad9-0a83108c370b")), + new SharingProfileGroup() + .withType(SharingProfileGroupTypes.AADTENANTS) + .withIds(Arrays.asList("c24c76aa-8897-4027-9b03-8f7928b54ff6")))), + com.azure.core.util.Context.NONE); + } +} +``` + +### Images_CreateOrUpdate + +```java +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.compute.generated.models.DiskEncryptionSetParameters; +import com.azure.resourcemanager.compute.generated.models.ImageDataDisk; +import com.azure.resourcemanager.compute.generated.models.ImageOSDisk; +import com.azure.resourcemanager.compute.generated.models.ImageStorageProfile; +import com.azure.resourcemanager.compute.generated.models.OperatingSystemStateTypes; +import com.azure.resourcemanager.compute.generated.models.OperatingSystemTypes; +import java.util.Arrays; + +/** Samples for Images CreateOrUpdate. */ +public final class ImagesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/imageExamples/Image_CreateFromASnapshot.json + */ + /** + * Sample code: Create a virtual machine image from a snapshot. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVirtualMachineImageFromASnapshot( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .images() + .define("myImage") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withStorageProfile( + new ImageStorageProfile() + .withOsDisk( + new ImageOSDisk() + .withSnapshot( + new SubResource() + .withId( + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot")) + .withOsType(OperatingSystemTypes.LINUX) + .withOsState(OperatingSystemStateTypes.GENERALIZED)) + .withZoneResilient(false)) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/imageExamples/Image_CreateFromAManagedDisk.json + */ + /** + * Sample code: Create a virtual machine image from a managed disk. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVirtualMachineImageFromAManagedDisk( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .images() + .define("myImage") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withStorageProfile( + new ImageStorageProfile() + .withOsDisk( + new ImageOSDisk() + .withManagedDisk( + new SubResource() + .withId( + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk")) + .withOsType(OperatingSystemTypes.LINUX) + .withOsState(OperatingSystemStateTypes.GENERALIZED)) + .withZoneResilient(true)) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/imageExamples/Image_CreateFromABlobWithDiskEncryptionSet.json + */ + /** + * Sample code: Create a virtual machine image from a blob with DiskEncryptionSet resource. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVirtualMachineImageFromABlobWithDiskEncryptionSetResource( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .images() + .define("myImage") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withStorageProfile( + new ImageStorageProfile() + .withOsDisk( + new ImageOSDisk() + .withBlobUri("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd") + .withDiskEncryptionSet( + new DiskEncryptionSetParameters() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}")) + .withOsType(OperatingSystemTypes.LINUX) + .withOsState(OperatingSystemStateTypes.GENERALIZED))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/imageExamples/Image_CreateFromAManagedDiskWithDiskEncryptionSet.json + */ + /** + * Sample code: Create a virtual machine image from a managed disk with DiskEncryptionSet resource. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVirtualMachineImageFromAManagedDiskWithDiskEncryptionSetResource( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .images() + .define("myImage") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withStorageProfile( + new ImageStorageProfile() + .withOsDisk( + new ImageOSDisk() + .withSnapshot( + new SubResource() + .withId( + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot")) + .withDiskEncryptionSet( + new DiskEncryptionSetParameters() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}")) + .withOsType(OperatingSystemTypes.LINUX) + .withOsState(OperatingSystemStateTypes.GENERALIZED))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/imageExamples/Image_Create_DataDiskFromABlobIncluded.json + */ + /** + * Sample code: Create a virtual machine image that includes a data disk from a blob. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVirtualMachineImageThatIncludesADataDiskFromABlob( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .images() + .define("myImage") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withStorageProfile( + new ImageStorageProfile() + .withOsDisk( + new ImageOSDisk() + .withBlobUri("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd") + .withOsType(OperatingSystemTypes.LINUX) + .withOsState(OperatingSystemStateTypes.GENERALIZED)) + .withDataDisks( + Arrays + .asList( + new ImageDataDisk() + .withBlobUri( + "https://mystorageaccount.blob.core.windows.net/dataimages/dataimage.vhd") + .withLun(1))) + .withZoneResilient(false)) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/imageExamples/Image_CreateFromASnapshotWithDiskEncryptionSet.json + */ + /** + * Sample code: Create a virtual machine image from a snapshot with DiskEncryptionSet resource. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVirtualMachineImageFromASnapshotWithDiskEncryptionSetResource( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .images() + .define("myImage") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withStorageProfile( + new ImageStorageProfile() + .withOsDisk( + new ImageOSDisk() + .withManagedDisk( + new SubResource() + .withId( + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk")) + .withDiskEncryptionSet( + new DiskEncryptionSetParameters() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}")) + .withOsType(OperatingSystemTypes.LINUX) + .withOsState(OperatingSystemStateTypes.GENERALIZED))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/imageExamples/Image_Create_DataDiskFromASnapshotIncluded.json + */ + /** + * Sample code: Create a virtual machine image that includes a data disk from a snapshot. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVirtualMachineImageThatIncludesADataDiskFromASnapshot( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .images() + .define("myImage") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withStorageProfile( + new ImageStorageProfile() + .withOsDisk( + new ImageOSDisk() + .withSnapshot( + new SubResource() + .withId( + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot")) + .withOsType(OperatingSystemTypes.LINUX) + .withOsState(OperatingSystemStateTypes.GENERALIZED)) + .withDataDisks( + Arrays + .asList( + new ImageDataDisk() + .withSnapshot( + new SubResource() + .withId( + "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot2")) + .withLun(1))) + .withZoneResilient(true)) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/imageExamples/Image_CreateFromABlob.json + */ + /** + * Sample code: Create a virtual machine image from a blob. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVirtualMachineImageFromABlob( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .images() + .define("myImage") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withStorageProfile( + new ImageStorageProfile() + .withOsDisk( + new ImageOSDisk() + .withBlobUri("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd") + .withOsType(OperatingSystemTypes.LINUX) + .withOsState(OperatingSystemStateTypes.GENERALIZED)) + .withZoneResilient(true)) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/imageExamples/Image_CreateFromAVM.json + */ + /** + * Sample code: Create a virtual machine image from an existing virtual machine. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVirtualMachineImageFromAnExistingVirtualMachine( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .images() + .define("myImage") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withSourceVirtualMachine( + new SubResource() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM")) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/imageExamples/Image_Create_DataDiskFromAManagedDiskIncluded.json + */ + /** + * Sample code: Create a virtual machine image that includes a data disk from a managed disk. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVirtualMachineImageThatIncludesADataDiskFromAManagedDisk( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .images() + .define("myImage") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withStorageProfile( + new ImageStorageProfile() + .withOsDisk( + new ImageOSDisk() + .withManagedDisk( + new SubResource() + .withId( + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk")) + .withOsType(OperatingSystemTypes.LINUX) + .withOsState(OperatingSystemStateTypes.GENERALIZED)) + .withDataDisks( + Arrays + .asList( + new ImageDataDisk() + .withManagedDisk( + new SubResource() + .withId( + "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk2")) + .withLun(1))) + .withZoneResilient(false)) + .create(); + } +} +``` + +### Images_Delete + +```java +/** Samples for Images Delete. */ +public final class ImagesDeleteSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/imageExamples/Images_Delete_MinimumSet_Gen.json + */ + /** + * Sample code: Image_Delete_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void imageDeleteMinimumSetGen(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.images().delete("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/imageExamples/Images_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: Image_Delete_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void imageDeleteMaximumSetGen(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.images().delete("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } +} +``` + +### Images_GetByResourceGroup + +```java +/** Samples for Images GetByResourceGroup. */ +public final class ImagesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/imageExamples/Image_Get.json + */ + /** + * Sample code: Get information about a virtual machine image. + * + * @param manager Entry point to ComputeManager. + */ + public static void getInformationAboutAVirtualMachineImage( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .images() + .getByResourceGroupWithResponse("myResourceGroup", "myImage", null, com.azure.core.util.Context.NONE); + } +} +``` + +### Images_List + +```java +/** Samples for Images List. */ +public final class ImagesListSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/imageExamples/Image_ListBySubscription.json + */ + /** + * Sample code: List all virtual machine images in a subscription. + * + * @param manager Entry point to ComputeManager. + */ + public static void listAllVirtualMachineImagesInASubscription( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.images().list(com.azure.core.util.Context.NONE); + } +} +``` + +### Images_ListByResourceGroup + +```java +/** Samples for Images ListByResourceGroup. */ +public final class ImagesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/imageExamples/Image_ListByResourceGroup.json + */ + /** + * Sample code: List all virtual machine images in a resource group. + * + * @param manager Entry point to ComputeManager. + */ + public static void listAllVirtualMachineImagesInAResourceGroup( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.images().listByResourceGroup("myResourceGroup", com.azure.core.util.Context.NONE); + } +} +``` + +### Images_Update + +```java +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.compute.generated.models.HyperVGenerationTypes; +import com.azure.resourcemanager.compute.generated.models.Image; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Images Update. */ +public final class ImagesUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/imageExamples/Image_Update.json + */ + /** + * Sample code: Updates tags of an Image. + * + * @param manager Entry point to ComputeManager. + */ + public static void updatesTagsOfAnImage(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + Image resource = + manager + .images() + .getByResourceGroupWithResponse("myResourceGroup", "myImage", null, com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("department", "HR")) + .withSourceVirtualMachine( + new SubResource() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM")) + .withHyperVGeneration(HyperVGenerationTypes.V1) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### LogAnalytics_ExportRequestRateByInterval + +```java +import com.azure.resourcemanager.compute.generated.models.IntervalInMins; +import com.azure.resourcemanager.compute.generated.models.RequestRateByIntervalInput; +import java.time.OffsetDateTime; + +/** Samples for LogAnalytics ExportRequestRateByInterval. */ +public final class LogAnalyticsExportRequestRateByIntervalSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/logAnalyticExamples/LogAnalytics_RequestRateByInterval.json + */ + /** + * Sample code: Export logs which contain all Api requests made to Compute Resource Provider within the given time + * period broken down by intervals. + * + * @param manager Entry point to ComputeManager. + */ + public static void + exportLogsWhichContainAllApiRequestsMadeToComputeResourceProviderWithinTheGivenTimePeriodBrokenDownByIntervals( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .logAnalytics() + .exportRequestRateByInterval( + "westus", + new RequestRateByIntervalInput() + .withBlobContainerSasUri("https://somesasuri") + .withFromTime(OffsetDateTime.parse("2018-01-21T01:54:06.862601Z")) + .withToTime(OffsetDateTime.parse("2018-01-23T01:54:06.862601Z")) + .withGroupByResourceName(true) + .withIntervalLength(IntervalInMins.FIVE_MINS), + com.azure.core.util.Context.NONE); + } +} +``` + +### LogAnalytics_ExportThrottledRequests + +```java +import com.azure.resourcemanager.compute.generated.models.ThrottledRequestsInput; +import java.time.OffsetDateTime; + +/** Samples for LogAnalytics ExportThrottledRequests. */ +public final class LogAnalyticsExportThrottledRequestsSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/logAnalyticExamples/LogAnalytics_ThrottledRequests.json + */ + /** + * Sample code: Export logs which contain all throttled Api requests made to Compute Resource Provider within the + * given time period. + * + * @param manager Entry point to ComputeManager. + */ + public static void + exportLogsWhichContainAllThrottledApiRequestsMadeToComputeResourceProviderWithinTheGivenTimePeriod( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .logAnalytics() + .exportThrottledRequests( + "westus", + new ThrottledRequestsInput() + .withBlobContainerSasUri("https://somesasuri") + .withFromTime(OffsetDateTime.parse("2018-01-21T01:54:06.862601Z")) + .withToTime(OffsetDateTime.parse("2018-01-23T01:54:06.862601Z")) + .withGroupByOperationName(true) + .withGroupByResourceName(false) + .withGroupByClientApplicationId(false) + .withGroupByUserAgent(false), + com.azure.core.util.Context.NONE); + } +} +``` + +### Operations_List + +```java +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/computeRPCommonExamples/Operations_List_MinimumSet_Gen.json + */ + /** + * Sample code: Operations_List_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void operationsListMinimumSetGen(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/computeRPCommonExamples/Operations_List_MaximumSet_Gen.json + */ + /** + * Sample code: Operations_List_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void operationsListMaximumSetGen(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} +``` + +### ProximityPlacementGroups_CreateOrUpdate + +```java +import com.azure.resourcemanager.compute.generated.models.ProximityPlacementGroupPropertiesIntent; +import com.azure.resourcemanager.compute.generated.models.ProximityPlacementGroupType; +import java.util.Arrays; + +/** Samples for ProximityPlacementGroups CreateOrUpdate. */ +public final class ProximityPlacementGroupsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_CreateOrUpdate.json + */ + /** + * Sample code: Create or Update a proximity placement group. + * + * @param manager Entry point to ComputeManager. + */ + public static void createOrUpdateAProximityPlacementGroup( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .proximityPlacementGroups() + .define("myProximityPlacementGroup") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withZones(Arrays.asList("1")) + .withProximityPlacementGroupType(ProximityPlacementGroupType.STANDARD) + .withIntent( + new ProximityPlacementGroupPropertiesIntent().withVmSizes(Arrays.asList("Basic_A0", "Basic_A2"))) + .create(); + } +} +``` + +### ProximityPlacementGroups_Delete + +```java +/** Samples for ProximityPlacementGroups Delete. */ +public final class ProximityPlacementGroupsDeleteSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_Delete.json + */ + /** + * Sample code: Delete a proximity placement group. + * + * @param manager Entry point to ComputeManager. + */ + public static void deleteAProximityPlacementGroup( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .proximityPlacementGroups() + .deleteByResourceGroupWithResponse( + "myResourceGroup", "myProximityPlacementGroup", com.azure.core.util.Context.NONE); + } +} +``` + +### ProximityPlacementGroups_GetByResourceGroup + +```java +/** Samples for ProximityPlacementGroups GetByResourceGroup. */ +public final class ProximityPlacementGroupsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_Get.json + */ + /** + * Sample code: Get proximity placement groups. + * + * @param manager Entry point to ComputeManager. + */ + public static void getProximityPlacementGroups(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .proximityPlacementGroups() + .getByResourceGroupWithResponse( + "myResourceGroup", "myProximityPlacementGroup", null, com.azure.core.util.Context.NONE); + } +} +``` + +### ProximityPlacementGroups_List + +```java +/** Samples for ProximityPlacementGroups List. */ +public final class ProximityPlacementGroupsListSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_ListBySubscription.json + */ + /** + * Sample code: List proximity placement groups. + * + * @param manager Entry point to ComputeManager. + */ + public static void listProximityPlacementGroups( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.proximityPlacementGroups().list(com.azure.core.util.Context.NONE); + } +} +``` + +### ProximityPlacementGroups_ListByResourceGroup + +```java +/** Samples for ProximityPlacementGroups ListByResourceGroup. */ +public final class ProximityPlacementGroupsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_ListByResourceGroup.json + */ + /** + * Sample code: List proximity placement group. + * + * @param manager Entry point to ComputeManager. + */ + public static void listProximityPlacementGroup(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.proximityPlacementGroups().listByResourceGroup("myResourceGroup", com.azure.core.util.Context.NONE); + } +} +``` + +### ProximityPlacementGroups_Update + +```java +import com.azure.resourcemanager.compute.generated.models.ProximityPlacementGroup; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ProximityPlacementGroups Update. */ +public final class ProximityPlacementGroupsUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_Patch.json + */ + /** + * Sample code: Update a proximity placement group. + * + * @param manager Entry point to ComputeManager. + */ + public static void updateAProximityPlacementGroup( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + ProximityPlacementGroup resource = + manager + .proximityPlacementGroups() + .getByResourceGroupWithResponse( + "myResourceGroup", "myProximityPlacementGroup", null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("additionalProp1", "string")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### ResourceSkus_List + +```java +/** Samples for ResourceSkus List. */ +public final class ResourceSkusListSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/Skus/stable/2021-07-01/examples/skus/ListAvailableResourceSkus.json + */ + /** + * Sample code: Lists all available Resource SKUs. + * + * @param manager Entry point to ComputeManager. + */ + public static void listsAllAvailableResourceSKUs( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.resourceSkus().list(null, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/Skus/stable/2021-07-01/examples/skus/ListAvailableResourceSkusForARegion.json + */ + /** + * Sample code: Lists all available Resource SKUs for the specified region. + * + * @param manager Entry point to ComputeManager. + */ + public static void listsAllAvailableResourceSKUsForTheSpecifiedRegion( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.resourceSkus().list("location eq 'westus'", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/Skus/stable/2021-07-01/examples/skus/ListAvailableResourceSkusWithExtendedLocations.json + */ + /** + * Sample code: Lists all available Resource SKUs with Extended Location information. + * + * @param manager Entry point to ComputeManager. + */ + public static void listsAllAvailableResourceSKUsWithExtendedLocationInformation( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.resourceSkus().list(null, "true", com.azure.core.util.Context.NONE); + } +} +``` + +### RestorePointCollections_CreateOrUpdate + +```java +import com.azure.resourcemanager.compute.generated.models.RestorePointCollectionSourceProperties; +import java.util.HashMap; +import java.util.Map; + +/** Samples for RestorePointCollections CreateOrUpdate. */ +public final class RestorePointCollectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/restorePointExamples/RestorePointCollection_CreateOrUpdate_ForCrossRegionCopy.json + */ + /** + * Sample code: Create or update a restore point collection for cross region copy. + * + * @param manager Entry point to ComputeManager. + */ + public static void createOrUpdateARestorePointCollectionForCrossRegionCopy( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .restorePointCollections() + .define("myRpc") + .withRegion("norwayeast") + .withExistingResourceGroup("myResourceGroup") + .withTags(mapOf("myTag1", "tagValue1")) + .withSource( + new RestorePointCollectionSourceProperties() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/sourceRpcName")) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/restorePointExamples/RestorePointCollection_CreateOrUpdate.json + */ + /** + * Sample code: Create or update a restore point collection. + * + * @param manager Entry point to ComputeManager. + */ + public static void createOrUpdateARestorePointCollection( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .restorePointCollections() + .define("myRpc") + .withRegion("norwayeast") + .withExistingResourceGroup("myResourceGroup") + .withTags(mapOf("myTag1", "tagValue1")) + .withSource( + new RestorePointCollectionSourceProperties() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### RestorePointCollections_Delete + +```java +/** Samples for RestorePointCollections Delete. */ +public final class RestorePointCollectionsDeleteSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/restorePointExamples/RestorePointCollection_Delete_MinimumSet_Gen.json + */ + /** + * Sample code: RestorePointCollection_Delete_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void restorePointCollectionDeleteMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.restorePointCollections().delete("rgcompute", "aaaaaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/restorePointExamples/RestorePointCollection_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: RestorePointCollection_Delete_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void restorePointCollectionDeleteMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.restorePointCollections().delete("rgcompute", "aaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } +} +``` + +### RestorePointCollections_GetByResourceGroup + +```java +/** Samples for RestorePointCollections GetByResourceGroup. */ +public final class RestorePointCollectionsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/restorePointExamples/RestorePointCollection_Get_WithContainedRestorePoints.json + */ + /** + * Sample code: Get a restore point collection, including the restore points contained in the restore point + * collection. + * + * @param manager Entry point to ComputeManager. + */ + public static void getARestorePointCollectionIncludingTheRestorePointsContainedInTheRestorePointCollection( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .restorePointCollections() + .getByResourceGroupWithResponse("myResourceGroup", "rpcName", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/restorePointExamples/RestorePointCollection_Get.json + */ + /** + * Sample code: Get a restore point collection (but not the restore points contained in the restore point + * collection). + * + * @param manager Entry point to ComputeManager. + */ + public static void getARestorePointCollectionButNotTheRestorePointsContainedInTheRestorePointCollection( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .restorePointCollections() + .getByResourceGroupWithResponse("myResourceGroup", "myRpc", null, com.azure.core.util.Context.NONE); + } +} +``` + +### RestorePointCollections_List + +```java +/** Samples for RestorePointCollections List. */ +public final class RestorePointCollectionsListSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/restorePointExamples/RestorePointCollection_ListBySubscription.json + */ + /** + * Sample code: Gets the list of restore point collections in a subscription. + * + * @param manager Entry point to ComputeManager. + */ + public static void getsTheListOfRestorePointCollectionsInASubscription( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.restorePointCollections().list(com.azure.core.util.Context.NONE); + } +} +``` + +### RestorePointCollections_ListByResourceGroup + +```java +/** Samples for RestorePointCollections ListByResourceGroup. */ +public final class RestorePointCollectionsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/restorePointExamples/RestorePointCollection_ListByResourceGroup.json + */ + /** + * Sample code: Gets the list of restore point collections in a resource group. + * + * @param manager Entry point to ComputeManager. + */ + public static void getsTheListOfRestorePointCollectionsInAResourceGroup( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.restorePointCollections().listByResourceGroup("myResourceGroup", com.azure.core.util.Context.NONE); + } +} +``` + +### RestorePointCollections_Update + +```java +import com.azure.resourcemanager.compute.generated.models.RestorePointCollection; +import com.azure.resourcemanager.compute.generated.models.RestorePointCollectionSourceProperties; +import java.util.HashMap; +import java.util.Map; + +/** Samples for RestorePointCollections Update. */ +public final class RestorePointCollectionsUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/restorePointExamples/RestorePointCollection_Update_MaximumSet_Gen.json + */ + /** + * Sample code: RestorePointCollection_Update_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void restorePointCollectionUpdateMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + RestorePointCollection resource = + manager + .restorePointCollections() + .getByResourceGroupWithResponse( + "rgcompute", "aaaaaaaaaaaaaaaaaaaa", null, com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("key8536", "aaaaaaaaaaaaaaaaaaa")) + .withSource( + new RestorePointCollectionSourceProperties() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM")) + .apply(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/restorePointExamples/RestorePointCollection_Update_MinimumSet_Gen.json + */ + /** + * Sample code: RestorePointCollection_Update_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void restorePointCollectionUpdateMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + RestorePointCollection resource = + manager + .restorePointCollections() + .getByResourceGroupWithResponse( + "rgcompute", "aaaaaaaaaaaaaaaaaa", null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update().apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### RestorePoints_Create + +```java +import com.azure.resourcemanager.compute.generated.models.ApiEntityReference; +import java.util.Arrays; + +/** Samples for RestorePoints Create. */ +public final class RestorePointsCreateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/restorePointExamples/RestorePoint_Copy_BetweenRegions.json + */ + /** + * Sample code: Copy a restore point to a different region. + * + * @param manager Entry point to ComputeManager. + */ + public static void copyARestorePointToADifferentRegion( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .restorePoints() + .define("rpName") + .withExistingRestorePointCollection("myResourceGroup", "rpcName") + .withSourceRestorePoint( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/sourceRpcName/restorePoints/sourceRpName")) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/restorePointExamples/RestorePoint_Create.json + */ + /** + * Sample code: Create a restore point. + * + * @param manager Entry point to ComputeManager. + */ + public static void createARestorePoint(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .restorePoints() + .define("rpName") + .withExistingRestorePointCollection("myResourceGroup", "rpcName") + .withExcludeDisks( + Arrays + .asList( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/disk123"))) + .create(); + } +} +``` + +### RestorePoints_Delete + +```java +/** Samples for RestorePoints Delete. */ +public final class RestorePointsDeleteSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/restorePointExamples/RestorePoint_Delete_MinimumSet_Gen.json + */ + /** + * Sample code: RestorePoint_Delete_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void restorePointDeleteMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .restorePoints() + .delete("rgcompute", "aaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/restorePointExamples/RestorePoint_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: RestorePoint_Delete_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void restorePointDeleteMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.restorePoints().delete("rgcompute", "aaaaaaaaaaaaaaaaaaaaaa", "a", com.azure.core.util.Context.NONE); + } +} +``` + +### RestorePoints_Get + +```java +/** Samples for RestorePoints Get. */ +public final class RestorePointsGetSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/restorePointExamples/RestorePoint_Get.json + */ + /** + * Sample code: Get a restore point. + * + * @param manager Entry point to ComputeManager. + */ + public static void getARestorePoint(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .restorePoints() + .getWithResponse("myResourceGroup", "rpcName", "rpName", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/restorePointExamples/RestorePoint_Get_WithInstanceView.json + */ + /** + * Sample code: Get restore point with instance view. + * + * @param manager Entry point to ComputeManager. + */ + public static void getRestorePointWithInstanceView( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .restorePoints() + .getWithResponse("myResourceGroup", "rpcName", "rpName", null, com.azure.core.util.Context.NONE); + } +} +``` + +### SharedGalleries_Get + +```java +/** Samples for SharedGalleries Get. */ +public final class SharedGalleriesGetSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/sharedGalleryExamples/SharedGallery_Get.json + */ + /** + * Sample code: Get a shared gallery. + * + * @param manager Entry point to ComputeManager. + */ + public static void getASharedGallery(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.sharedGalleries().getWithResponse("myLocation", "galleryUniqueName", com.azure.core.util.Context.NONE); + } +} +``` + +### SharedGalleries_List + +```java +/** Samples for SharedGalleries List. */ +public final class SharedGalleriesListSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/sharedGalleryExamples/SharedGallery_List.json + */ + /** + * Sample code: List shared galleries. + * + * @param manager Entry point to ComputeManager. + */ + public static void listSharedGalleries(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.sharedGalleries().list("myLocation", null, com.azure.core.util.Context.NONE); + } +} +``` + +### SharedGalleryImageVersions_Get + +```java +/** Samples for SharedGalleryImageVersions Get. */ +public final class SharedGalleryImageVersionsGetSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/sharedGalleryExamples/SharedGalleryImageVersion_Get.json + */ + /** + * Sample code: Get a shared gallery image version. + * + * @param manager Entry point to ComputeManager. + */ + public static void getASharedGalleryImageVersion( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .sharedGalleryImageVersions() + .getWithResponse( + "myLocation", + "galleryUniqueName", + "myGalleryImageName", + "myGalleryImageVersionName", + com.azure.core.util.Context.NONE); + } +} +``` + +### SharedGalleryImageVersions_List + +```java +/** Samples for SharedGalleryImageVersions List. */ +public final class SharedGalleryImageVersionsListSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/sharedGalleryExamples/SharedGalleryImageVersions_List.json + */ + /** + * Sample code: List shared gallery image versions. + * + * @param manager Entry point to ComputeManager. + */ + public static void listSharedGalleryImageVersions( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .sharedGalleryImageVersions() + .list("myLocation", "galleryUniqueName", "myGalleryImageName", null, com.azure.core.util.Context.NONE); + } +} +``` + +### SharedGalleryImages_Get + +```java +/** Samples for SharedGalleryImages Get. */ +public final class SharedGalleryImagesGetSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/sharedGalleryExamples/SharedGalleryImage_Get.json + */ + /** + * Sample code: Get a shared gallery image. + * + * @param manager Entry point to ComputeManager. + */ + public static void getASharedGalleryImage(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .sharedGalleryImages() + .getWithResponse("myLocation", "galleryUniqueName", "myGalleryImageName", com.azure.core.util.Context.NONE); + } +} +``` + +### SharedGalleryImages_List + +```java +/** Samples for SharedGalleryImages List. */ +public final class SharedGalleryImagesListSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/sharedGalleryExamples/SharedGalleryImages_List.json + */ + /** + * Sample code: List shared gallery images. + * + * @param manager Entry point to ComputeManager. + */ + public static void listSharedGalleryImages(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.sharedGalleryImages().list("myLocation", "galleryUniqueName", null, com.azure.core.util.Context.NONE); + } +} +``` + +### Snapshots_CreateOrUpdate + +```java +import com.azure.resourcemanager.compute.generated.models.CreationData; +import com.azure.resourcemanager.compute.generated.models.DiskCreateOption; + +/** Samples for Snapshots CreateOrUpdate. */ +public final class SnapshotsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/snapshotExamples/Snapshot_Create_FromAnExistingSnapshot.json + */ + /** + * Sample code: Create a snapshot from an existing snapshot in the same or a different subscription. + * + * @param manager Entry point to ComputeManager. + */ + public static void createASnapshotFromAnExistingSnapshotInTheSameOrADifferentSubscription( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .snapshots() + .define("mySnapshot2") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withCreationData( + new CreationData() + .withCreateOption(DiskCreateOption.COPY) + .withSourceResourceId( + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot1")) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/snapshotExamples/Snapshot_Create_FromAnExistingSnapshotInDifferentRegion.json + */ + /** + * Sample code: Create a snapshot from an existing snapshot in the same or a different subscription in a different + * region. + * + * @param manager Entry point to ComputeManager. + */ + public static void createASnapshotFromAnExistingSnapshotInTheSameOrADifferentSubscriptionInADifferentRegion( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .snapshots() + .define("mySnapshot2") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withCreationData( + new CreationData() + .withCreateOption(DiskCreateOption.COPY_START) + .withSourceResourceId( + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot1")) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/snapshotExamples/Snapshot_Create_ByImportingAnUnmanagedBlobFromTheSameSubscription.json + */ + /** + * Sample code: Create a snapshot by importing an unmanaged blob from the same subscription. + * + * @param manager Entry point to ComputeManager. + */ + public static void createASnapshotByImportingAnUnmanagedBlobFromTheSameSubscription( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .snapshots() + .define("mySnapshot1") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withCreationData( + new CreationData() + .withCreateOption(DiskCreateOption.IMPORT) + .withSourceUri("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd")) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/snapshotExamples/Snapshot_Create_ByImportingAnUnmanagedBlobFromADifferentSubscription.json + */ + /** + * Sample code: Create a snapshot by importing an unmanaged blob from a different subscription. + * + * @param manager Entry point to ComputeManager. + */ + public static void createASnapshotByImportingAnUnmanagedBlobFromADifferentSubscription( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .snapshots() + .define("mySnapshot1") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withCreationData( + new CreationData() + .withCreateOption(DiskCreateOption.IMPORT) + .withStorageAccountId( + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount") + .withSourceUri("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd")) + .create(); + } +} +``` + +### Snapshots_Delete + +```java +/** Samples for Snapshots Delete. */ +public final class SnapshotsDeleteSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/snapshotExamples/Snapshot_Delete.json + */ + /** + * Sample code: Delete a snapshot. + * + * @param manager Entry point to ComputeManager. + */ + public static void deleteASnapshot(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.snapshots().delete("myResourceGroup", "mySnapshot", com.azure.core.util.Context.NONE); + } +} +``` + +### Snapshots_GetByResourceGroup + +```java +/** Samples for Snapshots GetByResourceGroup. */ +public final class SnapshotsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/snapshotExamples/Snapshot_GetIncrementalSnapshot.json + */ + /** + * Sample code: Get information about an incremental snapshot. + * + * @param manager Entry point to ComputeManager. + */ + public static void getInformationAboutAnIncrementalSnapshot( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .snapshots() + .getByResourceGroupWithResponse( + "myResourceGroup", "myIncrementalSnapshot", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/snapshotExamples/Snapshot_Get.json + */ + /** + * Sample code: Get information about a snapshot. + * + * @param manager Entry point to ComputeManager. + */ + public static void getInformationAboutASnapshot( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .snapshots() + .getByResourceGroupWithResponse("myResourceGroup", "mySnapshot", com.azure.core.util.Context.NONE); + } +} +``` + +### Snapshots_GrantAccess + +```java +import com.azure.resourcemanager.compute.generated.models.AccessLevel; +import com.azure.resourcemanager.compute.generated.models.GrantAccessData; + +/** Samples for Snapshots GrantAccess. */ +public final class SnapshotsGrantAccessSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/snapshotExamples/Snapshot_BeginGetAccess.json + */ + /** + * Sample code: Get a sas on a snapshot. + * + * @param manager Entry point to ComputeManager. + */ + public static void getASasOnASnapshot(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .snapshots() + .grantAccess( + "myResourceGroup", + "mySnapshot", + new GrantAccessData().withAccess(AccessLevel.READ).withDurationInSeconds(300), + com.azure.core.util.Context.NONE); + } +} +``` + +### Snapshots_List + +```java +/** Samples for Snapshots List. */ +public final class SnapshotsListSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/snapshotExamples/Snapshot_ListBySubscription.json + */ + /** + * Sample code: List all snapshots in a subscription. + * + * @param manager Entry point to ComputeManager. + */ + public static void listAllSnapshotsInASubscription( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.snapshots().list(com.azure.core.util.Context.NONE); + } +} +``` + +### Snapshots_ListByResourceGroup + +```java +/** Samples for Snapshots ListByResourceGroup. */ +public final class SnapshotsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/snapshotExamples/Snapshot_ListByResourceGroup.json + */ + /** + * Sample code: List all snapshots in a resource group. + * + * @param manager Entry point to ComputeManager. + */ + public static void listAllSnapshotsInAResourceGroup( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.snapshots().listByResourceGroup("myResourceGroup", com.azure.core.util.Context.NONE); + } +} +``` + +### Snapshots_RevokeAccess + +```java +/** Samples for Snapshots RevokeAccess. */ +public final class SnapshotsRevokeAccessSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/snapshotExamples/Snapshot_EndGetAccess.json + */ + /** + * Sample code: Revoke access to a snapshot. + * + * @param manager Entry point to ComputeManager. + */ + public static void revokeAccessToASnapshot(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.snapshots().revokeAccess("myResourceGroup", "mySnapshot", com.azure.core.util.Context.NONE); + } +} +``` + +### Snapshots_Update + +```java +import com.azure.resourcemanager.compute.generated.models.Snapshot; +import com.azure.resourcemanager.compute.generated.models.SupportedCapabilities; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Snapshots Update. */ +public final class SnapshotsUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/snapshotExamples/Snapshot_Update_WithAcceleratedNetwork.json + */ + /** + * Sample code: Update a snapshot with accelerated networking. + * + * @param manager Entry point to ComputeManager. + */ + public static void updateASnapshotWithAcceleratedNetworking( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + Snapshot resource = + manager + .snapshots() + .getByResourceGroupWithResponse("myResourceGroup", "mySnapshot", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("department", "Development", "project", "UpdateSnapshots")) + .withDiskSizeGB(20) + .withSupportedCapabilities(new SupportedCapabilities().withAcceleratedNetwork(false)) + .apply(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/snapshotExamples/Snapshot_Update.json + */ + /** + * Sample code: Update a snapshot. + * + * @param manager Entry point to ComputeManager. + */ + public static void updateASnapshot(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + Snapshot resource = + manager + .snapshots() + .getByResourceGroupWithResponse("myResourceGroup", "mySnapshot", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("department", "Development", "project", "UpdateSnapshots")) + .withDiskSizeGB(20) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### SshPublicKeys_Create + +```java +/** Samples for SshPublicKeys Create. */ +public final class SshPublicKeysCreateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/sshPublicKeyExamples/SshPublicKey_Create.json + */ + /** + * Sample code: Create a new SSH public key resource. + * + * @param manager Entry point to ComputeManager. + */ + public static void createANewSSHPublicKeyResource( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .sshPublicKeys() + .define("mySshPublicKeyName") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withPublicKey("{ssh-rsa public key}") + .create(); + } +} +``` + +### SshPublicKeys_Delete + +```java +/** Samples for SshPublicKeys Delete. */ +public final class SshPublicKeysDeleteSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/sshPublicKeyExamples/SshPublicKey_Delete_MinimumSet_Gen.json + */ + /** + * Sample code: SshPublicKey_Delete_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void sshPublicKeyDeleteMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .sshPublicKeys() + .deleteByResourceGroupWithResponse("rgcompute", "aaaaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/sshPublicKeyExamples/SshPublicKey_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: SshPublicKey_Delete_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void sshPublicKeyDeleteMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .sshPublicKeys() + .deleteByResourceGroupWithResponse("rgcompute", "aaaaaaaaaa", com.azure.core.util.Context.NONE); + } +} +``` + +### SshPublicKeys_GenerateKeyPair + +```java +/** Samples for SshPublicKeys GenerateKeyPair. */ +public final class SshPublicKeysGenerateKeyPairSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/sshPublicKeyExamples/SshPublicKey_GenerateKeyPair.json + */ + /** + * Sample code: Generate an SSH key pair. + * + * @param manager Entry point to ComputeManager. + */ + public static void generateAnSSHKeyPair(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .sshPublicKeys() + .generateKeyPairWithResponse("myResourceGroup", "mySshPublicKeyName", com.azure.core.util.Context.NONE); + } +} +``` + +### SshPublicKeys_GetByResourceGroup + +```java +/** Samples for SshPublicKeys GetByResourceGroup. */ +public final class SshPublicKeysGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/sshPublicKeyExamples/SshPublicKey_Get.json + */ + /** + * Sample code: Get an ssh public key. + * + * @param manager Entry point to ComputeManager. + */ + public static void getAnSshPublicKey(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .sshPublicKeys() + .getByResourceGroupWithResponse("myResourceGroup", "mySshPublicKeyName", com.azure.core.util.Context.NONE); + } +} +``` + +### SshPublicKeys_List + +```java +/** Samples for SshPublicKeys List. */ +public final class SshPublicKeysListSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/sshPublicKeyExamples/SshPublicKey_ListBySubscription_MinimumSet_Gen.json + */ + /** + * Sample code: SshPublicKey_ListBySubscription_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void sshPublicKeyListBySubscriptionMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.sshPublicKeys().list(com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/sshPublicKeyExamples/SshPublicKey_ListBySubscription_MaximumSet_Gen.json + */ + /** + * Sample code: SshPublicKey_ListBySubscription_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void sshPublicKeyListBySubscriptionMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.sshPublicKeys().list(com.azure.core.util.Context.NONE); + } +} +``` + +### SshPublicKeys_ListByResourceGroup + +```java +/** Samples for SshPublicKeys ListByResourceGroup. */ +public final class SshPublicKeysListByResourceGroupSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/sshPublicKeyExamples/SshPublicKey_ListByResourceGroup_MinimumSet_Gen.json + */ + /** + * Sample code: SshPublicKey_ListByResourceGroup_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void sshPublicKeyListByResourceGroupMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.sshPublicKeys().listByResourceGroup("rgcompute", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/sshPublicKeyExamples/SshPublicKey_ListByResourceGroup_MaximumSet_Gen.json + */ + /** + * Sample code: SshPublicKey_ListByResourceGroup_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void sshPublicKeyListByResourceGroupMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.sshPublicKeys().listByResourceGroup("rgcompute", com.azure.core.util.Context.NONE); + } +} +``` + +### SshPublicKeys_Update + +```java +import com.azure.resourcemanager.compute.generated.models.SshPublicKeyResource; +import java.util.HashMap; +import java.util.Map; + +/** Samples for SshPublicKeys Update. */ +public final class SshPublicKeysUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/sshPublicKeyExamples/SshPublicKey_Update_MinimumSet_Gen.json + */ + /** + * Sample code: SshPublicKey_Update_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void sshPublicKeyUpdateMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + SshPublicKeyResource resource = + manager + .sshPublicKeys() + .getByResourceGroupWithResponse("rgcompute", "aaaaaaaaaaa", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().apply(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/sshPublicKeyExamples/SshPublicKey_Update_MaximumSet_Gen.json + */ + /** + * Sample code: SshPublicKey_Update_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void sshPublicKeyUpdateMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + SshPublicKeyResource resource = + manager + .sshPublicKeys() + .getByResourceGroupWithResponse("rgcompute", "aaaaaaaaaaaa", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key2854", "a")).withPublicKey("{ssh-rsa public key}").apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Usage_List + +```java +/** Samples for Usage List. */ +public final class UsageListSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/computeRPCommonExamples/Usage_List_MinimumSet_Gen.json + */ + /** + * Sample code: Usage_List_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void usageListMinimumSetGen(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.usages().list("_--", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/computeRPCommonExamples/Usage_List_MaximumSet_Gen.json + */ + /** + * Sample code: Usage_List_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void usageListMaximumSetGen(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.usages().list("4_.", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineExtensionImages_Get + +```java +/** Samples for VirtualMachineExtensionImages Get. */ +public final class VirtualMachineExtensionImagesGetSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_Get_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineExtensionImage_Get_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineExtensionImageGetMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineExtensionImages() + .getWithResponse( + "aaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaa", "aa", "aaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_Get_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineExtensionImage_Get_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineExtensionImageGetMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineExtensionImages() + .getWithResponse( + "aaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaa", + com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineExtensionImages_ListTypes + +```java +/** Samples for VirtualMachineExtensionImages ListTypes. */ +public final class VirtualMachineExtensionImagesListTypesSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_ListTypes_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineExtensionImage_ListTypes_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineExtensionImageListTypesMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachineExtensionImages().listTypesWithResponse("aaaa", "aa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_ListTypes_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineExtensionImage_ListTypes_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineExtensionImageListTypesMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineExtensionImages() + .listTypesWithResponse( + "aaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineExtensionImages_ListVersions + +```java +/** Samples for VirtualMachineExtensionImages ListVersions. */ +public final class VirtualMachineExtensionImagesListVersionsSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_ListVersions_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineExtensionImage_ListVersions_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineExtensionImageListVersionsMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineExtensionImages() + .listVersionsWithResponse( + "aaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaa", + null, + null, + null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_ListVersions_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineExtensionImage_ListVersions_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineExtensionImageListVersionsMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineExtensionImages() + .listVersionsWithResponse( + "aaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaa", + 22, + "a", + com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineExtensions_CreateOrUpdate + +```java +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.compute.generated.models.InstanceViewStatus; +import com.azure.resourcemanager.compute.generated.models.StatusLevelTypes; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineExtensionInstanceView; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for VirtualMachineExtensions CreateOrUpdate. */ +public final class VirtualMachineExtensionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachineExtension_CreateOrUpdate_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineExtension_CreateOrUpdate_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineExtensionCreateOrUpdateMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) throws IOException { + manager + .virtualMachineExtensions() + .define("aaaaaaaaaaaaa") + .withRegion("westus") + .withExistingVirtualMachine("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaa") + .withTags(mapOf("key9183", "aa")) + .withForceUpdateTag("a") + .withPublisher("extPublisher") + .withTypePropertiesType("extType") + .withTypeHandlerVersion("1.2") + .withAutoUpgradeMinorVersion(true) + .withEnableAutomaticUpgrade(true) + .withSettings( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .withProtectedSettings( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .withInstanceView( + new VirtualMachineExtensionInstanceView() + .withName("aaaaaaaaaaaaaaaaa") + .withType("aaaaaaaaa") + .withTypeHandlerVersion("aaaaaaaaaaaaaaaaaaaaaaaaaa") + .withSubstatuses( + Arrays + .asList( + new InstanceViewStatus() + .withCode("fakeTokenPlaceholder") + .withLevel(StatusLevelTypes.INFO) + .withDisplayStatus("aaaaaa") + .withMessage("a") + .withTime(OffsetDateTime.parse("2021-11-30T12:58:26.522Z")))) + .withStatuses( + Arrays + .asList( + new InstanceViewStatus() + .withCode("fakeTokenPlaceholder") + .withLevel(StatusLevelTypes.INFO) + .withDisplayStatus("aaaaaa") + .withMessage("a") + .withTime(OffsetDateTime.parse("2021-11-30T12:58:26.522Z"))))) + .withSuppressFailures(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachineExtension_CreateOrUpdate_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineExtension_CreateOrUpdate_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineExtensionCreateOrUpdateMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineExtensions() + .define("myVMExtension") + .withRegion("westus") + .withExistingVirtualMachine("rgcompute", "myVM") + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### VirtualMachineExtensions_Delete + +```java +/** Samples for VirtualMachineExtensions Delete. */ +public final class VirtualMachineExtensionsDeleteSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachineExtension_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineExtension_Delete_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineExtensionDeleteMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineExtensions() + .delete("rgcompute", "aaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachineExtension_Delete_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineExtension_Delete_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineExtensionDeleteMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineExtensions() + .delete("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaa", "aa", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineExtensions_Get + +```java +/** Samples for VirtualMachineExtensions Get. */ +public final class VirtualMachineExtensionsGetSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachineExtension_Get_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineExtension_Get_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineExtensionGetMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineExtensions() + .getWithResponse( + "rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaa", "aaaaaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachineExtension_Get_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineExtension_Get_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineExtensionGetMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineExtensions() + .getWithResponse("rgcompute", "myVM", "myVMExtension", null, com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineExtensions_List + +```java +/** Samples for VirtualMachineExtensions List. */ +public final class VirtualMachineExtensionsListSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachineExtension_List_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineExtension_List_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineExtensionListMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineExtensions() + .listWithResponse("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaa", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachineExtension_List_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineExtension_List_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineExtensionListMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineExtensions() + .listWithResponse("rgcompute", "aaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineExtensions_Update + +```java +import com.azure.core.management.SubResource; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.compute.generated.models.KeyVaultSecretReference; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineExtension; +import java.io.IOException; + +/** Samples for VirtualMachineExtensions Update. */ +public final class VirtualMachineExtensionsUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachineExtension_Update.json + */ + /** + * Sample code: Update VM extension. + * + * @param manager Entry point to ComputeManager. + */ + public static void updateVMExtension(com.azure.resourcemanager.compute.generated.ComputeManager manager) + throws IOException { + VirtualMachineExtension resource = + manager + .virtualMachineExtensions() + .getWithResponse("myResourceGroup", "myVM", "myVMExtension", null, com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withPublisher("extPublisher") + .withType("extType") + .withTypeHandlerVersion("1.2") + .withAutoUpgradeMinorVersion(true) + .withSettings( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{\"UserName\":\"xyz@microsoft.com\"}", Object.class, SerializerEncoding.JSON)) + .withSuppressFailures(true) + .withProtectedSettingsFromKeyVault( + new KeyVaultSecretReference() + .withSecretUrl("fakeTokenPlaceholder") + .withSourceVault( + new SubResource() + .withId( + "/subscriptions/a53f7094-a16c-47af-abe4-b05c05d0d79a/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/kvName"))) + .apply(); + } +} +``` + +### VirtualMachineImages_Get + +```java +/** Samples for VirtualMachineImages Get. */ +public final class VirtualMachineImagesGetSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineImageExamples/VirtualMachineImage_Get_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineImage_Get_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineImageGetMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineImages() + .getWithResponse( + "aaaaaaaaaaaa", + "aaaaaaaaaaa", + "aa", + "aaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineImageExamples/VirtualMachineImage_Get_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineImage_Get_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineImageGetMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineImages() + .getWithResponse( + "aaaaaa", + "aaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaa", + com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineImages_List + +```java +/** Samples for VirtualMachineImages List. */ +public final class VirtualMachineImagesListSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineImageExamples/VirtualMachineImage_List_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineImage_List_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineImageListMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineImages() + .listWithResponse( + "aaaaaaa", "aaaaaaaaaaa", "aaaaaaaaaa", "aaaaaa", null, null, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineImageExamples/VirtualMachineImage_List_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineImage_List_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineImageListMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineImages() + .listWithResponse( + "aaaaaaaaaaaaaaa", + "aaaaaa", + "aaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaa", + 18, + "aa", + com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineImages_ListByEdgeZone + +```java +/** Samples for VirtualMachineImages ListByEdgeZone. */ +public final class VirtualMachineImagesListByEdgeZoneSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListByEdgeZone_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineImagesEdgeZone_ListByEdgeZone_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineImagesEdgeZoneListByEdgeZoneMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineImages() + .listByEdgeZoneWithResponse("WestUS", "microsoftlosangeles1", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListByEdgeZone_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineImagesEdgeZone_ListByEdgeZone_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineImagesEdgeZoneListByEdgeZoneMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineImages() + .listByEdgeZoneWithResponse("WestUS", "microsoftlosangeles1", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineImages_ListOffers + +```java +/** Samples for VirtualMachineImages ListOffers. */ +public final class VirtualMachineImagesListOffersSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListOffers_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineImage_ListOffers_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineImageListOffersMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineImages() + .listOffersWithResponse( + "aaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListOffers_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineImage_ListOffers_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineImageListOffersMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachineImages().listOffersWithResponse("aaaaaaa", "aaaaaaaa", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineImages_ListPublishers + +```java +/** Samples for VirtualMachineImages ListPublishers. */ +public final class VirtualMachineImagesListPublishersSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListPublishers_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineImage_ListPublishers_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineImageListPublishersMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineImages() + .listPublishersWithResponse("aaaaaaaaaaaaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListPublishers_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineImage_ListPublishers_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineImageListPublishersMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachineImages().listPublishersWithResponse("aaaaa", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineImages_ListSkus + +```java +/** Samples for VirtualMachineImages ListSkus. */ +public final class VirtualMachineImagesListSkusSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListSkus_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineImage_ListSkus_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineImageListSkusMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineImages() + .listSkusWithResponse("aaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListSkus_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineImage_ListSkus_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineImageListSkusMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineImages() + .listSkusWithResponse("aaaa", "aaaaaaaaaaaaa", "aaaaaaa", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineImagesEdgeZone_Get + +```java +/** Samples for VirtualMachineImagesEdgeZone Get. */ +public final class VirtualMachineImagesEdgeZoneGetSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_Get_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineImagesEdgeZone_Get_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineImagesEdgeZoneGetMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineImagesEdgeZones() + .getWithResponse( + "aaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaa", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_Get_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineImagesEdgeZone_Get_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineImagesEdgeZoneGetMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineImagesEdgeZones() + .getWithResponse( + "aaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaa", + "aa", + com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineImagesEdgeZone_List + +```java +/** Samples for VirtualMachineImagesEdgeZone List. */ +public final class VirtualMachineImagesEdgeZoneListSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_List_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineImagesEdgeZone_List_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineImagesEdgeZoneListMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineImagesEdgeZones() + .listWithResponse( + "aaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaa", + 12, + "aaaaaaaaaaaaaaaaaaaaaaaaaaaa", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_List_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineImagesEdgeZone_List_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineImagesEdgeZoneListMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineImagesEdgeZones() + .listWithResponse( + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaa", + "aaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + null, + null, + null, + com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineImagesEdgeZone_ListOffers + +```java +/** Samples for VirtualMachineImagesEdgeZone ListOffers. */ +public final class VirtualMachineImagesEdgeZoneListOffersSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListOffers_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineImagesEdgeZone_ListOffers_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineImagesEdgeZoneListOffersMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineImagesEdgeZones() + .listOffersWithResponse( + "aaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListOffers_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineImagesEdgeZone_ListOffers_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineImagesEdgeZoneListOffersMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineImagesEdgeZones() + .listOffersWithResponse( + "aaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaa", + com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineImagesEdgeZone_ListPublishers + +```java +/** Samples for VirtualMachineImagesEdgeZone ListPublishers. */ +public final class VirtualMachineImagesEdgeZoneListPublishersSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListPublishers_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineImagesEdgeZone_ListPublishers_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineImagesEdgeZoneListPublishersMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineImagesEdgeZones() + .listPublishersWithResponse("aaaa", "aaaaaaaaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListPublishers_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineImagesEdgeZone_ListPublishers_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineImagesEdgeZoneListPublishersMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineImagesEdgeZones() + .listPublishersWithResponse("aaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineImagesEdgeZone_ListSkus + +```java +/** Samples for VirtualMachineImagesEdgeZone ListSkus. */ +public final class VirtualMachineImagesEdgeZoneListSkusSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListSkus_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineImagesEdgeZone_ListSkus_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineImagesEdgeZoneListSkusMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineImagesEdgeZones() + .listSkusWithResponse( + "aaaaaaaaaaaa", "aaaaa", "aaaaaaaaaaaa", "aaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListSkus_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineImagesEdgeZone_ListSkus_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineImagesEdgeZoneListSkusMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineImagesEdgeZones() + .listSkusWithResponse( + "aaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaa", + "aaaaaaaaaaaa", + com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineRunCommands_CreateOrUpdate + +```java +import com.azure.resourcemanager.compute.generated.models.RunCommandInputParameter; +import com.azure.resourcemanager.compute.generated.models.RunCommandManagedIdentity; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineRunCommandScriptSource; +import java.util.Arrays; + +/** Samples for VirtualMachineRunCommands CreateOrUpdate. */ +public final class VirtualMachineRunCommandsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/runCommandExamples/VirtualMachineRunCommand_CreateOrUpdate.json + */ + /** + * Sample code: Create or update a run command. + * + * @param manager Entry point to ComputeManager. + */ + public static void createOrUpdateARunCommand(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineRunCommands() + .define("myRunCommand") + .withRegion("West US") + .withExistingVirtualMachine("myResourceGroup", "myVM") + .withSource( + new VirtualMachineRunCommandScriptSource() + .withScriptUri( + "https://mystorageaccount.blob.core.windows.net/scriptcontainer/MyScript.ps1?sp=r&st=2022-10-07T19:52:54Z&se=2022-10-08T03:52:54Z&spr=https&sv=2021-06-08&sr=b&sig=zfYFYCgea1PqVERZuwJiewrte5gjTnKGtVJngcw5oc828%3D")) + .withParameters( + Arrays + .asList( + new RunCommandInputParameter().withName("param1").withValue("value1"), + new RunCommandInputParameter().withName("param2").withValue("value2"))) + .withAsyncExecution(false) + .withRunAsUser("user1") + .withRunAsPassword("") + .withTimeoutInSeconds(3600) + .withOutputBlobUri( + "https://mystorageaccount.blob.core.windows.net/myscriptoutputcontainer/MyScriptoutput.txt") + .withErrorBlobUri( + "https://mystorageaccount.blob.core.windows.net/mycontainer/MyScriptError.txt?sp=racw&st=2022-10-07T19:40:21Z&se=2022-10-08T03:40:21Z&spr=https&sv=2021-06-08&sr=b&sig=Yh7B%2Fy83olbYBdfsfbUREvd7ol8Dq5EVP3lAO4Kj4xDcN8%3D") + .withOutputBlobManagedIdentity( + new RunCommandManagedIdentity().withClientId("22d35efb-0c99-4041-8c5b-6d24db33a69a")) + .withTreatFailureAsDeploymentFailure(false) + .create(); + } +} +``` + +### VirtualMachineRunCommands_Delete + +```java +/** Samples for VirtualMachineRunCommands Delete. */ +public final class VirtualMachineRunCommandsDeleteSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/runCommandExamples/VirtualMachineRunCommand_Delete.json + */ + /** + * Sample code: Delete a run command. + * + * @param manager Entry point to ComputeManager. + */ + public static void deleteARunCommand(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineRunCommands() + .delete("myResourceGroup", "myVM", "myRunCommand", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineRunCommands_Get + +```java +/** Samples for VirtualMachineRunCommands Get. */ +public final class VirtualMachineRunCommandsGetSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/runCommandExamples/RunCommand_Get.json + */ + /** + * Sample code: VirtualMachineRunCommandGet. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineRunCommandGet(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineRunCommands() + .getWithResponse("SoutheastAsia", "RunPowerShellScript", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineRunCommands_GetByVirtualMachine + +```java +/** Samples for VirtualMachineRunCommands GetByVirtualMachine. */ +public final class VirtualMachineRunCommandsGetByVirtualMachineSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/runCommandExamples/VirtualMachineRunCommand_Get.json + */ + /** + * Sample code: Get a run command. + * + * @param manager Entry point to ComputeManager. + */ + public static void getARunCommand(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineRunCommands() + .getByVirtualMachineWithResponse( + "myResourceGroup", "myVM", "myRunCommand", null, com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineRunCommands_List + +```java +/** Samples for VirtualMachineRunCommands List. */ +public final class VirtualMachineRunCommandsListSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/runCommandExamples/RunCommand_List.json + */ + /** + * Sample code: VirtualMachineRunCommandList. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineRunCommandList( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachineRunCommands().list("SoutheastAsia", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineRunCommands_ListByVirtualMachine + +```java +/** Samples for VirtualMachineRunCommands ListByVirtualMachine. */ +public final class VirtualMachineRunCommandsListByVirtualMachineSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/runCommandExamples/VirtualMachineRunCommand_List.json + */ + /** + * Sample code: List run commands in a Virtual Machine. + * + * @param manager Entry point to ComputeManager. + */ + public static void listRunCommandsInAVirtualMachine( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineRunCommands() + .listByVirtualMachine("myResourceGroup", "myVM", null, com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineRunCommands_Update + +```java +import com.azure.resourcemanager.compute.generated.models.RunCommandInputParameter; +import com.azure.resourcemanager.compute.generated.models.RunCommandManagedIdentity; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineRunCommand; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineRunCommandScriptSource; +import java.util.Arrays; + +/** Samples for VirtualMachineRunCommands Update. */ +public final class VirtualMachineRunCommandsUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/runCommandExamples/VirtualMachineRunCommand_Update.json + */ + /** + * Sample code: Update a run command. + * + * @param manager Entry point to ComputeManager. + */ + public static void updateARunCommand(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + VirtualMachineRunCommand resource = + manager + .virtualMachineRunCommands() + .getByVirtualMachineWithResponse( + "myResourceGroup", "myVM", "myRunCommand", null, com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withSource( + new VirtualMachineRunCommandScriptSource() + .withScript("Write-Host Hello World! ; Remove-Item C:\test\testFile.txt")) + .withParameters( + Arrays + .asList( + new RunCommandInputParameter().withName("param1").withValue("value1"), + new RunCommandInputParameter().withName("param2").withValue("value2"))) + .withAsyncExecution(false) + .withRunAsUser("user1") + .withRunAsPassword("") + .withTimeoutInSeconds(3600) + .withOutputBlobUri( + "https://mystorageaccount.blob.core.windows.net/myscriptoutputcontainer/MyScriptoutput.txt?sp=racw&st=2022-10-07T19:40:21Z&se=2022-10-08T03:40:21Z&spr=https&sv=2021-06-08&sr=b&sig=Yh7B%2Fy83olbYBdfsfbUREvd7ol8Dq5EVP3lAO4Kj4xDcN8%3D") + .withErrorBlobUri("https://mystorageaccount.blob.core.windows.net/mycontainer/MyScriptError.txt") + .withErrorBlobManagedIdentity( + new RunCommandManagedIdentity().withObjectId("4231e4d2-33e4-4e23-96b2-17888afa6072")) + .apply(); + } +} +``` + +### VirtualMachineScaleSetExtensions_CreateOrUpdate + +```java +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import java.io.IOException; +import java.util.Arrays; + +/** Samples for VirtualMachineScaleSetExtensions CreateOrUpdate. */ +public final class VirtualMachineScaleSetExtensionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_CreateOrUpdate_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetExtension_CreateOrUpdate_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetExtensionCreateOrUpdateMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) throws IOException { + manager + .virtualMachineScaleSetExtensions() + .define("aaaaaaaaaaaaaaaaaaaaa") + .withExistingVirtualMachineScaleSet("rgcompute", "aaaaaaa") + .withName("{extension-name}") + .withForceUpdateTag("aaaaaaaaa") + .withPublisher("{extension-Publisher}") + .withTypePropertiesType("{extension-Type}") + .withTypeHandlerVersion("{handler-version}") + .withAutoUpgradeMinorVersion(true) + .withEnableAutomaticUpgrade(true) + .withSettings( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .withProtectedSettings( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .withProvisionAfterExtensions(Arrays.asList("aa")) + .withSuppressFailures(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_CreateOrUpdate_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetExtension_CreateOrUpdate_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetExtensionCreateOrUpdateMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetExtensions() + .define("aaaaaaaaaaa") + .withExistingVirtualMachineScaleSet("rgcompute", "aaaaaaaaaaa") + .create(); + } +} +``` + +### VirtualMachineScaleSetExtensions_Delete + +```java +/** Samples for VirtualMachineScaleSetExtensions Delete. */ +public final class VirtualMachineScaleSetExtensionsDeleteSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Delete_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetExtension_Delete_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetExtensionDeleteMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetExtensions() + .delete("rgcompute", "aaaa", "aaaaaaaaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetExtension_Delete_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetExtensionDeleteMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetExtensions() + .delete( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaa", + com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineScaleSetExtensions_Get + +```java +/** Samples for VirtualMachineScaleSetExtensions Get. */ +public final class VirtualMachineScaleSetExtensionsGetSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Get_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetExtension_Get_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetExtensionGetMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetExtensions() + .getWithResponse( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaa", + "aaaaaaa", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Get_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetExtension_Get_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetExtensionGetMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetExtensions() + .getWithResponse( + "rgcompute", "a", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", null, com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineScaleSetExtensions_List + +```java +/** Samples for VirtualMachineScaleSetExtensions List. */ +public final class VirtualMachineScaleSetExtensionsListSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_List_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetExtension_List_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetExtensionListMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetExtensions() + .list("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_List_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetExtension_List_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetExtensionListMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetExtensions() + .list("rgcompute", "aaaaaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineScaleSetExtensions_Update + +```java +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetExtension; +import java.io.IOException; +import java.util.Arrays; + +/** Samples for VirtualMachineScaleSetExtensions Update. */ +public final class VirtualMachineScaleSetExtensionsUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Update_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetExtension_Update_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetExtensionUpdateMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + VirtualMachineScaleSetExtension resource = + manager + .virtualMachineScaleSetExtensions() + .getWithResponse( + "rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaa", "aa", null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update().apply(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Update_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetExtension_Update_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetExtensionUpdateMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) throws IOException { + VirtualMachineScaleSetExtension resource = + manager + .virtualMachineScaleSetExtensions() + .getWithResponse( + "rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaa", null, com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withForceUpdateTag("aaaaaaaaa") + .withPublisher("{extension-Publisher}") + .withTypePropertiesType("{extension-Type}") + .withTypeHandlerVersion("{handler-version}") + .withAutoUpgradeMinorVersion(true) + .withEnableAutomaticUpgrade(true) + .withSettings( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .withProtectedSettings( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .withProvisionAfterExtensions(Arrays.asList("aa")) + .withSuppressFailures(true) + .apply(); + } +} +``` + +### VirtualMachineScaleSetRollingUpgrades_Cancel + +```java +/** Samples for VirtualMachineScaleSetRollingUpgrades Cancel. */ +public final class VirtualMachineScaleSetRollingUpgradesCancelSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_Cancel_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetRollingUpgrade_Cancel_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetRollingUpgradeCancelMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachineScaleSetRollingUpgrades().cancel("rgcompute", "aaaaaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_Cancel_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetRollingUpgrade_Cancel_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetRollingUpgradeCancelMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachineScaleSetRollingUpgrades().cancel("rgcompute", "aaaaa", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineScaleSetRollingUpgrades_GetLatest + +```java +/** Samples for VirtualMachineScaleSetRollingUpgrades GetLatest. */ +public final class VirtualMachineScaleSetRollingUpgradesGetLatestSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_GetLatest_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetRollingUpgrade_GetLatest_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetRollingUpgradeGetLatestMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetRollingUpgrades() + .getLatestWithResponse("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_GetLatest_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetRollingUpgrade_GetLatest_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetRollingUpgradeGetLatestMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetRollingUpgrades() + .getLatestWithResponse("rgcompute", "aaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineScaleSetRollingUpgrades_StartExtensionUpgrade + +```java +/** Samples for VirtualMachineScaleSetRollingUpgrades StartExtensionUpgrade. */ +public final class VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_RollingUpgrade.json + */ + /** + * Sample code: Start an extension rolling upgrade. + * + * @param manager Entry point to ComputeManager. + */ + public static void startAnExtensionRollingUpgrade( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetRollingUpgrades() + .startExtensionUpgrade("myResourceGroup", "{vmss-name}", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineScaleSetRollingUpgrades_StartOSUpgrade + +```java +/** Samples for VirtualMachineScaleSetRollingUpgrades StartOSUpgrade. */ +public final class VirtualMachineScaleSetRollingUpgradesStartOSUpgradeSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_StartOSUpgrade_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetRollingUpgrade_StartOSUpgrade_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetRollingUpgradeStartOSUpgradeMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetRollingUpgrades() + .startOSUpgrade("rgcompute", "aaaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_StartOSUpgrade_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetRollingUpgrade_StartOSUpgrade_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetRollingUpgradeStartOSUpgradeMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetRollingUpgrades() + .startOSUpgrade("rgcompute", "aaaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineScaleSetVMExtensions_CreateOrUpdate + +```java +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import java.io.IOException; + +/** Samples for VirtualMachineScaleSetVMExtensions CreateOrUpdate. */ +public final class VirtualMachineScaleSetVMExtensionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Create.json + */ + /** + * Sample code: Create VirtualMachineScaleSet VM extension. + * + * @param manager Entry point to ComputeManager. + */ + public static void createVirtualMachineScaleSetVMExtension( + com.azure.resourcemanager.compute.generated.ComputeManager manager) throws IOException { + manager + .virtualMachineScaleSetVMExtensions() + .define("myVMExtension") + .withExistingVirtualMachine("myResourceGroup", "myvmScaleSet", "0") + .withPublisher("extPublisher") + .withTypePropertiesType("extType") + .withTypeHandlerVersion("1.2") + .withAutoUpgradeMinorVersion(true) + .withSettings( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{\"UserName\":\"xyz@microsoft.com\"}", Object.class, SerializerEncoding.JSON)) + .create(); + } +} +``` + +### VirtualMachineScaleSetVMExtensions_Delete + +```java +/** Samples for VirtualMachineScaleSetVMExtensions Delete. */ +public final class VirtualMachineScaleSetVMExtensionsDeleteSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Delete.json + */ + /** + * Sample code: Delete VirtualMachineScaleSet VM extension. + * + * @param manager Entry point to ComputeManager. + */ + public static void deleteVirtualMachineScaleSetVMExtension( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetVMExtensions() + .delete("myResourceGroup", "myvmScaleSet", "0", "myVMExtension", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineScaleSetVMExtensions_Get + +```java +/** Samples for VirtualMachineScaleSetVMExtensions Get. */ +public final class VirtualMachineScaleSetVMExtensionsGetSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Get.json + */ + /** + * Sample code: Get VirtualMachineScaleSet VM extension. + * + * @param manager Entry point to ComputeManager. + */ + public static void getVirtualMachineScaleSetVMExtension( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetVMExtensions() + .getWithResponse( + "myResourceGroup", "myvmScaleSet", "0", "myVMExtension", null, com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineScaleSetVMExtensions_List + +```java +/** Samples for VirtualMachineScaleSetVMExtensions List. */ +public final class VirtualMachineScaleSetVMExtensionsListSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_List.json + */ + /** + * Sample code: List extensions in Vmss instance. + * + * @param manager Entry point to ComputeManager. + */ + public static void listExtensionsInVmssInstance( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetVMExtensions() + .listWithResponse("myResourceGroup", "myvmScaleSet", "0", null, com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineScaleSetVMExtensions_Update + +```java +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMExtension; +import java.io.IOException; + +/** Samples for VirtualMachineScaleSetVMExtensions Update. */ +public final class VirtualMachineScaleSetVMExtensionsUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Update.json + */ + /** + * Sample code: Update VirtualMachineScaleSet VM extension. + * + * @param manager Entry point to ComputeManager. + */ + public static void updateVirtualMachineScaleSetVMExtension( + com.azure.resourcemanager.compute.generated.ComputeManager manager) throws IOException { + VirtualMachineScaleSetVMExtension resource = + manager + .virtualMachineScaleSetVMExtensions() + .getWithResponse( + "myResourceGroup", "myvmScaleSet", "0", "myVMExtension", null, com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withPublisher("extPublisher") + .withTypePropertiesType("extType") + .withTypeHandlerVersion("1.2") + .withAutoUpgradeMinorVersion(true) + .withSettings( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{\"UserName\":\"xyz@microsoft.com\"}", Object.class, SerializerEncoding.JSON)) + .apply(); + } +} +``` + +### VirtualMachineScaleSetVMRunCommands_CreateOrUpdate + +```java +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineRunCommandInner; +import com.azure.resourcemanager.compute.generated.models.RunCommandInputParameter; +import com.azure.resourcemanager.compute.generated.models.RunCommandManagedIdentity; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineRunCommandScriptSource; +import java.util.Arrays; + +/** Samples for VirtualMachineScaleSetVMRunCommands CreateOrUpdate. */ +public final class VirtualMachineScaleSetVMRunCommandsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_CreateOrUpdate.json + */ + /** + * Sample code: Create VirtualMachineScaleSet VM run command. + * + * @param manager Entry point to ComputeManager. + */ + public static void createVirtualMachineScaleSetVMRunCommand( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetVMRunCommands() + .createOrUpdate( + "myResourceGroup", + "myvmScaleSet", + "0", + "myRunCommand", + new VirtualMachineRunCommandInner() + .withLocation("West US") + .withSource( + new VirtualMachineRunCommandScriptSource() + .withScriptUri( + "https://mystorageaccount.blob.core.windows.net/scriptcontainer/MyScript.ps1") + .withScriptUriManagedIdentity( + new RunCommandManagedIdentity().withObjectId("4231e4d2-33e4-4e23-96b2-17888afa6072"))) + .withParameters( + Arrays + .asList( + new RunCommandInputParameter().withName("param1").withValue("value1"), + new RunCommandInputParameter().withName("param2").withValue("value2"))) + .withAsyncExecution(false) + .withRunAsUser("user1") + .withRunAsPassword("fakeTokenPlaceholder") + .withTimeoutInSeconds(3600) + .withOutputBlobUri( + "https://mystorageaccount.blob.core.windows.net/myscriptoutputcontainer/MyScriptoutput.txt") + .withErrorBlobUri("https://mystorageaccount.blob.core.windows.net/mycontainer/MyScriptError.txt") + .withOutputBlobManagedIdentity( + new RunCommandManagedIdentity().withClientId("22d35efb-0c99-4041-8c5b-6d24db33a69a")) + .withErrorBlobManagedIdentity(new RunCommandManagedIdentity()) + .withTreatFailureAsDeploymentFailure(true), + com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineScaleSetVMRunCommands_Delete + +```java +/** Samples for VirtualMachineScaleSetVMRunCommands Delete. */ +public final class VirtualMachineScaleSetVMRunCommandsDeleteSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_Delete.json + */ + /** + * Sample code: Delete VirtualMachineScaleSet VM run command. + * + * @param manager Entry point to ComputeManager. + */ + public static void deleteVirtualMachineScaleSetVMRunCommand( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetVMRunCommands() + .delete("myResourceGroup", "myvmScaleSet", "0", "myRunCommand", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineScaleSetVMRunCommands_Get + +```java +/** Samples for VirtualMachineScaleSetVMRunCommands Get. */ +public final class VirtualMachineScaleSetVMRunCommandsGetSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_Get.json + */ + /** + * Sample code: Get VirtualMachineScaleSet VM run commands. + * + * @param manager Entry point to ComputeManager. + */ + public static void getVirtualMachineScaleSetVMRunCommands( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetVMRunCommands() + .getWithResponse( + "myResourceGroup", "myvmScaleSet", "0", "myRunCommand", null, com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineScaleSetVMRunCommands_List + +```java +/** Samples for VirtualMachineScaleSetVMRunCommands List. */ +public final class VirtualMachineScaleSetVMRunCommandsListSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_List.json + */ + /** + * Sample code: List run commands in Vmss instance. + * + * @param manager Entry point to ComputeManager. + */ + public static void listRunCommandsInVmssInstance( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetVMRunCommands() + .list("myResourceGroup", "myvmScaleSet", "0", null, com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineScaleSetVMRunCommands_Update + +```java +import com.azure.resourcemanager.compute.generated.models.RunCommandManagedIdentity; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineRunCommandScriptSource; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineRunCommandUpdate; + +/** Samples for VirtualMachineScaleSetVMRunCommands Update. */ +public final class VirtualMachineScaleSetVMRunCommandsUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_Update.json + */ + /** + * Sample code: Update VirtualMachineScaleSet VM run command. + * + * @param manager Entry point to ComputeManager. + */ + public static void updateVirtualMachineScaleSetVMRunCommand( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetVMRunCommands() + .update( + "myResourceGroup", + "myvmScaleSet", + "0", + "myRunCommand", + new VirtualMachineRunCommandUpdate() + .withSource( + new VirtualMachineRunCommandScriptSource() + .withScriptUri( + "https://mystorageaccount.blob.core.windows.net/scriptcontainer/MyScript.ps1") + .withScriptUriManagedIdentity( + new RunCommandManagedIdentity().withObjectId("4231e4d2-33e4-4e23-96b2-17888afa6072"))), + com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineScaleSetVMs_Deallocate + +```java +/** Samples for VirtualMachineScaleSetVMs Deallocate. */ +public final class VirtualMachineScaleSetVMsDeallocateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Deallocate_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetVM_Deallocate_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetVMDeallocateMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetVMs() + .deallocate("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Deallocate_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetVM_Deallocate_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetVMDeallocateMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetVMs() + .deallocate( + "rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineScaleSetVMs_Delete + +```java +/** Samples for VirtualMachineScaleSetVMs Delete. */ +public final class VirtualMachineScaleSetVMsDeleteSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Delete_Force.json + */ + /** + * Sample code: Force Delete a virtual machine from a VM scale set. + * + * @param manager Entry point to ComputeManager. + */ + public static void forceDeleteAVirtualMachineFromAVMScaleSet( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetVMs() + .delete("myResourceGroup", "myvmScaleSet", "0", true, com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineScaleSetVMs_Get + +```java +/** Samples for VirtualMachineScaleSetVMs Get. */ +public final class VirtualMachineScaleSetVMsGetSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_WithVMSizeProperties.json + */ + /** + * Sample code: Get VM scale set VM with VMSizeProperties. + * + * @param manager Entry point to ComputeManager. + */ + public static void getVMScaleSetVMWithVMSizeProperties( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetVMs() + .getWithResponse("myResourceGroup", "{vmss-name}", "0", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_WithUserData.json + */ + /** + * Sample code: Get VM scale set VM with UserData. + * + * @param manager Entry point to ComputeManager. + */ + public static void getVMScaleSetVMWithUserData(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetVMs() + .getWithResponse("myResourceGroup", "{vmss-name}", "0", null, com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineScaleSetVMs_GetInstanceView + +```java +/** Samples for VirtualMachineScaleSetVMs GetInstanceView. */ +public final class VirtualMachineScaleSetVMsGetInstanceViewSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_InstanceViewAutoPlacedOnDedicatedHostGroup.json + */ + /** + * Sample code: Get instance view of a virtual machine from a VM scale set placed on a dedicated host group through + * automatic placement. + * + * @param manager Entry point to ComputeManager. + */ + public static void + getInstanceViewOfAVirtualMachineFromAVMScaleSetPlacedOnADedicatedHostGroupThroughAutomaticPlacement( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetVMs() + .getInstanceViewWithResponse( + "myResourceGroup", "myVirtualMachineScaleSet", "0", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineScaleSetVMs_List + +```java +/** Samples for VirtualMachineScaleSetVMs List. */ +public final class VirtualMachineScaleSetVMsListSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_List_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetVM_List_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetVMListMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetVMs() + .list("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaaa", null, null, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_List_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetVM_List_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetVMListMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetVMs() + .list( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaa", + com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineScaleSetVMs_PerformMaintenance + +```java +/** Samples for VirtualMachineScaleSetVMs PerformMaintenance. */ +public final class VirtualMachineScaleSetVMsPerformMaintenanceSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_PerformMaintenance_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetVM_PerformMaintenance_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetVMPerformMaintenanceMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetVMs() + .performMaintenance("rgcompute", "aaaaaaaaaaaaaa", "aaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_PerformMaintenance_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetVM_PerformMaintenance_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetVMPerformMaintenanceMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetVMs() + .performMaintenance("rgcompute", "aaaaaaaaaa", "aaaa", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineScaleSetVMs_PowerOff + +```java +/** Samples for VirtualMachineScaleSetVMs PowerOff. */ +public final class VirtualMachineScaleSetVMsPowerOffSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_PowerOff_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetVM_PowerOff_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetVMPowerOffMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetVMs() + .powerOff("rgcompute", "aaaaaa", "aaaaaaaaa", true, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_PowerOff_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetVM_PowerOff_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetVMPowerOffMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetVMs() + .powerOff( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaa", + null, + com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineScaleSetVMs_Redeploy + +```java +/** Samples for VirtualMachineScaleSetVMs Redeploy. */ +public final class VirtualMachineScaleSetVMsRedeploySamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Redeploy_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetVM_Redeploy_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetVMRedeployMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetVMs() + .redeploy( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Redeploy_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetVM_Redeploy_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetVMRedeployMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetVMs() + .redeploy("rgcompute", "aaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineScaleSetVMs_Reimage + +```java +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMReimageParameters; + +/** Samples for VirtualMachineScaleSetVMs Reimage. */ +public final class VirtualMachineScaleSetVMsReimageSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Reimage_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetVM_Reimage_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetVMReimageMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetVMs() + .reimage( + "rgcompute", + "aaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + new VirtualMachineScaleSetVMReimageParameters().withTempDisk(true), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Reimage_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetVM_Reimage_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetVMReimageMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetVMs() + .reimage("rgcompute", "aaaaaaa", "aaaaaaaaaaaaa", null, com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineScaleSetVMs_ReimageAll + +```java +/** Samples for VirtualMachineScaleSetVMs ReimageAll. */ +public final class VirtualMachineScaleSetVMsReimageAllSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_ReimageAll_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetVM_ReimageAll_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetVMReimageAllMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetVMs() + .reimageAll( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaa", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_ReimageAll_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetVM_ReimageAll_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetVMReimageAllMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetVMs() + .reimageAll( + "rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineScaleSetVMs_Restart + +```java +/** Samples for VirtualMachineScaleSetVMs Restart. */ +public final class VirtualMachineScaleSetVMsRestartSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Restart_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetVM_Restart_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetVMRestartMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetVMs() + .restart("rgcompute", "aaaaaaaaaaaa", "aaaaaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Restart_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetVM_Restart_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetVMRestartMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetVMs() + .restart("rgcompute", "aa", "aaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineScaleSetVMs_RetrieveBootDiagnosticsData + +```java +/** Samples for VirtualMachineScaleSetVMs RetrieveBootDiagnosticsData. */ +public final class VirtualMachineScaleSetVMsRetrieveBootDiagnosticsDataSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_RetrieveBootDiagnosticsData.json + */ + /** + * Sample code: RetrieveBootDiagnosticsData of a virtual machine. + * + * @param manager Entry point to ComputeManager. + */ + public static void retrieveBootDiagnosticsDataOfAVirtualMachine( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetVMs() + .retrieveBootDiagnosticsDataWithResponse( + "ResourceGroup", "myvmScaleSet", "0", 60, com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineScaleSetVMs_RunCommand + +```java +import com.azure.resourcemanager.compute.generated.models.RunCommandInput; +import java.util.Arrays; + +/** Samples for VirtualMachineScaleSetVMs RunCommand. */ +public final class VirtualMachineScaleSetVMsRunCommandSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand.json + */ + /** + * Sample code: VirtualMachineScaleSetVMs_RunCommand. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetVMsRunCommand( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetVMs() + .runCommand( + "myResourceGroup", + "myVirtualMachineScaleSet", + "0", + new RunCommandInput() + .withCommandId("RunPowerShellScript") + .withScript(Arrays.asList("Write-Host Hello World!")), + com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineScaleSetVMs_SimulateEviction + +```java +/** Samples for VirtualMachineScaleSetVMs SimulateEviction. */ +public final class VirtualMachineScaleSetVMsSimulateEvictionSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_SimulateEviction.json + */ + /** + * Sample code: Simulate Eviction a virtual machine. + * + * @param manager Entry point to ComputeManager. + */ + public static void simulateEvictionAVirtualMachine( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetVMs() + .simulateEvictionWithResponse( + "ResourceGroup", "VmScaleSetName", "InstanceId", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineScaleSetVMs_Start + +```java +/** Samples for VirtualMachineScaleSetVMs Start. */ +public final class VirtualMachineScaleSetVMsStartSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Start_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetVM_Start_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetVMStartMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetVMs() + .start("rgcompute", "aaaaaaaaaaaaaa", "aaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Start_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetVM_Start_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetVMStartMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetVMs() + .start("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineScaleSetVMs_Update + +```java +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetVMInner; +import com.azure.resourcemanager.compute.generated.models.AdditionalCapabilities; +import com.azure.resourcemanager.compute.generated.models.AdditionalUnattendContent; +import com.azure.resourcemanager.compute.generated.models.ApiEntityReference; +import com.azure.resourcemanager.compute.generated.models.BootDiagnostics; +import com.azure.resourcemanager.compute.generated.models.CachingTypes; +import com.azure.resourcemanager.compute.generated.models.ComponentNames; +import com.azure.resourcemanager.compute.generated.models.DataDisk; +import com.azure.resourcemanager.compute.generated.models.DeleteOptions; +import com.azure.resourcemanager.compute.generated.models.DiagnosticsProfile; +import com.azure.resourcemanager.compute.generated.models.DiffDiskOptions; +import com.azure.resourcemanager.compute.generated.models.DiffDiskPlacement; +import com.azure.resourcemanager.compute.generated.models.DiffDiskSettings; +import com.azure.resourcemanager.compute.generated.models.DiskCreateOptionTypes; +import com.azure.resourcemanager.compute.generated.models.DiskDeleteOptionTypes; +import com.azure.resourcemanager.compute.generated.models.DiskDetachOptionTypes; +import com.azure.resourcemanager.compute.generated.models.DiskEncryptionSetParameters; +import com.azure.resourcemanager.compute.generated.models.DiskEncryptionSettings; +import com.azure.resourcemanager.compute.generated.models.HardwareProfile; +import com.azure.resourcemanager.compute.generated.models.ImageReference; +import com.azure.resourcemanager.compute.generated.models.IpVersion; +import com.azure.resourcemanager.compute.generated.models.IpVersions; +import com.azure.resourcemanager.compute.generated.models.KeyVaultKeyReference; +import com.azure.resourcemanager.compute.generated.models.KeyVaultSecretReference; +import com.azure.resourcemanager.compute.generated.models.LinuxConfiguration; +import com.azure.resourcemanager.compute.generated.models.LinuxPatchAssessmentMode; +import com.azure.resourcemanager.compute.generated.models.LinuxPatchSettings; +import com.azure.resourcemanager.compute.generated.models.LinuxVMGuestPatchMode; +import com.azure.resourcemanager.compute.generated.models.ManagedDiskParameters; +import com.azure.resourcemanager.compute.generated.models.NetworkApiVersion; +import com.azure.resourcemanager.compute.generated.models.NetworkInterfaceReference; +import com.azure.resourcemanager.compute.generated.models.NetworkProfile; +import com.azure.resourcemanager.compute.generated.models.OSDisk; +import com.azure.resourcemanager.compute.generated.models.OSProfile; +import com.azure.resourcemanager.compute.generated.models.OperatingSystemTypes; +import com.azure.resourcemanager.compute.generated.models.PassNames; +import com.azure.resourcemanager.compute.generated.models.PatchSettings; +import com.azure.resourcemanager.compute.generated.models.Plan; +import com.azure.resourcemanager.compute.generated.models.ProtocolTypes; +import com.azure.resourcemanager.compute.generated.models.PublicIpAddressSku; +import com.azure.resourcemanager.compute.generated.models.PublicIpAddressSkuName; +import com.azure.resourcemanager.compute.generated.models.PublicIpAddressSkuTier; +import com.azure.resourcemanager.compute.generated.models.PublicIpAllocationMethod; +import com.azure.resourcemanager.compute.generated.models.SecurityProfile; +import com.azure.resourcemanager.compute.generated.models.SecurityTypes; +import com.azure.resourcemanager.compute.generated.models.SettingNames; +import com.azure.resourcemanager.compute.generated.models.SshConfiguration; +import com.azure.resourcemanager.compute.generated.models.SshPublicKey; +import com.azure.resourcemanager.compute.generated.models.StorageAccountTypes; +import com.azure.resourcemanager.compute.generated.models.StorageProfile; +import com.azure.resourcemanager.compute.generated.models.UefiSettings; +import com.azure.resourcemanager.compute.generated.models.VMSizeProperties; +import com.azure.resourcemanager.compute.generated.models.VirtualHardDisk; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineIpTag; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineNetworkInterfaceConfiguration; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineNetworkInterfaceDnsSettingsConfiguration; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineNetworkInterfaceIpConfiguration; +import com.azure.resourcemanager.compute.generated.models.VirtualMachinePublicIpAddressConfiguration; +import com.azure.resourcemanager.compute.generated.models.VirtualMachinePublicIpAddressDnsSettingsConfiguration; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetIpConfiguration; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetIpTag; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetNetworkConfiguration; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetNetworkConfigurationDnsSettings; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetPublicIpAddressConfiguration; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMNetworkProfileConfiguration; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMProtectionPolicy; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineSizeTypes; +import com.azure.resourcemanager.compute.generated.models.WinRMConfiguration; +import com.azure.resourcemanager.compute.generated.models.WinRMListener; +import com.azure.resourcemanager.compute.generated.models.WindowsConfiguration; +import com.azure.resourcemanager.compute.generated.models.WindowsPatchAssessmentMode; +import com.azure.resourcemanager.compute.generated.models.WindowsVMGuestPatchMode; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for VirtualMachineScaleSetVMs Update. */ +public final class VirtualMachineScaleSetVMsUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Update_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetVM_Update_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetVMUpdateMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetVMs() + .update( + "rgcompute", + "aaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + new VirtualMachineScaleSetVMInner() + .withLocation("westus") + .withTags(mapOf()) + .withPlan( + new Plan() + .withName("aaaaaaaaaa") + .withPublisher("aaaaaaaaaaaaaaaaaaaaaa") + .withProduct("aaaaaaaaaaaaaaaaaaaa") + .withPromotionCode("fakeTokenPlaceholder")) + .withHardwareProfile( + new HardwareProfile() + .withVmSize(VirtualMachineSizeTypes.BASIC_A0) + .withVmSizeProperties(new VMSizeProperties().withVCpusAvailable(9).withVCpusPerCore(12))) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withId("a") + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2012-R2-Datacenter") + .withVersion("4.127.20180315") + .withSharedGalleryImageId("aaaaaaaaaaaaaaaaaaaa")) + .withOsDisk( + new OSDisk() + .withOsType(OperatingSystemTypes.WINDOWS) + .withEncryptionSettings( + new DiskEncryptionSettings() + .withDiskEncryptionKey( + new KeyVaultSecretReference() + .withSecretUrl("fakeTokenPlaceholder") + .withSourceVault( + new SubResource() + .withId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"))) + .withKeyEncryptionKey( + new KeyVaultKeyReference() + .withKeyUrl("fakeTokenPlaceholder") + .withSourceVault( + new SubResource() + .withId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"))) + .withEnabled(true)) + .withName("vmss3176_vmss3176_0_OsDisk_1_6d72b805e50e4de6830303c5055077fc") + .withVhd( + new VirtualHardDisk() + .withUri( + "https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd")) + .withImage( + new VirtualHardDisk() + .withUri( + "https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd")) + .withCaching(CachingTypes.NONE) + .withWriteAcceleratorEnabled(true) + .withDiffDiskSettings( + new DiffDiskSettings() + .withOption(DiffDiskOptions.LOCAL) + .withPlacement(DiffDiskPlacement.CACHE_DISK)) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withDiskSizeGB(127) + .withManagedDisk( + new ManagedDiskParameters() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_OsDisk_1_6d72b805e50e4de6830303c5055077fc") + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS) + .withDiskEncryptionSet( + new DiskEncryptionSetParameters().withId("aaaaaaaaaaaa"))) + .withDeleteOption(DiskDeleteOptionTypes.DELETE)) + .withDataDisks( + Arrays + .asList( + new DataDisk() + .withLun(1) + .withName("vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d") + .withVhd( + new VirtualHardDisk() + .withUri( + "https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd")) + .withImage( + new VirtualHardDisk() + .withUri( + "https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd")) + .withCaching(CachingTypes.NONE) + .withWriteAcceleratorEnabled(true) + .withCreateOption(DiskCreateOptionTypes.EMPTY) + .withDiskSizeGB(128) + .withManagedDisk( + new ManagedDiskParameters() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d") + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS) + .withDiskEncryptionSet( + new DiskEncryptionSetParameters().withId("aaaaaaaaaaaa"))) + .withToBeDetached(true) + .withDetachOption(DiskDetachOptionTypes.FORCE_DETACH) + .withDeleteOption(DiskDeleteOptionTypes.DELETE)))) + .withAdditionalCapabilities( + new AdditionalCapabilities().withUltraSsdEnabled(true).withHibernationEnabled(true)) + .withOsProfile( + new OSProfile() + .withComputerName("test000000") + .withAdminUsername("Foo12") + .withAdminPassword("fakeTokenPlaceholder") + .withCustomData("aaaa") + .withWindowsConfiguration( + new WindowsConfiguration() + .withProvisionVMAgent(true) + .withEnableAutomaticUpdates(true) + .withTimeZone("aaaaaaaaaaaaaaaaaaaaaaaaaaa") + .withAdditionalUnattendContent( + Arrays + .asList( + new AdditionalUnattendContent() + .withPassName(PassNames.OOBE_SYSTEM) + .withComponentName(ComponentNames.MICROSOFT_WINDOWS_SHELL_SETUP) + .withSettingName(SettingNames.AUTO_LOGON) + .withContent("aaaaaaaaaaaaaaaaaaaa"))) + .withPatchSettings( + new PatchSettings() + .withPatchMode(WindowsVMGuestPatchMode.MANUAL) + .withEnableHotpatching(true) + .withAssessmentMode(WindowsPatchAssessmentMode.IMAGE_DEFAULT)) + .withWinRM( + new WinRMConfiguration() + .withListeners( + Arrays + .asList( + new WinRMListener() + .withProtocol(ProtocolTypes.HTTP) + .withCertificateUrl("aaaaaaaaaaaaaaaaaaaaaa"))))) + .withLinuxConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSsh( + new SshConfiguration() + .withPublicKeys( + Arrays + .asList( + new SshPublicKey() + .withPath("aaa") + .withKeyData("fakeTokenPlaceholder")))) + .withProvisionVMAgent(true) + .withPatchSettings( + new LinuxPatchSettings() + .withPatchMode(LinuxVMGuestPatchMode.IMAGE_DEFAULT) + .withAssessmentMode(LinuxPatchAssessmentMode.IMAGE_DEFAULT))) + .withSecrets(Arrays.asList()) + .withAllowExtensionOperations(true) + .withRequireGuestProvisionSignal(true)) + .withSecurityProfile( + new SecurityProfile() + .withUefiSettings(new UefiSettings().withSecureBootEnabled(true).withVTpmEnabled(true)) + .withEncryptionAtHost(true) + .withSecurityType(SecurityTypes.TRUSTED_LAUNCH)) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}/virtualMachines/0/networkInterfaces/vmsstestnetconfig5415") + .withPrimary(true) + .withDeleteOption(DeleteOptions.DELETE))) + .withNetworkApiVersion(NetworkApiVersion.TWO_ZERO_TWO_ZERO_ONE_ONE_ZERO_ONE) + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineNetworkInterfaceConfiguration() + .withName("aaaaaaaaaaa") + .withPrimary(true) + .withDeleteOption(DeleteOptions.DELETE) + .withEnableAcceleratedNetworking(true) + .withEnableFpga(true) + .withEnableIpForwarding(true) + .withNetworkSecurityGroup( + new SubResource() + .withId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}")) + .withDnsSettings( + new VirtualMachineNetworkInterfaceDnsSettingsConfiguration() + .withDnsServers(Arrays.asList("aaaaaa"))) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineNetworkInterfaceIpConfiguration() + .withName("aa") + .withSubnet( + new SubResource() + .withId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}")) + .withPrimary(true) + .withPublicIpAddressConfiguration( + new VirtualMachinePublicIpAddressConfiguration() + .withName("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa") + .withSku( + new PublicIpAddressSku() + .withName(PublicIpAddressSkuName.BASIC) + .withTier(PublicIpAddressSkuTier.REGIONAL)) + .withIdleTimeoutInMinutes(2) + .withDeleteOption(DeleteOptions.DELETE) + .withDnsSettings( + new VirtualMachinePublicIpAddressDnsSettingsConfiguration() + .withDomainNameLabel( + "aaaaaaaaaaaaaaaaaaaaaaaaa")) + .withIpTags( + Arrays + .asList( + new VirtualMachineIpTag() + .withIpTagType( + "aaaaaaaaaaaaaaaaaaaaaaaaa") + .withTag("aaaaaaaaaaaaaaaaaaaa"))) + .withPublicIpPrefix( + new SubResource() + .withId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}")) + .withPublicIpAddressVersion(IpVersions.IPV4) + .withPublicIpAllocationMethod( + PublicIpAllocationMethod.DYNAMIC)) + .withPrivateIpAddressVersion(IpVersions.IPV4) + .withApplicationSecurityGroups( + Arrays + .asList( + new SubResource() + .withId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"))) + .withApplicationGatewayBackendAddressPools( + Arrays + .asList( + new SubResource() + .withId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"))) + .withLoadBalancerBackendAddressPools( + Arrays + .asList( + new SubResource() + .withId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"))))) + .withDscpConfiguration( + new SubResource() + .withId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"))))) + .withNetworkProfileConfiguration( + new VirtualMachineScaleSetVMNetworkProfileConfiguration() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("vmsstestnetconfig5415") + .withPrimary(true) + .withEnableAcceleratedNetworking(true) + .withEnableFpga(true) + .withNetworkSecurityGroup( + new SubResource() + .withId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}")) + .withDnsSettings( + new VirtualMachineScaleSetNetworkConfigurationDnsSettings() + .withDnsServers(Arrays.asList())) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("vmsstestnetconfig9693") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/vn4071/subnets/sn5503")) + .withPrimary(true) + .withPublicIpAddressConfiguration( + new VirtualMachineScaleSetPublicIpAddressConfiguration() + .withName("aaaaaaaaaaaaaaaaaa") + .withSku( + new PublicIpAddressSku() + .withName(PublicIpAddressSkuName.BASIC) + .withTier(PublicIpAddressSkuTier.REGIONAL)) + .withIdleTimeoutInMinutes(18) + .withDnsSettings( + new VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings() + .withDomainNameLabel("aaaaaaaaaaaaaaaaaa")) + .withIpTags( + Arrays + .asList( + new VirtualMachineScaleSetIpTag() + .withIpTagType("aaaaaaa") + .withTag( + "aaaaaaaaaaaaaaaaaaaaaaaaaaa"))) + .withPublicIpPrefix( + new SubResource() + .withId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}")) + .withPublicIpAddressVersion(IpVersion.IPV4) + .withDeleteOption(DeleteOptions.DELETE)) + .withPrivateIpAddressVersion(IpVersion.IPV4) + .withApplicationGatewayBackendAddressPools( + Arrays + .asList( + new SubResource() + .withId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"))) + .withApplicationSecurityGroups( + Arrays + .asList( + new SubResource() + .withId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"))) + .withLoadBalancerBackendAddressPools( + Arrays + .asList( + new SubResource() + .withId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"))) + .withLoadBalancerInboundNatPools( + Arrays + .asList( + new SubResource() + .withId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"))))) + .withEnableIpForwarding(true) + .withDeleteOption(DeleteOptions.DELETE)))) + .withDiagnosticsProfile( + new DiagnosticsProfile() + .withBootDiagnostics( + new BootDiagnostics().withEnabled(true).withStorageUri("aaaaaaaaaaaaa"))) + .withAvailabilitySet( + new SubResource() + .withId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}")) + .withLicenseType("aaaaaaaaaa") + .withProtectionPolicy( + new VirtualMachineScaleSetVMProtectionPolicy() + .withProtectFromScaleIn(true) + .withProtectFromScaleSetActions(true)) + .withUserData("RXhhbXBsZSBVc2VyRGF0YQ=="), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Update_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetVM_Update_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetVMUpdateMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetVMs() + .update( + "rgcompute", + "aaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaa", + new VirtualMachineScaleSetVMInner().withLocation("westus"), + com.azure.core.util.Context.NONE); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### VirtualMachineScaleSets_ConvertToSinglePlacementGroup + +```java +import com.azure.resourcemanager.compute.generated.models.VMScaleSetConvertToSinglePlacementGroupInput; + +/** Samples for VirtualMachineScaleSets ConvertToSinglePlacementGroup. */ +public final class VirtualMachineScaleSetsConvertToSinglePlacementGroupSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ConvertToSinglePlacementGroup_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_ConvertToSinglePlacementGroup_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetConvertToSinglePlacementGroupMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .convertToSinglePlacementGroupWithResponse( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + new VMScaleSetConvertToSinglePlacementGroupInput() + .withActivePlacementGroupId("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ConvertToSinglePlacementGroup_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_ConvertToSinglePlacementGroup_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetConvertToSinglePlacementGroupMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .convertToSinglePlacementGroupWithResponse( + "rgcompute", + "aaaaaaaaaaaaa", + new VMScaleSetConvertToSinglePlacementGroupInput(), + com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineScaleSets_CreateOrUpdate + +```java +import com.azure.core.management.SubResource; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetExtensionInner; +import com.azure.resourcemanager.compute.generated.models.ApiEntityReference; +import com.azure.resourcemanager.compute.generated.models.ApplicationProfile; +import com.azure.resourcemanager.compute.generated.models.AutomaticOSUpgradePolicy; +import com.azure.resourcemanager.compute.generated.models.AutomaticRepairsPolicy; +import com.azure.resourcemanager.compute.generated.models.BillingProfile; +import com.azure.resourcemanager.compute.generated.models.BootDiagnostics; +import com.azure.resourcemanager.compute.generated.models.CachingTypes; +import com.azure.resourcemanager.compute.generated.models.CapacityReservationProfile; +import com.azure.resourcemanager.compute.generated.models.DiagnosticsProfile; +import com.azure.resourcemanager.compute.generated.models.DiffDiskOptions; +import com.azure.resourcemanager.compute.generated.models.DiffDiskPlacement; +import com.azure.resourcemanager.compute.generated.models.DiffDiskSettings; +import com.azure.resourcemanager.compute.generated.models.DiskCreateOptionTypes; +import com.azure.resourcemanager.compute.generated.models.DiskEncryptionSetParameters; +import com.azure.resourcemanager.compute.generated.models.ImageReference; +import com.azure.resourcemanager.compute.generated.models.IpVersion; +import com.azure.resourcemanager.compute.generated.models.KeyVaultSecretReference; +import com.azure.resourcemanager.compute.generated.models.LinuxConfiguration; +import com.azure.resourcemanager.compute.generated.models.OSImageNotificationProfile; +import com.azure.resourcemanager.compute.generated.models.OrchestrationMode; +import com.azure.resourcemanager.compute.generated.models.Plan; +import com.azure.resourcemanager.compute.generated.models.PriorityMixPolicy; +import com.azure.resourcemanager.compute.generated.models.ScaleInPolicy; +import com.azure.resourcemanager.compute.generated.models.ScheduledEventsProfile; +import com.azure.resourcemanager.compute.generated.models.SecurityEncryptionTypes; +import com.azure.resourcemanager.compute.generated.models.SecurityPostureReference; +import com.azure.resourcemanager.compute.generated.models.SecurityProfile; +import com.azure.resourcemanager.compute.generated.models.SecurityTypes; +import com.azure.resourcemanager.compute.generated.models.ServiceArtifactReference; +import com.azure.resourcemanager.compute.generated.models.Sku; +import com.azure.resourcemanager.compute.generated.models.SpotRestorePolicy; +import com.azure.resourcemanager.compute.generated.models.SshConfiguration; +import com.azure.resourcemanager.compute.generated.models.SshPublicKey; +import com.azure.resourcemanager.compute.generated.models.StorageAccountTypes; +import com.azure.resourcemanager.compute.generated.models.TerminateNotificationProfile; +import com.azure.resourcemanager.compute.generated.models.UefiSettings; +import com.azure.resourcemanager.compute.generated.models.UpgradeMode; +import com.azure.resourcemanager.compute.generated.models.UpgradePolicy; +import com.azure.resourcemanager.compute.generated.models.VMDiskSecurityProfile; +import com.azure.resourcemanager.compute.generated.models.VMGalleryApplication; +import com.azure.resourcemanager.compute.generated.models.VMSizeProperties; +import com.azure.resourcemanager.compute.generated.models.VirtualHardDisk; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineEvictionPolicyTypes; +import com.azure.resourcemanager.compute.generated.models.VirtualMachinePriorityTypes; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetDataDisk; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetExtensionProfile; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetHardwareProfile; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetIpConfiguration; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetManagedDiskParameters; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetNetworkConfiguration; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetNetworkProfile; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetOSDisk; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetOSProfile; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetPublicIpAddressConfiguration; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetScaleInRules; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetStorageProfile; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMProfile; +import java.io.IOException; +import java.util.Arrays; + +/** Samples for VirtualMachineScaleSets CreateOrUpdate. */ +public final class VirtualMachineScaleSetsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithEmptyDataDisksOnEachVm.json + */ + /** + * Sample code: Create a scale set with empty data disks on each vm. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAScaleSetWithEmptyDataDisksOnEachVm( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_D2_v2").withTier("Standard").withCapacity(3L)) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withDiskSizeGB(512) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))) + .withDataDisks( + Arrays + .asList( + new VirtualMachineScaleSetDataDisk() + .withLun(0) + .withCreateOption(DiskCreateOptionTypes.EMPTY) + .withDiskSizeGB(1023), + new VirtualMachineScaleSetDataDisk() + .withLun(1) + .withCreateOption(DiskCreateOptionTypes.EMPTY) + .withDiskSizeGB(1023)))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true))))) + .withOverprovision(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithOSImageScheduledEventEnabled.json + */ + /** + * Sample code: Create a scale set with OS image scheduled events enabled. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAScaleSetWithOSImageScheduledEventsEnabled( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L)) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true)))) + .withScheduledEventsProfile( + new ScheduledEventsProfile() + .withOsImageNotificationProfile( + new OSImageNotificationProfile().withNotBeforeTimeout("PT15M").withEnable(true)))) + .withOverprovision(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithUserData.json + */ + /** + * Sample code: Create a scale set with userData. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAScaleSetWithUserData(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L)) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true)))) + .withUserData("RXhhbXBsZSBVc2VyRGF0YQ==")) + .withOverprovision(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromWithFpgaNetworkInterface.json + */ + /** + * Sample code: Create a scale set with Fpga Network Interfaces. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAScaleSetWithFpgaNetworkInterfaces( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L)) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true), + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{fpgaNic-Name}") + .withPrimary(false) + .withEnableAcceleratedNetworking(false) + .withEnableFpga(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{fpgaNic-Name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-fpga-subnet-name}")) + .withPrimary(true) + .withPrivateIpAddressVersion(IpVersion.IPV4))) + .withEnableIpForwarding(false))))) + .withOverprovision(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromACustomImage.json + */ + /** + * Sample code: Create a scale set from a custom image. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAScaleSetFromACustomImage( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L)) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true))))) + .withOverprovision(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_CreateA_WithDiffOsDiskUsingDiffDiskPlacement.json + */ + /** + * Sample code: Create a scale set with ephemeral os disks using placement property. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAScaleSetWithEphemeralOsDisksUsingPlacementProperty( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_DS1_v2").withTier("Standard").withCapacity(3L)) + .withPlan( + new Plan() + .withName("windows2016") + .withPublisher("microsoft-ads") + .withProduct("windows-data-science-vm")) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("microsoft-ads") + .withOffer("windows-data-science-vm") + .withSku("windows2016") + .withVersion("latest")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withCaching(CachingTypes.READ_ONLY) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withDiffDiskSettings( + new DiffDiskSettings() + .withOption(DiffDiskOptions.LOCAL) + .withPlacement(DiffDiskPlacement.RESOURCE_DISK)) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true))))) + .withOverprovision(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithScaleInPolicy.json + */ + /** + * Sample code: Create a scale set with scaleInPolicy. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAScaleSetWithScaleInPolicy( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L)) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true))))) + .withOverprovision(true) + .withScaleInPolicy( + new ScaleInPolicy() + .withRules(Arrays.asList(VirtualMachineScaleSetScaleInRules.OLDEST_VM)) + .withForceDeletion(true)) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithServiceArtifactReference.json + */ + /** + * Sample code: Create a scale set with Service Artifact Reference. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAScaleSetWithServiceArtifactReference( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("eastus2euap") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_A1").withTier("Standard").withCapacity(3L)) + .withUpgradePolicy( + new UpgradePolicy() + .withMode(UpgradeMode.AUTOMATIC) + .withAutomaticOSUpgradePolicy(new AutomaticOSUpgradePolicy().withEnableAutomaticOSUpgrade(true))) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2022-Datacenter") + .withVersion("latest")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withName("osDisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true)))) + .withServiceArtifactReference( + new ServiceArtifactReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName/serviceArtifacts/serviceArtifactName/vmArtifactsProfiles/vmArtifactsProfilesName"))) + .withOverprovision(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithEncryptionAtHost.json + */ + /** + * Sample code: Create a scale set with Host Encryption using encryptionAtHost property. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAScaleSetWithHostEncryptionUsingEncryptionAtHostProperty( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_DS1_v2").withTier("Standard").withCapacity(3L)) + .withPlan( + new Plan() + .withName("windows2016") + .withPublisher("microsoft-ads") + .withProduct("windows-data-science-vm")) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("microsoft-ads") + .withOffer("windows-data-science-vm") + .withSku("windows2016") + .withVersion("latest")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withCaching(CachingTypes.READ_ONLY) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true)))) + .withSecurityProfile(new SecurityProfile().withEncryptionAtHost(true))) + .withOverprovision(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithProtectedSettingsFromKeyVault.json + */ + /** + * Sample code: Create a VMSS with an extension with protectedSettingsFromKeyVault. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVMSSWithAnExtensionWithProtectedSettingsFromKeyVault( + com.azure.resourcemanager.compute.generated.ComputeManager manager) throws IOException { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L)) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true)))) + .withDiagnosticsProfile( + new DiagnosticsProfile() + .withBootDiagnostics( + new BootDiagnostics() + .withEnabled(true) + .withStorageUri("http://{existing-storage-account-name}.blob.core.windows.net"))) + .withExtensionProfile( + new VirtualMachineScaleSetExtensionProfile() + .withExtensions( + Arrays + .asList( + new VirtualMachineScaleSetExtensionInner() + .withName("{extension-name}") + .withPublisher("{extension-Publisher}") + .withTypePropertiesType("{extension-Type}") + .withTypeHandlerVersion("{handler-version}") + .withAutoUpgradeMinorVersion(false) + .withSettings( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .withProtectedSettingsFromKeyVault( + new KeyVaultSecretReference() + .withSecretUrl("fakeTokenPlaceholder") + .withSourceVault( + new SubResource() + .withId( + "/subscriptions/a53f7094-a16c-47af-abe4-b05c05d0d79a/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/kvName"))))))) + .withOverprovision(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithAzureLoadBalancer.json + */ + /** + * Sample code: Create a scale set with an azure load balancer. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAScaleSetWithAnAzureLoadBalancer( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L)) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")) + .withPublicIpAddressConfiguration( + new VirtualMachineScaleSetPublicIpAddressConfiguration() + .withName("{vmss-name}") + .withPublicIpAddressVersion(IpVersion.IPV4)) + .withLoadBalancerBackendAddressPools( + Arrays + .asList( + new SubResource() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/loadBalancers/{existing-load-balancer-name}/backendAddressPools/{existing-backend-address-pool-name}"))) + .withLoadBalancerInboundNatPools( + Arrays + .asList( + new SubResource() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/loadBalancers/{existing-load-balancer-name}/inboundNatPools/{existing-nat-pool-name}"))))) + .withEnableIpForwarding(true))))) + .withOverprovision(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithManagedBootDiagnostics.json + */ + /** + * Sample code: Create a scale set with managed boot diagnostics. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAScaleSetWithManagedBootDiagnostics( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L)) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true)))) + .withDiagnosticsProfile( + new DiagnosticsProfile().withBootDiagnostics(new BootDiagnostics().withEnabled(true)))) + .withOverprovision(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithAMarketplaceImagePlan.json + */ + /** + * Sample code: Create a scale set with a marketplace image plan. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAScaleSetWithAMarketplaceImagePlan( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L)) + .withPlan( + new Plan() + .withName("windows2016") + .withPublisher("microsoft-ads") + .withProduct("windows-data-science-vm")) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("microsoft-ads") + .withOffer("windows-data-science-vm") + .withSku("windows2016") + .withVersion("latest")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true))))) + .withOverprovision(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithDiffOsDisk.json + */ + /** + * Sample code: Create a scale set with ephemeral os disks. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAScaleSetWithEphemeralOsDisks( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_DS1_v2").withTier("Standard").withCapacity(3L)) + .withPlan( + new Plan() + .withName("windows2016") + .withPublisher("microsoft-ads") + .withProduct("windows-data-science-vm")) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("microsoft-ads") + .withOffer("windows-data-science-vm") + .withSku("windows2016") + .withVersion("latest")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withCaching(CachingTypes.READ_ONLY) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withDiffDiskSettings(new DiffDiskSettings().withOption(DiffDiskOptions.LOCAL)) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true))))) + .withOverprovision(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithVMsInDifferentZones.json + */ + /** + * Sample code: Create a scale set with virtual machines in different zones. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAScaleSetWithVirtualMachinesInDifferentZones( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("centralus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_A1_v2").withTier("Standard").withCapacity(2L)) + .withZones(Arrays.asList("1", "3")) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.AUTOMATIC)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withDiskSizeGB(512) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))) + .withDataDisks( + Arrays + .asList( + new VirtualMachineScaleSetDataDisk() + .withLun(0) + .withCreateOption(DiskCreateOptionTypes.EMPTY) + .withDiskSizeGB(1023), + new VirtualMachineScaleSetDataDisk() + .withLun(1) + .withCreateOption(DiskCreateOptionTypes.EMPTY) + .withDiskSizeGB(1023)))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true))))) + .withOverprovision(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithCapacityReservation.json + */ + /** + * Sample code: Create or update a scale set with capacity reservation. + * + * @param manager Entry point to ComputeManager. + */ + public static void createOrUpdateAScaleSetWithCapacityReservation( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_DS1_v2").withTier("Standard").withCapacity(3L)) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true)))) + .withCapacityReservation( + new CapacityReservationProfile() + .withCapacityReservationGroup( + new SubResource() + .withId( + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/CapacityReservationGroups/{crgName}")))) + .withOverprovision(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSecurityTypeConfidentialVM.json + */ + /** + * Sample code: Create a scale set with SecurityType as ConfidentialVM. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAScaleSetWithSecurityTypeAsConfidentialVM( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_DC2as_v5").withTier("Standard").withCapacity(3L)) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("2019-datacenter-cvm") + .withSku("windows-cvm") + .withVersion("17763.2183.2109130127")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withCaching(CachingTypes.READ_ONLY) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_SSD_LRS) + .withSecurityProfile( + new VMDiskSecurityProfile() + .withSecurityEncryptionType( + SecurityEncryptionTypes.VMGUEST_STATE_ONLY))))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true)))) + .withSecurityProfile( + new SecurityProfile() + .withUefiSettings(new UefiSettings().withSecureBootEnabled(true).withVTpmEnabled(true)) + .withSecurityType(SecurityTypes.CONFIDENTIAL_VM))) + .withOverprovision(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSshAuthentication.json + */ + /** + * Sample code: Create a scale set with ssh authentication. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAScaleSetWithSshAuthentication( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L)) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withLinuxConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSsh( + new SshConfiguration() + .withPublicKeys( + Arrays + .asList( + new SshPublicKey() + .withPath("/home/{your-username}/.ssh/authorized_keys") + .withKeyData("fakeTokenPlaceholder")))))) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true))))) + .withOverprovision(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithAzureApplicationGateway.json + */ + /** + * Sample code: Create a scale set with an azure application gateway. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAScaleSetWithAnAzureApplicationGateway( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L)) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")) + .withApplicationGatewayBackendAddressPools( + Arrays + .asList( + new SubResource() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/applicationGateways/{existing-application-gateway-name}/backendAddressPools/{existing-backend-address-pool-name}"))))) + .withEnableIpForwarding(true))))) + .withOverprovision(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_CustomImageFromAnUnmanagedGeneralizedOsImage.json + */ + /** + * Sample code: Create a custom-image scale set from an unmanaged generalized os image. + * + * @param manager Entry point to ComputeManager. + */ + public static void createACustomImageScaleSetFromAnUnmanagedGeneralizedOsImage( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L)) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withName("osDisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withImage( + new VirtualHardDisk() + .withUri( + "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/{existing-generalized-os-image-blob-name}.vhd")))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true))))) + .withOverprovision(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithExtensionsTimeBudget.json + */ + /** + * Sample code: Create a scale set with extension time budget. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAScaleSetWithExtensionTimeBudget( + com.azure.resourcemanager.compute.generated.ComputeManager manager) throws IOException { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L)) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true)))) + .withDiagnosticsProfile( + new DiagnosticsProfile() + .withBootDiagnostics( + new BootDiagnostics() + .withEnabled(true) + .withStorageUri("http://{existing-storage-account-name}.blob.core.windows.net"))) + .withExtensionProfile( + new VirtualMachineScaleSetExtensionProfile() + .withExtensions( + Arrays + .asList( + new VirtualMachineScaleSetExtensionInner() + .withName("{extension-name}") + .withPublisher("{extension-Publisher}") + .withTypePropertiesType("{extension-Type}") + .withTypeHandlerVersion("{handler-version}") + .withAutoUpgradeMinorVersion(false) + .withSettings( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)))) + .withExtensionsTimeBudget("PT1H20M"))) + .withOverprovision(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithApplicationProfile.json + */ + /** + * Sample code: Create a scale set with Application Profile. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAScaleSetWithApplicationProfile( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L)) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true)))) + .withApplicationProfile( + new ApplicationProfile() + .withGalleryApplications( + Arrays + .asList( + new VMGalleryApplication() + .withTags("myTag1") + .withOrder(1) + .withPackageReferenceId( + "/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdb/resourceGroups/myresourceGroupName2/providers/Microsoft.Compute/galleries/myGallery1/applications/MyApplication1/versions/1.0") + .withConfigurationReference( + "https://mystorageaccount.blob.core.windows.net/configurations/settings.config") + .withTreatFailureAsDeploymentFailure(true) + .withEnableAutomaticUpgrade(false), + new VMGalleryApplication() + .withPackageReferenceId( + "/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdg/resourceGroups/myresourceGroupName3/providers/Microsoft.Compute/galleries/myGallery2/applications/MyApplication2/versions/1.1"))))) + .withOverprovision(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithDiskEncryptionSetResource.json + */ + /** + * Sample code: Create a scale set with DiskEncryptionSet resource in os disk and data disk. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAScaleSetWithDiskEncryptionSetResourceInOsDiskAndDataDisk( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_DS1_v2").withTier("Standard").withCapacity(3L)) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS) + .withDiskEncryptionSet( + new DiskEncryptionSetParameters() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}")))) + .withDataDisks( + Arrays + .asList( + new VirtualMachineScaleSetDataDisk() + .withLun(0) + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.EMPTY) + .withDiskSizeGB(1023) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS) + .withDiskEncryptionSet( + new DiskEncryptionSetParameters() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}")))))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true))))) + .withOverprovision(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithPremiumStorage.json + */ + /** + * Sample code: Create a scale set with premium storage. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAScaleSetWithPremiumStorage( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L)) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.PREMIUM_LRS)))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true))))) + .withOverprovision(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromWithDisableTcpStateTrackingNetworkInterface.json + */ + /** + * Sample code: Create a scale set where nic config has DisableTcpStateTracking property. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAScaleSetWhereNicConfigHasDisableTcpStateTrackingProperty( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L)) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{nicConfig1-name}") + .withPrimary(true) + .withEnableAcceleratedNetworking(true) + .withDisableTcpStateTracking(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true), + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{nicConfig2-name}") + .withPrimary(false) + .withEnableAcceleratedNetworking(false) + .withDisableTcpStateTracking(false) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{nicConfig2-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-fpga-subnet-name2}")) + .withPrimary(true) + .withPrivateIpAddressVersion(IpVersion.IPV4))) + .withEnableIpForwarding(false))))) + .withOverprovision(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithVMSizeProperties.json + */ + /** + * Sample code: Create a scale set with vm size properties. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAScaleSetWithVmSizeProperties( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L)) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true)))) + .withUserData("RXhhbXBsZSBVc2VyRGF0YQ==") + .withHardwareProfile( + new VirtualMachineScaleSetHardwareProfile() + .withVmSizeProperties(new VMSizeProperties().withVCpusAvailable(1).withVCpusPerCore(1)))) + .withOverprovision(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithTerminateScheduledEventEnabled.json + */ + /** + * Sample code: Create a scale set with terminate scheduled events enabled. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAScaleSetWithTerminateScheduledEventsEnabled( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L)) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true)))) + .withScheduledEventsProfile( + new ScheduledEventsProfile() + .withTerminateNotificationProfile( + new TerminateNotificationProfile().withNotBeforeTimeout("PT5M").withEnable(true)))) + .withOverprovision(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithExtensionsSuppressFailuresEnabled.json + */ + /** + * Sample code: Create a VMSS with an extension that has suppressFailures enabled. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVMSSWithAnExtensionThatHasSuppressFailuresEnabled( + com.azure.resourcemanager.compute.generated.ComputeManager manager) throws IOException { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L)) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true)))) + .withDiagnosticsProfile( + new DiagnosticsProfile() + .withBootDiagnostics( + new BootDiagnostics() + .withEnabled(true) + .withStorageUri("http://{existing-storage-account-name}.blob.core.windows.net"))) + .withExtensionProfile( + new VirtualMachineScaleSetExtensionProfile() + .withExtensions( + Arrays + .asList( + new VirtualMachineScaleSetExtensionInner() + .withName("{extension-name}") + .withPublisher("{extension-Publisher}") + .withTypePropertiesType("{extension-Type}") + .withTypeHandlerVersion("{handler-version}") + .withAutoUpgradeMinorVersion(false) + .withSettings( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .withSuppressFailures(true))))) + .withOverprovision(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_PlatformImageWithUnmanagedOsDisks.json + */ + /** + * Sample code: Create a platform-image scale set with unmanaged os disks. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAPlatformImageScaleSetWithUnmanagedOsDisks( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L)) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withName("osDisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withVhdContainers( + Arrays + .asList( + "http://{existing-storage-account-name-0}.blob.core.windows.net/vhdContainer", + "http://{existing-storage-account-name-1}.blob.core.windows.net/vhdContainer", + "http://{existing-storage-account-name-2}.blob.core.windows.net/vhdContainer", + "http://{existing-storage-account-name-3}.blob.core.windows.net/vhdContainer", + "http://{existing-storage-account-name-4}.blob.core.windows.net/vhdContainer")))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true))))) + .withOverprovision(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithUefiSettings.json + */ + /** + * Sample code: Create a scale set with Uefi Settings of secureBoot and vTPM. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAScaleSetWithUefiSettingsOfSecureBootAndVTPM( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_D2s_v3").withTier("Standard").withCapacity(3L)) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("windowsserver-gen2preview-preview") + .withSku("windows10-tvm") + .withVersion("18363.592.2001092016")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withCaching(CachingTypes.READ_ONLY) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_SSD_LRS)))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true)))) + .withSecurityProfile( + new SecurityProfile() + .withUefiSettings(new UefiSettings().withSecureBootEnabled(true).withVTpmEnabled(true)) + .withSecurityType(SecurityTypes.TRUSTED_LAUNCH))) + .withOverprovision(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithPasswordAuthentication.json + */ + /** + * Sample code: Create a scale set with password authentication. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAScaleSetWithPasswordAuthentication( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L)) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true))))) + .withOverprovision(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithDiskControllerType.json + */ + /** + * Sample code: Create a scale set with Disk Controller Type. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAScaleSetWithDiskControllerType( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L)) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))) + .withDiskControllerType("NVMe")) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true)))) + .withUserData("RXhhbXBsZSBVc2VyRGF0YQ==") + .withHardwareProfile( + new VirtualMachineScaleSetHardwareProfile() + .withVmSizeProperties(new VMSizeProperties().withVCpusAvailable(1).withVCpusPerCore(1)))) + .withOverprovision(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSecurityPostureReference.json + */ + /** + * Sample code: Create a scale set with Security Posture Reference. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAScaleSetWithSecurityPostureReference( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("eastus2euap") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_A1").withTier("Standard").withCapacity(3L)) + .withUpgradePolicy( + new UpgradePolicy() + .withMode(UpgradeMode.AUTOMATIC) + .withAutomaticOSUpgradePolicy(new AutomaticOSUpgradePolicy().withEnableAutomaticOSUpgrade(true))) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2022-Datacenter") + .withVersion("latest")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withName("osDisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true)))) + .withSecurityPostureReference( + new SecurityPostureReference() + .withId( + "/CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|{major.*}|latest"))) + .withOverprovision(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithPriorityMixPolicy.json + */ + /** + * Sample code: Create a scale set with priority mix policy. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAScaleSetWithPriorityMixPolicy( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_A8m_v2").withTier("Standard").withCapacity(10L)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true)))) + .withPriority(VirtualMachinePriorityTypes.SPOT) + .withEvictionPolicy(VirtualMachineEvictionPolicyTypes.DEALLOCATE) + .withBillingProfile(new BillingProfile().withMaxPrice(-1.0D))) + .withSinglePlacementGroup(false) + .withOrchestrationMode(OrchestrationMode.FLEXIBLE) + .withPriorityMixPolicy( + new PriorityMixPolicy().withBaseRegularPriorityCount(4).withRegularPriorityPercentageAboveBase(50)) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithAutomaticRepairs.json + */ + /** + * Sample code: Create a scale set with automatic repairs enabled. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAScaleSetWithAutomaticRepairsEnabled( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L)) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) + .withAutomaticRepairsPolicy(new AutomaticRepairsPolicy().withEnabled(true).withGracePeriod("PT10M")) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true))))) + .withOverprovision(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSpotRestorePolicy.json + */ + /** + * Sample code: Create a scale set with spot restore policy. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAScaleSetWithSpotRestorePolicy( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_A8m_v2").withTier("Standard").withCapacity(2L)) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true)))) + .withPriority(VirtualMachinePriorityTypes.SPOT) + .withEvictionPolicy(VirtualMachineEvictionPolicyTypes.DEALLOCATE) + .withBillingProfile(new BillingProfile().withMaxPrice(-1.0D))) + .withOverprovision(true) + .withSpotRestorePolicy(new SpotRestorePolicy().withEnabled(true).withRestoreTimeout("PT1H")) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromAGeneralizedSharedImage.json + */ + /** + * Sample code: Create a scale set from a generalized shared image. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAScaleSetFromAGeneralizedSharedImage( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L)) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true))))) + .withOverprovision(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithBootDiagnostics.json + */ + /** + * Sample code: Create a scale set with boot diagnostics. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAScaleSetWithBootDiagnostics( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L)) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true)))) + .withDiagnosticsProfile( + new DiagnosticsProfile() + .withBootDiagnostics( + new BootDiagnostics() + .withEnabled(true) + .withStorageUri("http://{existing-storage-account-name}.blob.core.windows.net")))) + .withOverprovision(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromASpecializedSharedImage.json + */ + /** + * Sample code: Create a scale set from a specialized shared image. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAScaleSetFromASpecializedSharedImage( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L)) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true))))) + .withOverprovision(true) + .create(); + } +} +``` + +### VirtualMachineScaleSets_Deallocate + +```java +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMInstanceIDs; +import java.util.Arrays; + +/** Samples for VirtualMachineScaleSets Deallocate. */ +public final class VirtualMachineScaleSetsDeallocateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Deallocate_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_Deallocate_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetDeallocateMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .deallocate( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaa", + true, + new VirtualMachineScaleSetVMInstanceIDs().withInstanceIds(Arrays.asList("aaaaaaaaaaaaaaaaa")), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Deallocate_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_Deallocate_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetDeallocateMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .deallocate("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaa", null, null, com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineScaleSets_Delete + +```java +/** Samples for VirtualMachineScaleSets Delete. */ +public final class VirtualMachineScaleSetsDeleteSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Delete_Force.json + */ + /** + * Sample code: Force Delete a VM scale set. + * + * @param manager Entry point to ComputeManager. + */ + public static void forceDeleteAVMScaleSet(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .delete("myResourceGroup", "myvmScaleSet", true, com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineScaleSets_DeleteInstances + +```java +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMInstanceRequiredIDs; +import java.util.Arrays; + +/** Samples for VirtualMachineScaleSets DeleteInstances. */ +public final class VirtualMachineScaleSetsDeleteInstancesSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_DeleteInstances_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_DeleteInstances_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetDeleteInstancesMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .deleteInstances( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaa", + new VirtualMachineScaleSetVMInstanceRequiredIDs() + .withInstanceIds(Arrays.asList("aaaaaaaaaaaaaaaaaaaaaaaaa")), + true, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_DeleteInstances_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_DeleteInstances_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetDeleteInstancesMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .deleteInstances( + "rgcompute", + "aaaaaaaaaaaaaaa", + new VirtualMachineScaleSetVMInstanceRequiredIDs() + .withInstanceIds(Arrays.asList("aaaaaaaaaaaaaaaaaaaaaaaaa")), + null, + com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineScaleSets_ForceRecoveryServiceFabricPlatformUpdateDomainWalk + +```java +/** Samples for VirtualMachineScaleSets ForceRecoveryServiceFabricPlatformUpdateDomainWalk. */ +public final class VirtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ForceRecoveryServiceFabricPlatformUpdateDomainWalk_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_ForceRecoveryServiceFabricPlatformUpdateDomainWalk_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetForceRecoveryServiceFabricPlatformUpdateDomainWalkMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .forceRecoveryServiceFabricPlatformUpdateDomainWalkWithResponse( + "rgcompute", "aaaaaaaaaaaa", 9, null, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ForceRecoveryServiceFabricPlatformUpdateDomainWalk_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_ForceRecoveryServiceFabricPlatformUpdateDomainWalk_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetForceRecoveryServiceFabricPlatformUpdateDomainWalkMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .forceRecoveryServiceFabricPlatformUpdateDomainWalkWithResponse( + "rgcompute", "aaaaaaaaaaaaaaaa", 30, null, null, com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineScaleSets_GetByResourceGroup + +```java +import com.azure.resourcemanager.compute.generated.models.ExpandTypesForGetVMScaleSets; + +/** Samples for VirtualMachineScaleSets GetByResourceGroup. */ +public final class VirtualMachineScaleSetsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_AutoPlacedOnDedicatedHostGroup.json + */ + /** + * Sample code: Get a virtual machine scale set placed on a dedicated host group through automatic placement. + * + * @param manager Entry point to ComputeManager. + */ + public static void getAVirtualMachineScaleSetPlacedOnADedicatedHostGroupThroughAutomaticPlacement( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .getByResourceGroupWithResponse( + "myResourceGroup", "myVirtualMachineScaleSet", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get.json + */ + /** + * Sample code: Get a virtual machine scale set. + * + * @param manager Entry point to ComputeManager. + */ + public static void getAVirtualMachineScaleSet(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .getByResourceGroupWithResponse( + "myResourceGroup", "myVirtualMachineScaleSet", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_WithUserData.json + */ + /** + * Sample code: Get a virtual machine scale set with UserData. + * + * @param manager Entry point to ComputeManager. + */ + public static void getAVirtualMachineScaleSetWithUserData( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .getByResourceGroupWithResponse( + "myResourceGroup", + "myVirtualMachineScaleSet", + ExpandTypesForGetVMScaleSets.USER_DATA, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_WithDiskControllerType.json + */ + /** + * Sample code: Get VM scale set VM with Disk Controller Type. + * + * @param manager Entry point to ComputeManager. + */ + public static void getVMScaleSetVMWithDiskControllerType( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .getByResourceGroupWithResponse( + "myResourceGroup", + "myVirtualMachineScaleSet", + ExpandTypesForGetVMScaleSets.USER_DATA, + com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineScaleSets_GetInstanceView + +```java +/** Samples for VirtualMachineScaleSets GetInstanceView. */ +public final class VirtualMachineScaleSetsGetInstanceViewSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_GetInstanceView_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_GetInstanceView_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetGetInstanceViewMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .getInstanceViewWithResponse("rgcompute", "aaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_GetInstanceView_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_GetInstanceView_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetGetInstanceViewMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .getInstanceViewWithResponse("rgcompute", "aaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineScaleSets_GetOSUpgradeHistory + +```java +/** Samples for VirtualMachineScaleSets GetOSUpgradeHistory. */ +public final class VirtualMachineScaleSetsGetOSUpgradeHistorySamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_GetOSUpgradeHistory_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_GetOSUpgradeHistory_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetGetOSUpgradeHistoryMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .getOSUpgradeHistory("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_GetOSUpgradeHistory_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_GetOSUpgradeHistory_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetGetOSUpgradeHistoryMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachineScaleSets().getOSUpgradeHistory("rgcompute", "aaaaaa", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineScaleSets_List + +```java +/** Samples for VirtualMachineScaleSets List. */ +public final class VirtualMachineScaleSetsListSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListAll_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_ListAll_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetListAllMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachineScaleSets().list(com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListAll_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_ListAll_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetListAllMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachineScaleSets().list(com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineScaleSets_ListByLocation + +```java +/** Samples for VirtualMachineScaleSets ListByLocation. */ +public final class VirtualMachineScaleSetsListByLocationSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListBySubscription_ByLocation.json + */ + /** + * Sample code: Lists all the VM scale sets under the specified subscription for the specified location. + * + * @param manager Entry point to ComputeManager. + */ + public static void listsAllTheVMScaleSetsUnderTheSpecifiedSubscriptionForTheSpecifiedLocation( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachineScaleSets().listByLocation("eastus", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineScaleSets_ListByResourceGroup + +```java +/** Samples for VirtualMachineScaleSets ListByResourceGroup. */ +public final class VirtualMachineScaleSetsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_List_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_List_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetListMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachineScaleSets().listByResourceGroup("rgcompute", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_List_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_List_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetListMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachineScaleSets().listByResourceGroup("rgcompute", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineScaleSets_ListSkus + +```java +/** Samples for VirtualMachineScaleSets ListSkus. */ +public final class VirtualMachineScaleSetsListSkusSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListSkus_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_ListSkus_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetListSkusMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachineScaleSets().listSkus("rgcompute", "aaaaaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListSkus_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_ListSkus_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetListSkusMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachineScaleSets().listSkus("rgcompute", "aaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineScaleSets_PerformMaintenance + +```java +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMInstanceIDs; +import java.util.Arrays; + +/** Samples for VirtualMachineScaleSets PerformMaintenance. */ +public final class VirtualMachineScaleSetsPerformMaintenanceSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_PerformMaintenance_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_PerformMaintenance_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetPerformMaintenanceMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachineScaleSets().performMaintenance("rgcompute", "aa", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_PerformMaintenance_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_PerformMaintenance_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetPerformMaintenanceMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .performMaintenance( + "rgcompute", + "aaaaaaaaaaa", + new VirtualMachineScaleSetVMInstanceIDs().withInstanceIds(Arrays.asList("aaaaaaaaaaaaaaaaa")), + com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineScaleSets_PowerOff + +```java +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMInstanceIDs; +import java.util.Arrays; + +/** Samples for VirtualMachineScaleSets PowerOff. */ +public final class VirtualMachineScaleSetsPowerOffSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_PowerOff_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_PowerOff_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetPowerOffMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachineScaleSets().powerOff("rgcompute", "a", null, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_PowerOff_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_PowerOff_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetPowerOffMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .powerOff( + "rgcompute", + "aaaaaaaaaaaaaaaaaa", + true, + new VirtualMachineScaleSetVMInstanceIDs().withInstanceIds(Arrays.asList("aaaaaaaaaaaaaaaaa")), + com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineScaleSets_Reapply + +```java +/** Samples for VirtualMachineScaleSets Reapply. */ +public final class VirtualMachineScaleSetsReapplySamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Reapply_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSets_Reapply_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetsReapplyMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .reapply( + "VirtualMachineScaleSetReapplyTestRG", "VMSSReapply-Test-ScaleSet", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Reapply_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSets_Reapply_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetsReapplyMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .reapply( + "VirtualMachineScaleSetReapplyTestRG", "VMSSReapply-Test-ScaleSet", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineScaleSets_Redeploy + +```java +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMInstanceIDs; +import java.util.Arrays; + +/** Samples for VirtualMachineScaleSets Redeploy. */ +public final class VirtualMachineScaleSetsRedeploySamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Redeploy_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_Redeploy_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetRedeployMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .redeploy("rgcompute", "aaaaaaaaaaaaaaaaaaaaaa", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Redeploy_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_Redeploy_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetRedeployMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .redeploy( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + new VirtualMachineScaleSetVMInstanceIDs().withInstanceIds(Arrays.asList("aaaaaaaaaaaaaaaaa")), + com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineScaleSets_Reimage + +```java +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetReimageParameters; +import java.util.Arrays; + +/** Samples for VirtualMachineScaleSets Reimage. */ +public final class VirtualMachineScaleSetsReimageSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Reimage_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_Reimage_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetReimageMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .reimage("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaaa", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Reimage_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_Reimage_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetReimageMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .reimage( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaaaa", + new VirtualMachineScaleSetReimageParameters() + .withTempDisk(true) + .withInstanceIds(Arrays.asList("aaaaaaaaaa")), + com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineScaleSets_ReimageAll + +```java +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMInstanceIDs; +import java.util.Arrays; + +/** Samples for VirtualMachineScaleSets ReimageAll. */ +public final class VirtualMachineScaleSetsReimageAllSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ReimageAll_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_ReimageAll_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetReimageAllMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .reimageAll( + "rgcompute", + "aaaaaaaaaaaa", + new VirtualMachineScaleSetVMInstanceIDs().withInstanceIds(Arrays.asList("aaaaaaaaaaaaaaaaa")), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ReimageAll_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_ReimageAll_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetReimageAllMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .reimageAll("rgcompute", "aaaaaaaaaaaaaaaaaaaaaa", null, com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineScaleSets_Restart + +```java +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMInstanceIDs; +import java.util.Arrays; + +/** Samples for VirtualMachineScaleSets Restart. */ +public final class VirtualMachineScaleSetsRestartSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Restart_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_Restart_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetRestartMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .restart( + "rgcompute", + "aaaaaaaaaaaaaaaaaaa", + new VirtualMachineScaleSetVMInstanceIDs().withInstanceIds(Arrays.asList("aaaaaaaaaaaaaaaaa")), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Restart_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_Restart_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetRestartMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachineScaleSets().restart("rgcompute", "aaaa", null, com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineScaleSets_SetOrchestrationServiceState + +```java +import com.azure.resourcemanager.compute.generated.models.OrchestrationServiceNames; +import com.azure.resourcemanager.compute.generated.models.OrchestrationServiceStateAction; +import com.azure.resourcemanager.compute.generated.models.OrchestrationServiceStateInput; + +/** Samples for VirtualMachineScaleSets SetOrchestrationServiceState. */ +public final class VirtualMachineScaleSetsSetOrchestrationServiceStateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_SetOrchestrationServiceState_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_SetOrchestrationServiceState_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetSetOrchestrationServiceStateMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .setOrchestrationServiceState( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaa", + new OrchestrationServiceStateInput() + .withServiceName(OrchestrationServiceNames.AUTOMATIC_REPAIRS) + .withAction(OrchestrationServiceStateAction.RESUME), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_SetOrchestrationServiceState_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_SetOrchestrationServiceState_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetSetOrchestrationServiceStateMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .setOrchestrationServiceState( + "rgcompute", + "aaaaaaaaaaaaaaaa", + new OrchestrationServiceStateInput() + .withServiceName(OrchestrationServiceNames.AUTOMATIC_REPAIRS) + .withAction(OrchestrationServiceStateAction.RESUME), + com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineScaleSets_Start + +```java +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMInstanceIDs; +import java.util.Arrays; + +/** Samples for VirtualMachineScaleSets Start. */ +public final class VirtualMachineScaleSetsStartSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Start_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_Start_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetStartMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .start("rgcompute", "aaaaaaaaaaaaaaaaaaa", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Start_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_Start_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetStartMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .start( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaa", + new VirtualMachineScaleSetVMInstanceIDs().withInstanceIds(Arrays.asList("aaaaaaaaaaaaaaaaa")), + com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineScaleSets_Update + +```java +import com.azure.core.management.SubResource; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetExtensionInner; +import com.azure.resourcemanager.compute.generated.models.AdditionalCapabilities; +import com.azure.resourcemanager.compute.generated.models.AdditionalUnattendContent; +import com.azure.resourcemanager.compute.generated.models.ApiEntityReference; +import com.azure.resourcemanager.compute.generated.models.AutomaticOSUpgradePolicy; +import com.azure.resourcemanager.compute.generated.models.AutomaticRepairsPolicy; +import com.azure.resourcemanager.compute.generated.models.BillingProfile; +import com.azure.resourcemanager.compute.generated.models.BootDiagnostics; +import com.azure.resourcemanager.compute.generated.models.CachingTypes; +import com.azure.resourcemanager.compute.generated.models.ComponentNames; +import com.azure.resourcemanager.compute.generated.models.DeleteOptions; +import com.azure.resourcemanager.compute.generated.models.DiagnosticsProfile; +import com.azure.resourcemanager.compute.generated.models.DiskCreateOptionTypes; +import com.azure.resourcemanager.compute.generated.models.DiskEncryptionSetParameters; +import com.azure.resourcemanager.compute.generated.models.ImageReference; +import com.azure.resourcemanager.compute.generated.models.IpVersion; +import com.azure.resourcemanager.compute.generated.models.LinuxConfiguration; +import com.azure.resourcemanager.compute.generated.models.LinuxPatchAssessmentMode; +import com.azure.resourcemanager.compute.generated.models.LinuxPatchSettings; +import com.azure.resourcemanager.compute.generated.models.LinuxVMGuestPatchMode; +import com.azure.resourcemanager.compute.generated.models.NetworkApiVersion; +import com.azure.resourcemanager.compute.generated.models.PassNames; +import com.azure.resourcemanager.compute.generated.models.PatchSettings; +import com.azure.resourcemanager.compute.generated.models.Plan; +import com.azure.resourcemanager.compute.generated.models.ProtocolTypes; +import com.azure.resourcemanager.compute.generated.models.ResourceIdentityType; +import com.azure.resourcemanager.compute.generated.models.RollingUpgradePolicy; +import com.azure.resourcemanager.compute.generated.models.ScaleInPolicy; +import com.azure.resourcemanager.compute.generated.models.ScheduledEventsProfile; +import com.azure.resourcemanager.compute.generated.models.SecurityProfile; +import com.azure.resourcemanager.compute.generated.models.SecurityTypes; +import com.azure.resourcemanager.compute.generated.models.SettingNames; +import com.azure.resourcemanager.compute.generated.models.Sku; +import com.azure.resourcemanager.compute.generated.models.SshConfiguration; +import com.azure.resourcemanager.compute.generated.models.SshPublicKey; +import com.azure.resourcemanager.compute.generated.models.StorageAccountTypes; +import com.azure.resourcemanager.compute.generated.models.TerminateNotificationProfile; +import com.azure.resourcemanager.compute.generated.models.UefiSettings; +import com.azure.resourcemanager.compute.generated.models.UpgradeMode; +import com.azure.resourcemanager.compute.generated.models.UpgradePolicy; +import com.azure.resourcemanager.compute.generated.models.UserAssignedIdentitiesValue; +import com.azure.resourcemanager.compute.generated.models.VaultCertificate; +import com.azure.resourcemanager.compute.generated.models.VaultSecretGroup; +import com.azure.resourcemanager.compute.generated.models.VirtualHardDisk; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSet; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetDataDisk; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetExtensionProfile; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetIdentity; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetManagedDiskParameters; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetNetworkConfigurationDnsSettings; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetScaleInRules; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetUpdateIpConfiguration; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetUpdateNetworkConfiguration; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetUpdateNetworkProfile; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetUpdateOSDisk; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetUpdateOSProfile; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetUpdatePublicIpAddressConfiguration; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetUpdateStorageProfile; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetUpdateVMProfile; +import com.azure.resourcemanager.compute.generated.models.WinRMConfiguration; +import com.azure.resourcemanager.compute.generated.models.WinRMListener; +import com.azure.resourcemanager.compute.generated.models.WindowsConfiguration; +import com.azure.resourcemanager.compute.generated.models.WindowsPatchAssessmentMode; +import com.azure.resourcemanager.compute.generated.models.WindowsVMGuestPatchAutomaticByPlatformRebootSetting; +import com.azure.resourcemanager.compute.generated.models.WindowsVMGuestPatchAutomaticByPlatformSettings; +import com.azure.resourcemanager.compute.generated.models.WindowsVMGuestPatchMode; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for VirtualMachineScaleSets Update. */ +public final class VirtualMachineScaleSetsUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Update_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_Update_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetUpdateMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + VirtualMachineScaleSet resource = + manager + .virtualMachineScaleSets() + .getByResourceGroupWithResponse("rgcompute", "aaaaaaaaaaaaaa", null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update().apply(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Update_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_Update_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetUpdateMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) throws IOException { + VirtualMachineScaleSet resource = + manager + .virtualMachineScaleSets() + .getByResourceGroupWithResponse("rgcompute", "aaaaaaaaaaaaa", null, com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("key246", "aaaaaaaaaaaaaaaaaaaaaaaa")) + .withSku(new Sku().withName("DSv3-Type1").withTier("aaa").withCapacity(7L)) + .withPlan( + new Plan() + .withName("windows2016") + .withPublisher("microsoft-ads") + .withProduct("windows-data-science-vm") + .withPromotionCode("fakeTokenPlaceholder")) + .withIdentity( + new VirtualMachineScaleSetIdentity() + .withType(ResourceIdentityType.SYSTEM_ASSIGNED) + .withUserAssignedIdentities(mapOf("key3951", new UserAssignedIdentitiesValue()))) + .withUpgradePolicy( + new UpgradePolicy() + .withMode(UpgradeMode.MANUAL) + .withRollingUpgradePolicy( + new RollingUpgradePolicy() + .withMaxBatchInstancePercent(49) + .withMaxUnhealthyInstancePercent(81) + .withMaxUnhealthyUpgradedInstancePercent(98) + .withPauseTimeBetweenBatches("aaaaaaaaaaaaaaa") + .withEnableCrossZoneUpgrade(true) + .withPrioritizeUnhealthyInstances(true) + .withRollbackFailedInstancesOnPolicyBreach(true) + .withMaxSurge(true)) + .withAutomaticOSUpgradePolicy( + new AutomaticOSUpgradePolicy() + .withEnableAutomaticOSUpgrade(true) + .withDisableAutomaticRollback(true))) + .withAutomaticRepairsPolicy(new AutomaticRepairsPolicy().withEnabled(true).withGracePeriod("PT30M")) + .withVirtualMachineProfile( + new VirtualMachineScaleSetUpdateVMProfile() + .withOsProfile( + new VirtualMachineScaleSetUpdateOSProfile() + .withCustomData("aaaaaaaaaaaaaaaaaaaaaaaaaa") + .withWindowsConfiguration( + new WindowsConfiguration() + .withProvisionVMAgent(true) + .withEnableAutomaticUpdates(true) + .withTimeZone("aaaaaaaaaaaaaaaa") + .withAdditionalUnattendContent( + Arrays + .asList( + new AdditionalUnattendContent() + .withPassName(PassNames.OOBE_SYSTEM) + .withComponentName(ComponentNames.MICROSOFT_WINDOWS_SHELL_SETUP) + .withSettingName(SettingNames.AUTO_LOGON) + .withContent("aaaaaaaaaaaaaaaaaaaa"))) + .withPatchSettings( + new PatchSettings() + .withPatchMode(WindowsVMGuestPatchMode.AUTOMATIC_BY_PLATFORM) + .withEnableHotpatching(true) + .withAssessmentMode(WindowsPatchAssessmentMode.IMAGE_DEFAULT) + .withAutomaticByPlatformSettings( + new WindowsVMGuestPatchAutomaticByPlatformSettings() + .withRebootSetting( + WindowsVMGuestPatchAutomaticByPlatformRebootSetting.NEVER))) + .withWinRM( + new WinRMConfiguration() + .withListeners( + Arrays + .asList( + new WinRMListener() + .withProtocol(ProtocolTypes.HTTP) + .withCertificateUrl("aaaaaaaaaaaaaaaaaaaaaa"))))) + .withLinuxConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSsh( + new SshConfiguration() + .withPublicKeys( + Arrays + .asList( + new SshPublicKey() + .withPath("/home/{your-username}/.ssh/authorized_keys") + .withKeyData("fakeTokenPlaceholder")))) + .withProvisionVMAgent(true) + .withPatchSettings( + new LinuxPatchSettings() + .withPatchMode(LinuxVMGuestPatchMode.IMAGE_DEFAULT) + .withAssessmentMode(LinuxPatchAssessmentMode.IMAGE_DEFAULT))) + .withSecrets( + Arrays + .asList( + new VaultSecretGroup() + .withSourceVault( + new SubResource() + .withId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}")) + .withVaultCertificates( + Arrays + .asList( + new VaultCertificate() + .withCertificateUrl("aaaaaaa") + .withCertificateStore("aaaaaaaaaaaaaaaaaaaaaaaaa")))))) + .withStorageProfile( + new VirtualMachineScaleSetUpdateStorageProfile() + .withImageReference( + new ImageReference() + .withId("aaaaaaaaaaaaaaaaaaa") + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest") + .withSharedGalleryImageId("aaaaaa")) + .withOsDisk( + new VirtualMachineScaleSetUpdateOSDisk() + .withCaching(CachingTypes.READ_WRITE) + .withWriteAcceleratorEnabled(true) + .withDiskSizeGB(6) + .withImage( + new VirtualHardDisk() + .withUri( + "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk.vhd")) + .withVhdContainers(Arrays.asList("aa")) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS) + .withDiskEncryptionSet( + new DiskEncryptionSetParameters().withId("aaaaaaaaaaaa")))) + .withDataDisks( + Arrays + .asList( + new VirtualMachineScaleSetDataDisk() + .withName("aaaaaaaaaaaaaaaaaaaaaaaaaa") + .withLun(26) + .withCaching(CachingTypes.NONE) + .withWriteAcceleratorEnabled(true) + .withCreateOption(DiskCreateOptionTypes.EMPTY) + .withDiskSizeGB(1023) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS) + .withDiskEncryptionSet( + new DiskEncryptionSetParameters().withId("aaaaaaaaaaaa"))) + .withDiskIopsReadWrite(28L) + .withDiskMBpsReadWrite(15L)))) + .withNetworkProfile( + new VirtualMachineScaleSetUpdateNetworkProfile() + .withHealthProbe( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/disk123")) + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetUpdateNetworkConfiguration() + .withName("aaaaaaaa") + .withPrimary(true) + .withEnableAcceleratedNetworking(true) + .withEnableFpga(true) + .withNetworkSecurityGroup( + new SubResource() + .withId( + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot")) + .withDnsSettings( + new VirtualMachineScaleSetNetworkConfigurationDnsSettings() + .withDnsServers(Arrays.asList())) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetUpdateIpConfiguration() + .withName("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/disk123")) + .withPrimary(true) + .withPublicIpAddressConfiguration( + new VirtualMachineScaleSetUpdatePublicIpAddressConfiguration() + .withName("a") + .withIdleTimeoutInMinutes(3) + .withDnsSettings( + new VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings() + .withDomainNameLabel("aaaaaaaaaaaaaaaaaa")) + .withDeleteOption(DeleteOptions.DELETE)) + .withPrivateIpAddressVersion(IpVersion.IPV4) + .withApplicationGatewayBackendAddressPools( + Arrays + .asList( + new SubResource() + .withId( + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"))) + .withApplicationSecurityGroups( + Arrays + .asList( + new SubResource() + .withId( + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"))) + .withLoadBalancerBackendAddressPools( + Arrays + .asList( + new SubResource() + .withId( + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"))) + .withLoadBalancerInboundNatPools( + Arrays + .asList( + new SubResource() + .withId( + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"))))) + .withEnableIpForwarding(true) + .withDeleteOption(DeleteOptions.DELETE))) + .withNetworkApiVersion(NetworkApiVersion.TWO_ZERO_TWO_ZERO_ONE_ONE_ZERO_ONE)) + .withSecurityProfile( + new SecurityProfile() + .withUefiSettings(new UefiSettings().withSecureBootEnabled(true).withVTpmEnabled(true)) + .withEncryptionAtHost(true) + .withSecurityType(SecurityTypes.TRUSTED_LAUNCH)) + .withDiagnosticsProfile( + new DiagnosticsProfile() + .withBootDiagnostics( + new BootDiagnostics() + .withEnabled(true) + .withStorageUri("http://{existing-storage-account-name}.blob.core.windows.net"))) + .withExtensionProfile( + new VirtualMachineScaleSetExtensionProfile() + .withExtensions( + Arrays + .asList( + new VirtualMachineScaleSetExtensionInner() + .withName("{extension-name}") + .withForceUpdateTag("aaaaaaaaa") + .withPublisher("{extension-Publisher}") + .withTypePropertiesType("{extension-Type}") + .withTypeHandlerVersion("{handler-version}") + .withAutoUpgradeMinorVersion(true) + .withEnableAutomaticUpgrade(true) + .withSettings( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .withProtectedSettings( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .withProvisionAfterExtensions(Arrays.asList("aa")) + .withSuppressFailures(true))) + .withExtensionsTimeBudget("PT1H20M")) + .withLicenseType("aaaaaaaaaaaa") + .withBillingProfile(new BillingProfile().withMaxPrice(-1.0D)) + .withScheduledEventsProfile( + new ScheduledEventsProfile() + .withTerminateNotificationProfile( + new TerminateNotificationProfile().withNotBeforeTimeout("PT10M").withEnable(true))) + .withUserData("aaaaaaaaaaaaa")) + .withOverprovision(true) + .withDoNotRunExtensionsOnOverprovisionedVMs(true) + .withSinglePlacementGroup(true) + .withAdditionalCapabilities( + new AdditionalCapabilities().withUltraSsdEnabled(true).withHibernationEnabled(true)) + .withScaleInPolicy( + new ScaleInPolicy() + .withRules(Arrays.asList(VirtualMachineScaleSetScaleInRules.OLDEST_VM)) + .withForceDeletion(true)) + .withProximityPlacementGroup( + new SubResource() + .withId( + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot")) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### VirtualMachineScaleSets_UpdateInstances + +```java +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMInstanceRequiredIDs; +import java.util.Arrays; + +/** Samples for VirtualMachineScaleSets UpdateInstances. */ +public final class VirtualMachineScaleSetsUpdateInstancesSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_UpdateInstances_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_UpdateInstances_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetUpdateInstancesMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .updateInstances( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + new VirtualMachineScaleSetVMInstanceRequiredIDs() + .withInstanceIds(Arrays.asList("aaaaaaaaaaaaaaaaaaaaaaaaa")), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_UpdateInstances_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_UpdateInstances_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetUpdateInstancesMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .updateInstances( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaa", + new VirtualMachineScaleSetVMInstanceRequiredIDs() + .withInstanceIds(Arrays.asList("aaaaaaaaaaaaaaaaaaaaaaaaa")), + com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineSizes_List + +```java +/** Samples for VirtualMachineSizes List. */ +public final class VirtualMachineSizesListSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/computeRPCommonExamples/VirtualMachineSizes_List_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineSizes_List_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineSizesListMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachineSizes().list("._..", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/computeRPCommonExamples/VirtualMachineSizes_List_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineSizes_List_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineSizesListMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachineSizes().list("-e", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachines_AssessPatches + +```java +/** Samples for VirtualMachines AssessPatches. */ +public final class VirtualMachinesAssessPatchesSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_AssessPatches.json + */ + /** + * Sample code: Assess patch state of a virtual machine. + * + * @param manager Entry point to ComputeManager. + */ + public static void assessPatchStateOfAVirtualMachine( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachines().assessPatches("myResourceGroupName", "myVMName", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachines_Capture + +```java +import com.azure.resourcemanager.compute.generated.models.VirtualMachineCaptureParameters; + +/** Samples for VirtualMachines Capture. */ +public final class VirtualMachinesCaptureSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Capture_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachine_Capture_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineCaptureMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .capture( + "rgcompute", + "aaaaaaaaaaaaa", + new VirtualMachineCaptureParameters() + .withVhdPrefix("aaaaaaaaa") + .withDestinationContainerName("aaaaaaa") + .withOverwriteVhds(true), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Capture_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachine_Capture_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineCaptureMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .capture( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaa", + new VirtualMachineCaptureParameters() + .withVhdPrefix("aaaaaaaaa") + .withDestinationContainerName("aaaaaaa") + .withOverwriteVhds(true), + com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachines_ConvertToManagedDisks + +```java +/** Samples for VirtualMachines ConvertToManagedDisks. */ +public final class VirtualMachinesConvertToManagedDisksSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_ConvertToManagedDisks_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachine_ConvertToManagedDisks_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineConvertToManagedDisksMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachines().convertToManagedDisks("rgcompute", "aaaaaaaaaaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_ConvertToManagedDisks_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachine_ConvertToManagedDisks_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineConvertToManagedDisksMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachines().convertToManagedDisks("rgcompute", "aaaaaaa", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachines_CreateOrUpdate + +```java +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.compute.generated.models.AdditionalCapabilities; +import com.azure.resourcemanager.compute.generated.models.ApplicationProfile; +import com.azure.resourcemanager.compute.generated.models.BootDiagnostics; +import com.azure.resourcemanager.compute.generated.models.CachingTypes; +import com.azure.resourcemanager.compute.generated.models.CapacityReservationProfile; +import com.azure.resourcemanager.compute.generated.models.DataDisk; +import com.azure.resourcemanager.compute.generated.models.DeleteOptions; +import com.azure.resourcemanager.compute.generated.models.DiagnosticsProfile; +import com.azure.resourcemanager.compute.generated.models.DiffDiskOptions; +import com.azure.resourcemanager.compute.generated.models.DiffDiskPlacement; +import com.azure.resourcemanager.compute.generated.models.DiffDiskSettings; +import com.azure.resourcemanager.compute.generated.models.DiskControllerTypes; +import com.azure.resourcemanager.compute.generated.models.DiskCreateOptionTypes; +import com.azure.resourcemanager.compute.generated.models.DiskEncryptionSetParameters; +import com.azure.resourcemanager.compute.generated.models.HardwareProfile; +import com.azure.resourcemanager.compute.generated.models.ImageReference; +import com.azure.resourcemanager.compute.generated.models.LinuxConfiguration; +import com.azure.resourcemanager.compute.generated.models.LinuxPatchAssessmentMode; +import com.azure.resourcemanager.compute.generated.models.LinuxPatchSettings; +import com.azure.resourcemanager.compute.generated.models.LinuxVMGuestPatchAutomaticByPlatformRebootSetting; +import com.azure.resourcemanager.compute.generated.models.LinuxVMGuestPatchAutomaticByPlatformSettings; +import com.azure.resourcemanager.compute.generated.models.LinuxVMGuestPatchMode; +import com.azure.resourcemanager.compute.generated.models.ManagedDiskParameters; +import com.azure.resourcemanager.compute.generated.models.NetworkApiVersion; +import com.azure.resourcemanager.compute.generated.models.NetworkInterfaceReference; +import com.azure.resourcemanager.compute.generated.models.NetworkProfile; +import com.azure.resourcemanager.compute.generated.models.OSDisk; +import com.azure.resourcemanager.compute.generated.models.OSImageNotificationProfile; +import com.azure.resourcemanager.compute.generated.models.OSProfile; +import com.azure.resourcemanager.compute.generated.models.OperatingSystemTypes; +import com.azure.resourcemanager.compute.generated.models.PatchSettings; +import com.azure.resourcemanager.compute.generated.models.Plan; +import com.azure.resourcemanager.compute.generated.models.PublicIpAddressSku; +import com.azure.resourcemanager.compute.generated.models.PublicIpAddressSkuName; +import com.azure.resourcemanager.compute.generated.models.PublicIpAddressSkuTier; +import com.azure.resourcemanager.compute.generated.models.PublicIpAllocationMethod; +import com.azure.resourcemanager.compute.generated.models.ScheduledEventsProfile; +import com.azure.resourcemanager.compute.generated.models.SecurityEncryptionTypes; +import com.azure.resourcemanager.compute.generated.models.SecurityProfile; +import com.azure.resourcemanager.compute.generated.models.SecurityTypes; +import com.azure.resourcemanager.compute.generated.models.SshConfiguration; +import com.azure.resourcemanager.compute.generated.models.SshPublicKey; +import com.azure.resourcemanager.compute.generated.models.StorageAccountTypes; +import com.azure.resourcemanager.compute.generated.models.StorageProfile; +import com.azure.resourcemanager.compute.generated.models.TerminateNotificationProfile; +import com.azure.resourcemanager.compute.generated.models.UefiSettings; +import com.azure.resourcemanager.compute.generated.models.VMDiskSecurityProfile; +import com.azure.resourcemanager.compute.generated.models.VMGalleryApplication; +import com.azure.resourcemanager.compute.generated.models.VMSizeProperties; +import com.azure.resourcemanager.compute.generated.models.VirtualHardDisk; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineNetworkInterfaceConfiguration; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineNetworkInterfaceIpConfiguration; +import com.azure.resourcemanager.compute.generated.models.VirtualMachinePublicIpAddressConfiguration; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineSizeTypes; +import com.azure.resourcemanager.compute.generated.models.WindowsConfiguration; +import com.azure.resourcemanager.compute.generated.models.WindowsPatchAssessmentMode; +import com.azure.resourcemanager.compute.generated.models.WindowsVMGuestPatchAutomaticByPlatformRebootSetting; +import com.azure.resourcemanager.compute.generated.models.WindowsVMGuestPatchAutomaticByPlatformSettings; +import com.azure.resourcemanager.compute.generated.models.WindowsVMGuestPatchMode; +import java.util.Arrays; + +/** Samples for VirtualMachines CreateOrUpdate. */ +public final class VirtualMachinesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_FromASharedGalleryImage.json + */ + /** + * Sample code: Create a VM from a shared gallery image. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVMFromASharedGalleryImage( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withSharedGalleryImageId( + "/SharedGalleries/sharedGalleryName/Images/sharedGalleryImageName/Versions/sharedGalleryImageVersionName")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithVMSizeProperties.json + */ + /** + * Sample code: Create a VM with VM Size Properties. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVMWithVMSizeProperties( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile( + new HardwareProfile() + .withVmSize(VirtualMachineSizeTypes.STANDARD_D4_V3) + .withVmSizeProperties(new VMSizeProperties().withVCpusAvailable(1).withVCpusPerCore(1))) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .withDiagnosticsProfile( + new DiagnosticsProfile() + .withBootDiagnostics( + new BootDiagnostics() + .withEnabled(true) + .withStorageUri("http://{existing-storage-account-name}.blob.core.windows.net"))) + .withUserData("U29tZSBDdXN0b20gRGF0YQ==") + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_PlatformImageVmWithUnmanagedOsAndDataDisks.json + */ + /** + * Sample code: Create a platform-image vm with unmanaged os and data disks. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAPlatformImageVmWithUnmanagedOsAndDataDisks( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("{vm-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D2_V2)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withVhd( + new VirtualHardDisk() + .withUri( + "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk.vhd")) + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)) + .withDataDisks( + Arrays + .asList( + new DataDisk() + .withLun(0) + .withVhd( + new VirtualHardDisk() + .withUri( + "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk0.vhd")) + .withCreateOption(DiskCreateOptionTypes.EMPTY) + .withDiskSizeGB(1023), + new DataDisk() + .withLun(1) + .withVhd( + new VirtualHardDisk() + .withUri( + "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk1.vhd")) + .withCreateOption(DiskCreateOptionTypes.EMPTY) + .withDiskSizeGB(1023)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_LinuxVmWithPatchSettingModesOfAutomaticByPlatform.json + */ + /** + * Sample code: Create a Linux vm with a patch settings patchMode and assessmentMode set to AutomaticByPlatform. + * + * @param manager Entry point to ComputeManager. + */ + public static void createALinuxVmWithAPatchSettingsPatchModeAndAssessmentModeSetToAutomaticByPlatform( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D2S_V3)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("Canonical") + .withOffer("UbuntuServer") + .withSku("16.04-LTS") + .withVersion("latest")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.PREMIUM_LRS)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder") + .withLinuxConfiguration( + new LinuxConfiguration() + .withProvisionVMAgent(true) + .withPatchSettings( + new LinuxPatchSettings() + .withPatchMode(LinuxVMGuestPatchMode.AUTOMATIC_BY_PLATFORM) + .withAssessmentMode(LinuxPatchAssessmentMode.AUTOMATIC_BY_PLATFORM)))) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithADiffOsDiskUsingDiffDiskPlacementAsCacheDisk.json + */ + /** + * Sample code: Create a vm with ephemeral os disk provisioning in Cache disk using placement property. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVmWithEphemeralOsDiskProvisioningInCacheDiskUsingPlacementProperty( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withPlan( + new Plan() + .withName("windows2016") + .withPublisher("microsoft-ads") + .withProduct("windows-data-science-vm")) + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_DS1_V2)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("microsoft-ads") + .withOffer("windows-data-science-vm") + .withSku("windows2016") + .withVersion("latest")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_ONLY) + .withDiffDiskSettings( + new DiffDiskSettings() + .withOption(DiffDiskOptions.LOCAL) + .withPlacement(DiffDiskPlacement.CACHE_DISK)) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithAMarketplaceImagePlan.json + */ + /** + * Sample code: Create a vm with a marketplace image plan. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVmWithAMarketplaceImagePlan( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withPlan( + new Plan() + .withName("windows2016") + .withPublisher("microsoft-ads") + .withProduct("windows-data-science-vm")) + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("microsoft-ads") + .withOffer("windows-data-science-vm") + .withSku("windows2016") + .withVersion("latest")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithPatchSettingModeOfAutomaticByOS.json + */ + /** + * Sample code: Create a Windows vm with a patch setting patchMode of AutomaticByOS. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAWindowsVmWithAPatchSettingPatchModeOfAutomaticByOS( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.PREMIUM_LRS)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder") + .withWindowsConfiguration( + new WindowsConfiguration() + .withProvisionVMAgent(true) + .withEnableAutomaticUpdates(true) + .withPatchSettings( + new PatchSettings().withPatchMode(WindowsVMGuestPatchMode.AUTOMATIC_BY_OS)))) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic") + .withPrimary(true)))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithPatchSettingModesOfAutomaticByPlatform.json + */ + /** + * Sample code: Create a Windows vm with patch settings patchMode and assessmentMode set to AutomaticByPlatform. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAWindowsVmWithPatchSettingsPatchModeAndAssessmentModeSetToAutomaticByPlatform( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.PREMIUM_LRS)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder") + .withWindowsConfiguration( + new WindowsConfiguration() + .withProvisionVMAgent(true) + .withEnableAutomaticUpdates(true) + .withPatchSettings( + new PatchSettings() + .withPatchMode(WindowsVMGuestPatchMode.AUTOMATIC_BY_PLATFORM) + .withAssessmentMode(WindowsPatchAssessmentMode.AUTOMATIC_BY_PLATFORM)))) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithPatchSettingAssessmentModeOfImageDefault.json + */ + /** + * Sample code: Create a Windows vm with a patch setting assessmentMode of ImageDefault. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAWindowsVmWithAPatchSettingAssessmentModeOfImageDefault( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.PREMIUM_LRS)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder") + .withWindowsConfiguration( + new WindowsConfiguration() + .withProvisionVMAgent(true) + .withEnableAutomaticUpdates(true) + .withPatchSettings( + new PatchSettings().withAssessmentMode(WindowsPatchAssessmentMode.IMAGE_DEFAULT)))) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithPremiumStorage.json + */ + /** + * Sample code: Create a vm with premium storage. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVmWithPremiumStorage(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.PREMIUM_LRS)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithCapacityReservation.json + */ + /** + * Sample code: Create or update a VM with capacity reservation. + * + * @param manager Entry point to ComputeManager. + */ + public static void createOrUpdateAVMWithCapacityReservation( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withPlan( + new Plan() + .withName("windows2016") + .withPublisher("microsoft-ads") + .withProduct("windows-data-science-vm")) + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_DS1_V2)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("microsoft-ads") + .withOffer("windows-data-science-vm") + .withSku("windows2016") + .withVersion("latest")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_ONLY) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .withCapacityReservation( + new CapacityReservationProfile() + .withCapacityReservationGroup( + new SubResource() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/CapacityReservationGroups/{crgName}"))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_LinuxVmWithPatchSettingAssessmentModeOfImageDefault.json + */ + /** + * Sample code: Create a Linux vm with a patch setting assessmentMode of ImageDefault. + * + * @param manager Entry point to ComputeManager. + */ + public static void createALinuxVmWithAPatchSettingAssessmentModeOfImageDefault( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D2S_V3)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("Canonical") + .withOffer("UbuntuServer") + .withSku("16.04-LTS") + .withVersion("latest")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.PREMIUM_LRS)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder") + .withLinuxConfiguration( + new LinuxConfiguration() + .withProvisionVMAgent(true) + .withPatchSettings( + new LinuxPatchSettings().withAssessmentMode(LinuxPatchAssessmentMode.IMAGE_DEFAULT)))) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithPatchSettingModeOfAutomaticByPlatformAndEnableHotPatchingTrue.json + */ + /** + * Sample code: Create a Windows vm with a patch setting patchMode of AutomaticByPlatform and enableHotpatching set + * to true. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAWindowsVmWithAPatchSettingPatchModeOfAutomaticByPlatformAndEnableHotpatchingSetToTrue( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.PREMIUM_LRS)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder") + .withWindowsConfiguration( + new WindowsConfiguration() + .withProvisionVMAgent(true) + .withEnableAutomaticUpdates(true) + .withPatchSettings( + new PatchSettings() + .withPatchMode(WindowsVMGuestPatchMode.AUTOMATIC_BY_PLATFORM) + .withEnableHotpatching(true)))) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithExtensionsTimeBudget.json + */ + /** + * Sample code: Create a vm with an extensions time budget. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVmWithAnExtensionsTimeBudget( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .withDiagnosticsProfile( + new DiagnosticsProfile() + .withBootDiagnostics( + new BootDiagnostics() + .withEnabled(true) + .withStorageUri("http://{existing-storage-account-name}.blob.core.windows.net"))) + .withExtensionsTimeBudget("PT30M") + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_CustomImageVmFromAnUnmanagedGeneralizedOsImage.json + */ + /** + * Sample code: Create a custom-image vm from an unmanaged generalized os image. + * + * @param manager Entry point to ComputeManager. + */ + public static void createACustomImageVmFromAnUnmanagedGeneralizedOsImage( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("{vm-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2)) + .withStorageProfile( + new StorageProfile() + .withOsDisk( + new OSDisk() + .withOsType(OperatingSystemTypes.WINDOWS) + .withName("myVMosdisk") + .withVhd( + new VirtualHardDisk() + .withUri( + "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk.vhd")) + .withImage( + new VirtualHardDisk() + .withUri( + "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/{existing-generalized-os-image-blob-name}.vhd")) + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithEncryptionAtHost.json + */ + /** + * Sample code: Create a vm with Host Encryption using encryptionAtHost property. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVmWithHostEncryptionUsingEncryptionAtHostProperty( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withPlan( + new Plan() + .withName("windows2016") + .withPublisher("microsoft-ads") + .withProduct("windows-data-science-vm")) + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_DS1_V2)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("microsoft-ads") + .withOffer("windows-data-science-vm") + .withSku("windows2016") + .withVersion("latest")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_ONLY) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .withSecurityProfile(new SecurityProfile().withEncryptionAtHost(true)) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_InAnAvailabilitySet.json + */ + /** + * Sample code: Create a vm in an availability set. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVmInAnAvailabilitySet( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .withAvailabilitySet( + new SubResource() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/availabilitySets/{existing-availability-set-name}")) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithEmptyDataDisks.json + */ + /** + * Sample code: Create a vm with empty data disks. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVmWithEmptyDataDisks(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D2_V2)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS))) + .withDataDisks( + Arrays + .asList( + new DataDisk() + .withLun(0) + .withCreateOption(DiskCreateOptionTypes.EMPTY) + .withDiskSizeGB(1023), + new DataDisk() + .withLun(1) + .withCreateOption(DiskCreateOptionTypes.EMPTY) + .withDiskSizeGB(1023)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithSecurityTypeConfidentialVM.json + */ + /** + * Sample code: Create a VM with securityType ConfidentialVM with Platform Managed Keys. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVMWithSecurityTypeConfidentialVMWithPlatformManagedKeys( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile( + new HardwareProfile().withVmSize(VirtualMachineSizeTypes.fromString("Standard_DC2as_v5"))) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("2019-datacenter-cvm") + .withSku("windows-cvm") + .withVersion("17763.2183.2109130127")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_ONLY) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_SSD_LRS) + .withSecurityProfile( + new VMDiskSecurityProfile() + .withSecurityEncryptionType( + SecurityEncryptionTypes.DISK_WITH_VMGUEST_STATE))))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .withSecurityProfile( + new SecurityProfile() + .withUefiSettings(new UefiSettings().withSecureBootEnabled(true).withVTpmEnabled(true)) + .withSecurityType(SecurityTypes.CONFIDENTIAL_VM)) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithNetworkInterfaceConfiguration.json + */ + /** + * Sample code: Create a VM with network interface configuration. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVMWithNetworkInterfaceConfiguration( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withNetworkProfile( + new NetworkProfile() + .withNetworkApiVersion(NetworkApiVersion.TWO_ZERO_TWO_ZERO_ONE_ONE_ZERO_ONE) + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineNetworkInterfaceConfiguration() + .withName("{nic-config-name}") + .withPrimary(true) + .withDeleteOption(DeleteOptions.DELETE) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineNetworkInterfaceIpConfiguration() + .withName("{ip-config-name}") + .withPrimary(true) + .withPublicIpAddressConfiguration( + new VirtualMachinePublicIpAddressConfiguration() + .withName("{publicIP-config-name}") + .withSku( + new PublicIpAddressSku() + .withName(PublicIpAddressSkuName.BASIC) + .withTier(PublicIpAddressSkuTier.GLOBAL)) + .withDeleteOption(DeleteOptions.DETACH) + .withPublicIpAllocationMethod( + PublicIpAllocationMethod.STATIC))))))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_FromACustomImage.json + */ + /** + * Sample code: Create a vm from a custom image. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVmFromACustomImage(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithHibernationEnabled.json + */ + /** + * Sample code: Create a VM with HibernationEnabled. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVMWithHibernationEnabled( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("{vm-name}") + .withRegion("eastus2euap") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D2S_V3)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2019-Datacenter") + .withVersion("latest")) + .withOsDisk( + new OSDisk() + .withName("vmOSdisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withAdditionalCapabilities(new AdditionalCapabilities().withHibernationEnabled(true)) + .withOsProfile( + new OSProfile() + .withComputerName("{vm-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .withDiagnosticsProfile( + new DiagnosticsProfile() + .withBootDiagnostics( + new BootDiagnostics() + .withEnabled(true) + .withStorageUri("http://{existing-storage-account-name}.blob.core.windows.net"))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithUefiSettings.json + */ + /** + * Sample code: Create a VM with Uefi Settings of secureBoot and vTPM. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVMWithUefiSettingsOfSecureBootAndVTPM( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D2S_V3)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("windowsserver-gen2preview-preview") + .withSku("windows10-tvm") + .withVersion("18363.592.2001092016")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_ONLY) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_SSD_LRS)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .withSecurityProfile( + new SecurityProfile() + .withUefiSettings(new UefiSettings().withSecureBootEnabled(true).withVTpmEnabled(true)) + .withSecurityType(SecurityTypes.TRUSTED_LAUNCH)) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithApplicationProfile.json + */ + /** + * Sample code: Create a vm with Application Profile. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVmWithApplicationProfile( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("{image_publisher}") + .withOffer("{image_offer}") + .withSku("{image_sku}") + .withVersion("latest")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .withApplicationProfile( + new ApplicationProfile() + .withGalleryApplications( + Arrays + .asList( + new VMGalleryApplication() + .withTags("myTag1") + .withOrder(1) + .withPackageReferenceId( + "/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdb/resourceGroups/myresourceGroupName2/providers/Microsoft.Compute/galleries/myGallery1/applications/MyApplication1/versions/1.0") + .withConfigurationReference( + "https://mystorageaccount.blob.core.windows.net/configurations/settings.config") + .withTreatFailureAsDeploymentFailure(false) + .withEnableAutomaticUpgrade(false), + new VMGalleryApplication() + .withPackageReferenceId( + "/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdg/resourceGroups/myresourceGroupName3/providers/Microsoft.Compute/galleries/myGallery2/applications/MyApplication2/versions/1.1")))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_FromASpecializedSharedImage.json + */ + /** + * Sample code: Create a vm from a specialized shared image. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVmFromASpecializedSharedImage( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithPasswordAuthentication.json + */ + /** + * Sample code: Create a vm with password authentication. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVmWithPasswordAuthentication( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_InAVmssWithCustomerAssignedPlatformFaultDomain.json + */ + /** + * Sample code: Create a vm in a Virtual Machine Scale Set with customer assigned platformFaultDomain. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVmInAVirtualMachineScaleSetWithCustomerAssignedPlatformFaultDomain( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .withVirtualMachineScaleSet( + new SubResource() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{existing-flex-vmss-name-with-platformFaultDomainCount-greater-than-1}")) + .withPlatformFaultDomain(1) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithScheduledEventsProfile.json + */ + /** + * Sample code: Create a vm with Scheduled Events Profile. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVmWithScheduledEventsProfile( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .withDiagnosticsProfile( + new DiagnosticsProfile() + .withBootDiagnostics( + new BootDiagnostics() + .withEnabled(true) + .withStorageUri("http://{existing-storage-account-name}.blob.core.windows.net"))) + .withScheduledEventsProfile( + new ScheduledEventsProfile() + .withTerminateNotificationProfile( + new TerminateNotificationProfile().withNotBeforeTimeout("PT10M").withEnable(true)) + .withOsImageNotificationProfile( + new OSImageNotificationProfile().withNotBeforeTimeout("PT15M").withEnable(true))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithBootDiagnostics.json + */ + /** + * Sample code: Create a vm with boot diagnostics. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVmWithBootDiagnostics( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .withDiagnosticsProfile( + new DiagnosticsProfile() + .withBootDiagnostics( + new BootDiagnostics() + .withEnabled(true) + .withStorageUri("http://{existing-storage-account-name}.blob.core.windows.net"))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithSshAuthentication.json + */ + /** + * Sample code: Create a vm with ssh authentication. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVmWithSshAuthentication( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("{image_publisher}") + .withOffer("{image_offer}") + .withSku("{image_sku}") + .withVersion("latest")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withLinuxConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSsh( + new SshConfiguration() + .withPublicKeys( + Arrays + .asList( + new SshPublicKey() + .withPath("/home/{your-username}/.ssh/authorized_keys") + .withKeyData("fakeTokenPlaceholder")))))) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_FromACommunityGalleryImage.json + */ + /** + * Sample code: Create a VM from a community gallery image. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVMFromACommunityGalleryImage( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withCommunityGalleryImageId( + "/CommunityGalleries/galleryPublicName/Images/communityGalleryImageName/Versions/communityGalleryImageVersionName")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithADiffOsDiskUsingDiffDiskPlacementAsResourceDisk.json + */ + /** + * Sample code: Create a vm with ephemeral os disk provisioning in Resource disk using placement property. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVmWithEphemeralOsDiskProvisioningInResourceDiskUsingPlacementProperty( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withPlan( + new Plan() + .withName("windows2016") + .withPublisher("microsoft-ads") + .withProduct("windows-data-science-vm")) + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_DS1_V2)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("microsoft-ads") + .withOffer("windows-data-science-vm") + .withSku("windows2016") + .withVersion("latest")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_ONLY) + .withDiffDiskSettings( + new DiffDiskSettings() + .withOption(DiffDiskOptions.LOCAL) + .withPlacement(DiffDiskPlacement.RESOURCE_DISK)) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithADiffOsDisk.json + */ + /** + * Sample code: Create a vm with ephemeral os disk. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVmWithEphemeralOsDisk( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withPlan( + new Plan() + .withName("windows2016") + .withPublisher("microsoft-ads") + .withProduct("windows-data-science-vm")) + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_DS1_V2)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("microsoft-ads") + .withOffer("windows-data-science-vm") + .withSku("windows2016") + .withVersion("latest")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_ONLY) + .withDiffDiskSettings(new DiffDiskSettings().withOption(DiffDiskOptions.LOCAL)) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithUserData.json + */ + /** + * Sample code: Create a VM with UserData. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVMWithUserData(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("{vm-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new OSDisk() + .withName("vmOSdisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withOsProfile( + new OSProfile() + .withComputerName("{vm-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .withDiagnosticsProfile( + new DiagnosticsProfile() + .withBootDiagnostics( + new BootDiagnostics() + .withEnabled(true) + .withStorageUri("http://{existing-storage-account-name}.blob.core.windows.net"))) + .withUserData("RXhhbXBsZSBVc2VyRGF0YQ==") + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_FromAGeneralizedSharedImage.json + */ + /** + * Sample code: Create a vm from a generalized shared image. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVmFromAGeneralizedSharedImage( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_LinuxVmWithAutomaticByPlatformSettings.json + */ + /** + * Sample code: Create a Linux vm with a patch setting patchMode of AutomaticByPlatform and + * AutomaticByPlatformSettings. + * + * @param manager Entry point to ComputeManager. + */ + public static void createALinuxVmWithAPatchSettingPatchModeOfAutomaticByPlatformAndAutomaticByPlatformSettings( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D2S_V3)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("Canonical") + .withOffer("UbuntuServer") + .withSku("16.04-LTS") + .withVersion("latest")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.PREMIUM_LRS)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder") + .withLinuxConfiguration( + new LinuxConfiguration() + .withProvisionVMAgent(true) + .withPatchSettings( + new LinuxPatchSettings() + .withPatchMode(LinuxVMGuestPatchMode.AUTOMATIC_BY_PLATFORM) + .withAssessmentMode(LinuxPatchAssessmentMode.AUTOMATIC_BY_PLATFORM) + .withAutomaticByPlatformSettings( + new LinuxVMGuestPatchAutomaticByPlatformSettings() + .withRebootSetting(LinuxVMGuestPatchAutomaticByPlatformRebootSetting.NEVER) + .withBypassPlatformSafetyChecksOnUserSchedule(true))))) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithPatchSettingModeOfManual.json + */ + /** + * Sample code: Create a Windows vm with a patch setting patchMode of Manual. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAWindowsVmWithAPatchSettingPatchModeOfManual( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.PREMIUM_LRS)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder") + .withWindowsConfiguration( + new WindowsConfiguration() + .withProvisionVMAgent(true) + .withEnableAutomaticUpdates(true) + .withPatchSettings(new PatchSettings().withPatchMode(WindowsVMGuestPatchMode.MANUAL)))) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithSecurityTypeConfidentialVMWithCustomerManagedKeys.json + */ + /** + * Sample code: Create a VM with securityType ConfidentialVM with Customer Managed Keys. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVMWithSecurityTypeConfidentialVMWithCustomerManagedKeys( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile( + new HardwareProfile().withVmSize(VirtualMachineSizeTypes.fromString("Standard_DC2as_v5"))) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("2019-datacenter-cvm") + .withSku("windows-cvm") + .withVersion("17763.2183.2109130127")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_ONLY) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_SSD_LRS) + .withSecurityProfile( + new VMDiskSecurityProfile() + .withSecurityEncryptionType(SecurityEncryptionTypes.DISK_WITH_VMGUEST_STATE) + .withDiskEncryptionSet( + new DiskEncryptionSetParameters() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}")))))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .withSecurityProfile( + new SecurityProfile() + .withUefiSettings(new UefiSettings().withSecureBootEnabled(true).withVTpmEnabled(true)) + .withSecurityType(SecurityTypes.CONFIDENTIAL_VM)) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_LinuxVmWithPatchSettingModeOfImageDefault.json + */ + /** + * Sample code: Create a Linux vm with a patch setting patchMode of ImageDefault. + * + * @param manager Entry point to ComputeManager. + */ + public static void createALinuxVmWithAPatchSettingPatchModeOfImageDefault( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D2S_V3)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("Canonical") + .withOffer("UbuntuServer") + .withSku("16.04-LTS") + .withVersion("latest")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.PREMIUM_LRS)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder") + .withLinuxConfiguration( + new LinuxConfiguration() + .withProvisionVMAgent(true) + .withPatchSettings( + new LinuxPatchSettings().withPatchMode(LinuxVMGuestPatchMode.IMAGE_DEFAULT)))) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithManagedBootDiagnostics.json + */ + /** + * Sample code: Create a vm with managed boot diagnostics. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVmWithManagedBootDiagnostics( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .withDiagnosticsProfile( + new DiagnosticsProfile().withBootDiagnostics(new BootDiagnostics().withEnabled(true))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithDiskEncryptionSetResource.json + */ + /** + * Sample code: Create a vm with DiskEncryptionSet resource id in the os disk and data disk. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVmWithDiskEncryptionSetResourceIdInTheOsDiskAndDataDisk( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS) + .withDiskEncryptionSet( + new DiskEncryptionSetParameters() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}")))) + .withDataDisks( + Arrays + .asList( + new DataDisk() + .withLun(0) + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.EMPTY) + .withDiskSizeGB(1023) + .withManagedDisk( + new ManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS) + .withDiskEncryptionSet( + new DiskEncryptionSetParameters() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"))), + new DataDisk() + .withLun(1) + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.ATTACH) + .withDiskSizeGB(1023) + .withManagedDisk( + new ManagedDiskParameters() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/{existing-managed-disk-name}") + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS) + .withDiskEncryptionSet( + new DiskEncryptionSetParameters() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}")))))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithDiskControllerType.json + */ + /** + * Sample code: Create a VM with Disk Controller Type. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVMWithDiskControllerType( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D4_V3)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS))) + .withDiskControllerType(DiskControllerTypes.NVME)) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .withDiagnosticsProfile( + new DiagnosticsProfile() + .withBootDiagnostics( + new BootDiagnostics() + .withEnabled(true) + .withStorageUri("http://{existing-storage-account-name}.blob.core.windows.net"))) + .withUserData("U29tZSBDdXN0b20gRGF0YQ==") + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithAutomaticByPlatformSettings.json + */ + /** + * Sample code: Create a Windows vm with a patch setting patchMode of AutomaticByPlatform and + * AutomaticByPlatformSettings. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAWindowsVmWithAPatchSettingPatchModeOfAutomaticByPlatformAndAutomaticByPlatformSettings( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.PREMIUM_LRS)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder") + .withWindowsConfiguration( + new WindowsConfiguration() + .withProvisionVMAgent(true) + .withEnableAutomaticUpdates(true) + .withPatchSettings( + new PatchSettings() + .withPatchMode(WindowsVMGuestPatchMode.AUTOMATIC_BY_PLATFORM) + .withAssessmentMode(WindowsPatchAssessmentMode.AUTOMATIC_BY_PLATFORM) + .withAutomaticByPlatformSettings( + new WindowsVMGuestPatchAutomaticByPlatformSettings() + .withRebootSetting( + WindowsVMGuestPatchAutomaticByPlatformRebootSetting.NEVER) + .withBypassPlatformSafetyChecksOnUserSchedule(false))))) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .create(); + } +} +``` + +### VirtualMachines_Deallocate + +```java +/** Samples for VirtualMachines Deallocate. */ +public final class VirtualMachinesDeallocateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Deallocate_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachine_Deallocate_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineDeallocateMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachines().deallocate("rgcompute", "aaaaaaaaaa", true, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Deallocate_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachine_Deallocate_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineDeallocateMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachines().deallocate("rgcompute", "aaaaaaaaaaaaaaaa", null, com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachines_Delete + +```java +/** Samples for VirtualMachines Delete. */ +public final class VirtualMachinesDeleteSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Delete_Force.json + */ + /** + * Sample code: Force delete a VM. + * + * @param manager Entry point to ComputeManager. + */ + public static void forceDeleteAVM(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachines().delete("myResourceGroup", "myVM", true, com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachines_Generalize + +```java +/** Samples for VirtualMachines Generalize. */ +public final class VirtualMachinesGeneralizeSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Generalize.json + */ + /** + * Sample code: Generalize a Virtual Machine. + * + * @param manager Entry point to ComputeManager. + */ + public static void generalizeAVirtualMachine(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .generalizeWithResponse("myResourceGroup", "myVMName", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachines_GetByResourceGroup + +```java +import com.azure.resourcemanager.compute.generated.models.InstanceViewTypes; + +/** Samples for VirtualMachines GetByResourceGroup. */ +public final class VirtualMachinesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Get_WithVMSizeProperties.json + */ + /** + * Sample code: Get a virtual machine with VM Size Properties. + * + * @param manager Entry point to ComputeManager. + */ + public static void getAVirtualMachineWithVMSizeProperties( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .getByResourceGroupWithResponse("myResourceGroup", "myVM", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Get_AutoPlacedOnDedicatedHostGroup.json + */ + /** + * Sample code: Get a virtual machine placed on a dedicated host group through automatic placement. + * + * @param manager Entry point to ComputeManager. + */ + public static void getAVirtualMachinePlacedOnADedicatedHostGroupThroughAutomaticPlacement( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .getByResourceGroupWithResponse("myResourceGroup", "myVM", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Get_WithDiskControllerType.json + */ + /** + * Sample code: Get a virtual machine with Disk Controller Type Properties. + * + * @param manager Entry point to ComputeManager. + */ + public static void getAVirtualMachineWithDiskControllerTypeProperties( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .getByResourceGroupWithResponse( + "myResourceGroup", "myVM", InstanceViewTypes.USER_DATA, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Get.json + */ + /** + * Sample code: Get a Virtual Machine. + * + * @param manager Entry point to ComputeManager. + */ + public static void getAVirtualMachine(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .getByResourceGroupWithResponse( + "myResourceGroup", "myVM", InstanceViewTypes.USER_DATA, com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachines_InstallPatches + +```java +import com.azure.resourcemanager.compute.generated.models.VMGuestPatchClassificationWindows; +import com.azure.resourcemanager.compute.generated.models.VMGuestPatchRebootSetting; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineInstallPatchesParameters; +import com.azure.resourcemanager.compute.generated.models.WindowsParameters; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** Samples for VirtualMachines InstallPatches. */ +public final class VirtualMachinesInstallPatchesSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_InstallPatches.json + */ + /** + * Sample code: Install patch state of a virtual machine. + * + * @param manager Entry point to ComputeManager. + */ + public static void installPatchStateOfAVirtualMachine( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .installPatches( + "myResourceGroupName", + "myVMName", + new VirtualMachineInstallPatchesParameters() + .withMaximumDuration("PT4H") + .withRebootSetting(VMGuestPatchRebootSetting.IF_REQUIRED) + .withWindowsParameters( + new WindowsParameters() + .withClassificationsToInclude( + Arrays + .asList( + VMGuestPatchClassificationWindows.CRITICAL, + VMGuestPatchClassificationWindows.SECURITY)) + .withMaxPatchPublishDate(OffsetDateTime.parse("2020-11-19T02:36:43.0539904+00:00"))), + com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachines_InstanceView + +```java +/** Samples for VirtualMachines InstanceView. */ +public final class VirtualMachinesInstanceViewSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Get_InstanceView.json + */ + /** + * Sample code: Get Virtual Machine Instance View. + * + * @param manager Entry point to ComputeManager. + */ + public static void getVirtualMachineInstanceView( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachines().instanceViewWithResponse("myResourceGroup", "myVM", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Get_InstanceViewAutoPlacedOnDedicatedHostGroup.json + */ + /** + * Sample code: Get instance view of a virtual machine placed on a dedicated host group through automatic placement. + * + * @param manager Entry point to ComputeManager. + */ + public static void getInstanceViewOfAVirtualMachinePlacedOnADedicatedHostGroupThroughAutomaticPlacement( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachines().instanceViewWithResponse("myResourceGroup", "myVM", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachines_List + +```java +/** Samples for VirtualMachines List. */ +public final class VirtualMachinesListSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_ListAll_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachine_ListAll_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineListAllMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachines().list(null, null, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_ListAll_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachine_ListAll_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineListAllMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .list("aaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaa", null, com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachines_ListAvailableSizes + +```java +/** Samples for VirtualMachines ListAvailableSizes. */ +public final class VirtualMachinesListAvailableSizesSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_ListAvailableVmSizes.json + */ + /** + * Sample code: Lists all available virtual machine sizes to which the specified virtual machine can be resized. + * + * @param manager Entry point to ComputeManager. + */ + public static void listsAllAvailableVirtualMachineSizesToWhichTheSpecifiedVirtualMachineCanBeResized( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachines().listAvailableSizes("myResourceGroup", "myVmName", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachines_ListByLocation + +```java +/** Samples for VirtualMachines ListByLocation. */ +public final class VirtualMachinesListByLocationSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_ListBySubscription_ByLocation.json + */ + /** + * Sample code: Lists all the virtual machines under the specified subscription for the specified location. + * + * @param manager Entry point to ComputeManager. + */ + public static void listsAllTheVirtualMachinesUnderTheSpecifiedSubscriptionForTheSpecifiedLocation( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachines().listByLocation("eastus", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachines_ListByResourceGroup + +```java +/** Samples for VirtualMachines ListByResourceGroup. */ +public final class VirtualMachinesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_List_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachine_List_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineListMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .listByResourceGroup("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaa", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_List_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachine_List_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineListMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachines().listByResourceGroup("rgcompute", null, null, com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachines_PerformMaintenance + +```java +/** Samples for VirtualMachines PerformMaintenance. */ +public final class VirtualMachinesPerformMaintenanceSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_PerformMaintenance_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachine_PerformMaintenance_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachinePerformMaintenanceMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachines().performMaintenance("rgcompute", "aaaaaaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_PerformMaintenance_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachine_PerformMaintenance_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachinePerformMaintenanceMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachines().performMaintenance("rgcompute", "aaaaaaaaaa", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachines_PowerOff + +```java +/** Samples for VirtualMachines PowerOff. */ +public final class VirtualMachinesPowerOffSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_PowerOff_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachine_PowerOff_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachinePowerOffMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachines().powerOff("rgcompute", "aaaaaaaaaaaaaaaaaa", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_PowerOff_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachine_PowerOff_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachinePowerOffMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .powerOff("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaa", true, com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachines_Reapply + +```java +/** Samples for VirtualMachines Reapply. */ +public final class VirtualMachinesReapplySamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Reapply.json + */ + /** + * Sample code: Reapply the state of a virtual machine. + * + * @param manager Entry point to ComputeManager. + */ + public static void reapplyTheStateOfAVirtualMachine( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachines().reapply("ResourceGroup", "VMName", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachines_Redeploy + +```java +/** Samples for VirtualMachines Redeploy. */ +public final class VirtualMachinesRedeploySamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Redeploy_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachine_Redeploy_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineRedeployMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachines().redeploy("rgcompute", "aaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Redeploy_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachine_Redeploy_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineRedeployMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachines().redeploy("rgcompute", "a", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachines_Reimage + +```java +import com.azure.resourcemanager.compute.generated.models.OSProfileProvisioningData; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineReimageParameters; + +/** Samples for VirtualMachines Reimage. */ +public final class VirtualMachinesReimageSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Reimage.json + */ + /** + * Sample code: Reimage a Virtual Machine. + * + * @param manager Entry point to ComputeManager. + */ + public static void reimageAVirtualMachine(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .reimage( + "myResourceGroup", + "myVMName", + new VirtualMachineReimageParameters().withTempDisk(true), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Reimage_NonEphemeralVMs.json + */ + /** + * Sample code: Reimage a Non-Ephemeral Virtual Machine. + * + * @param manager Entry point to ComputeManager. + */ + public static void reimageANonEphemeralVirtualMachine( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .reimage( + "myResourceGroup", + "myVMName", + new VirtualMachineReimageParameters() + .withTempDisk(true) + .withExactVersion("aaaaaa") + .withOsProfile( + new OSProfileProvisioningData() + .withAdminPassword("fakeTokenPlaceholder") + .withCustomData("{your-custom-data}")), + com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachines_Restart + +```java +/** Samples for VirtualMachines Restart. */ +public final class VirtualMachinesRestartSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Restart_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachine_Restart_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineRestartMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachines().restart("rgcompute", "aaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Restart_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachine_Restart_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineRestartMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachines().restart("rgcompute", "aaaaaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachines_RetrieveBootDiagnosticsData + +```java +/** Samples for VirtualMachines RetrieveBootDiagnosticsData. */ +public final class VirtualMachinesRetrieveBootDiagnosticsDataSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_RetrieveBootDiagnosticsData.json + */ + /** + * Sample code: RetrieveBootDiagnosticsData of a virtual machine. + * + * @param manager Entry point to ComputeManager. + */ + public static void retrieveBootDiagnosticsDataOfAVirtualMachine( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .retrieveBootDiagnosticsDataWithResponse("ResourceGroup", "VMName", 60, com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachines_RunCommand + +```java +import com.azure.resourcemanager.compute.generated.models.RunCommandInput; + +/** Samples for VirtualMachines RunCommand. */ +public final class VirtualMachinesRunCommandSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/runCommandExamples/VirtualMachineRunCommand.json + */ + /** + * Sample code: VirtualMachineRunCommand. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineRunCommand(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .runCommand( + "crptestar98131", + "vm3036", + new RunCommandInput().withCommandId("RunPowerShellScript"), + com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachines_SimulateEviction + +```java +/** Samples for VirtualMachines SimulateEviction. */ +public final class VirtualMachinesSimulateEvictionSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_SimulateEviction.json + */ + /** + * Sample code: Simulate Eviction a virtual machine. + * + * @param manager Entry point to ComputeManager. + */ + public static void simulateEvictionAVirtualMachine( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .simulateEvictionWithResponse("ResourceGroup", "VMName", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachines_Start + +```java +/** Samples for VirtualMachines Start. */ +public final class VirtualMachinesStartSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Start_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachine_Start_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineStartMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachines().start("rgcompute", "aaaaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Start_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachine_Start_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineStartMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachines().start("rgcompute", "aaaaaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachines_Update + +```java +import com.azure.resourcemanager.compute.generated.models.CachingTypes; +import com.azure.resourcemanager.compute.generated.models.DataDisk; +import com.azure.resourcemanager.compute.generated.models.DiskCreateOptionTypes; +import com.azure.resourcemanager.compute.generated.models.DiskDetachOptionTypes; +import com.azure.resourcemanager.compute.generated.models.HardwareProfile; +import com.azure.resourcemanager.compute.generated.models.ImageReference; +import com.azure.resourcemanager.compute.generated.models.ManagedDiskParameters; +import com.azure.resourcemanager.compute.generated.models.NetworkInterfaceReference; +import com.azure.resourcemanager.compute.generated.models.NetworkProfile; +import com.azure.resourcemanager.compute.generated.models.OSDisk; +import com.azure.resourcemanager.compute.generated.models.OSProfile; +import com.azure.resourcemanager.compute.generated.models.StorageAccountTypes; +import com.azure.resourcemanager.compute.generated.models.StorageProfile; +import com.azure.resourcemanager.compute.generated.models.VirtualMachine; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineSizeTypes; +import java.util.Arrays; + +/** Samples for VirtualMachines Update. */ +public final class VirtualMachinesUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Update_DetachDataDiskUsingToBeDetachedProperty.json + */ + /** + * Sample code: Update a VM by detaching data disk. + * + * @param manager Entry point to ComputeManager. + */ + public static void updateAVMByDetachingDataDisk( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + VirtualMachine resource = + manager + .virtualMachines() + .getByResourceGroupWithResponse("myResourceGroup", "myVM", null, com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D2_V2)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS))) + .withDataDisks( + Arrays + .asList( + new DataDisk() + .withLun(0) + .withCreateOption(DiskCreateOptionTypes.EMPTY) + .withDiskSizeGB(1023) + .withToBeDetached(true), + new DataDisk() + .withLun(1) + .withCreateOption(DiskCreateOptionTypes.EMPTY) + .withDiskSizeGB(1023) + .withToBeDetached(false)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .apply(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Update_ForceDetachDataDisk.json + */ + /** + * Sample code: Update a VM by force-detaching data disk. + * + * @param manager Entry point to ComputeManager. + */ + public static void updateAVMByForceDetachingDataDisk( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + VirtualMachine resource = + manager + .virtualMachines() + .getByResourceGroupWithResponse("myResourceGroup", "myVM", null, com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D2_V2)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS))) + .withDataDisks( + Arrays + .asList( + new DataDisk() + .withLun(0) + .withCreateOption(DiskCreateOptionTypes.EMPTY) + .withDiskSizeGB(1023) + .withToBeDetached(true) + .withDetachOption(DiskDetachOptionTypes.FORCE_DETACH), + new DataDisk() + .withLun(1) + .withCreateOption(DiskCreateOptionTypes.EMPTY) + .withDiskSizeGB(1023) + .withToBeDetached(false)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .apply(); + } +} +``` + 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..9184f8ef2080e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/pom.xml @@ -0,0 +1,61 @@ + + + 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-2023-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 + 0 + 0 + + + + com.azure + azure-core + 1.38.0 + + + com.azure + azure-core-management + 1.11.0 + + + 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..62b532e62359f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/ComputeManager.java @@ -0,0 +1,1074 @@ +// Copyright (c) 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.HttpPipelinePosition; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.ComputeManagementClient; +import com.azure.resourcemanager.compute.generated.implementation.AvailabilitySetsImpl; +import com.azure.resourcemanager.compute.generated.implementation.CapacityReservationGroupsImpl; +import com.azure.resourcemanager.compute.generated.implementation.CapacityReservationsImpl; +import com.azure.resourcemanager.compute.generated.implementation.CloudServiceOperatingSystemsImpl; +import com.azure.resourcemanager.compute.generated.implementation.CloudServiceRoleInstancesImpl; +import com.azure.resourcemanager.compute.generated.implementation.CloudServiceRolesImpl; +import com.azure.resourcemanager.compute.generated.implementation.CloudServicesImpl; +import com.azure.resourcemanager.compute.generated.implementation.CloudServicesUpdateDomainsImpl; +import com.azure.resourcemanager.compute.generated.implementation.CommunityGalleriesImpl; +import com.azure.resourcemanager.compute.generated.implementation.CommunityGalleryImageVersionsImpl; +import com.azure.resourcemanager.compute.generated.implementation.CommunityGalleryImagesImpl; +import com.azure.resourcemanager.compute.generated.implementation.ComputeManagementClientBuilder; +import com.azure.resourcemanager.compute.generated.implementation.DedicatedHostGroupsImpl; +import com.azure.resourcemanager.compute.generated.implementation.DedicatedHostsImpl; +import com.azure.resourcemanager.compute.generated.implementation.DiskAccessesImpl; +import com.azure.resourcemanager.compute.generated.implementation.DiskEncryptionSetsImpl; +import com.azure.resourcemanager.compute.generated.implementation.DiskRestorePointsImpl; +import com.azure.resourcemanager.compute.generated.implementation.DisksImpl; +import com.azure.resourcemanager.compute.generated.implementation.GalleriesImpl; +import com.azure.resourcemanager.compute.generated.implementation.GalleryApplicationVersionsImpl; +import com.azure.resourcemanager.compute.generated.implementation.GalleryApplicationsImpl; +import com.azure.resourcemanager.compute.generated.implementation.GalleryImageVersionsImpl; +import com.azure.resourcemanager.compute.generated.implementation.GalleryImagesImpl; +import com.azure.resourcemanager.compute.generated.implementation.GallerySharingProfilesImpl; +import com.azure.resourcemanager.compute.generated.implementation.ImagesImpl; +import com.azure.resourcemanager.compute.generated.implementation.LogAnalyticsImpl; +import com.azure.resourcemanager.compute.generated.implementation.OperationsImpl; +import com.azure.resourcemanager.compute.generated.implementation.ProximityPlacementGroupsImpl; +import com.azure.resourcemanager.compute.generated.implementation.ResourceSkusImpl; +import com.azure.resourcemanager.compute.generated.implementation.RestorePointCollectionsImpl; +import com.azure.resourcemanager.compute.generated.implementation.RestorePointsImpl; +import com.azure.resourcemanager.compute.generated.implementation.SharedGalleriesImpl; +import com.azure.resourcemanager.compute.generated.implementation.SharedGalleryImageVersionsImpl; +import com.azure.resourcemanager.compute.generated.implementation.SharedGalleryImagesImpl; +import com.azure.resourcemanager.compute.generated.implementation.SnapshotsImpl; +import com.azure.resourcemanager.compute.generated.implementation.SshPublicKeysImpl; +import com.azure.resourcemanager.compute.generated.implementation.UsagesImpl; +import com.azure.resourcemanager.compute.generated.implementation.VirtualMachineExtensionImagesImpl; +import com.azure.resourcemanager.compute.generated.implementation.VirtualMachineExtensionsImpl; +import com.azure.resourcemanager.compute.generated.implementation.VirtualMachineImagesEdgeZonesImpl; +import com.azure.resourcemanager.compute.generated.implementation.VirtualMachineImagesImpl; +import com.azure.resourcemanager.compute.generated.implementation.VirtualMachineRunCommandsImpl; +import com.azure.resourcemanager.compute.generated.implementation.VirtualMachineScaleSetExtensionsImpl; +import com.azure.resourcemanager.compute.generated.implementation.VirtualMachineScaleSetRollingUpgradesImpl; +import com.azure.resourcemanager.compute.generated.implementation.VirtualMachineScaleSetVMExtensionsImpl; +import com.azure.resourcemanager.compute.generated.implementation.VirtualMachineScaleSetVMRunCommandsImpl; +import com.azure.resourcemanager.compute.generated.implementation.VirtualMachineScaleSetVMsImpl; +import com.azure.resourcemanager.compute.generated.implementation.VirtualMachineScaleSetsImpl; +import com.azure.resourcemanager.compute.generated.implementation.VirtualMachineSizesImpl; +import com.azure.resourcemanager.compute.generated.implementation.VirtualMachinesImpl; +import com.azure.resourcemanager.compute.generated.models.AvailabilitySets; +import com.azure.resourcemanager.compute.generated.models.CapacityReservationGroups; +import com.azure.resourcemanager.compute.generated.models.CapacityReservations; +import com.azure.resourcemanager.compute.generated.models.CloudServiceOperatingSystems; +import com.azure.resourcemanager.compute.generated.models.CloudServiceRoleInstances; +import com.azure.resourcemanager.compute.generated.models.CloudServiceRoles; +import com.azure.resourcemanager.compute.generated.models.CloudServices; +import com.azure.resourcemanager.compute.generated.models.CloudServicesUpdateDomains; +import com.azure.resourcemanager.compute.generated.models.CommunityGalleries; +import com.azure.resourcemanager.compute.generated.models.CommunityGalleryImageVersions; +import com.azure.resourcemanager.compute.generated.models.CommunityGalleryImages; +import com.azure.resourcemanager.compute.generated.models.DedicatedHostGroups; +import com.azure.resourcemanager.compute.generated.models.DedicatedHosts; +import com.azure.resourcemanager.compute.generated.models.DiskAccesses; +import com.azure.resourcemanager.compute.generated.models.DiskEncryptionSets; +import com.azure.resourcemanager.compute.generated.models.DiskRestorePoints; +import com.azure.resourcemanager.compute.generated.models.Disks; +import com.azure.resourcemanager.compute.generated.models.Galleries; +import com.azure.resourcemanager.compute.generated.models.GalleryApplicationVersions; +import com.azure.resourcemanager.compute.generated.models.GalleryApplications; +import com.azure.resourcemanager.compute.generated.models.GalleryImageVersions; +import com.azure.resourcemanager.compute.generated.models.GalleryImages; +import com.azure.resourcemanager.compute.generated.models.GallerySharingProfiles; +import com.azure.resourcemanager.compute.generated.models.Images; +import com.azure.resourcemanager.compute.generated.models.LogAnalytics; +import com.azure.resourcemanager.compute.generated.models.Operations; +import com.azure.resourcemanager.compute.generated.models.ProximityPlacementGroups; +import com.azure.resourcemanager.compute.generated.models.ResourceSkus; +import com.azure.resourcemanager.compute.generated.models.RestorePointCollections; +import com.azure.resourcemanager.compute.generated.models.RestorePoints; +import com.azure.resourcemanager.compute.generated.models.SharedGalleries; +import com.azure.resourcemanager.compute.generated.models.SharedGalleryImageVersions; +import com.azure.resourcemanager.compute.generated.models.SharedGalleryImages; +import com.azure.resourcemanager.compute.generated.models.Snapshots; +import com.azure.resourcemanager.compute.generated.models.SshPublicKeys; +import com.azure.resourcemanager.compute.generated.models.Usages; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineExtensionImages; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineExtensions; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineImages; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineImagesEdgeZones; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineRunCommands; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetExtensions; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetRollingUpgrades; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMExtensions; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMRunCommands; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMs; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSets; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineSizes; +import com.azure.resourcemanager.compute.generated.models.VirtualMachines; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + +/** Entry point to ComputeManager. Compute Client. */ +public final class ComputeManager { + private Operations operations; + + private Usages usages; + + private VirtualMachineSizes virtualMachineSizes; + + private VirtualMachineScaleSets virtualMachineScaleSets; + + private VirtualMachineScaleSetExtensions virtualMachineScaleSetExtensions; + + private VirtualMachineScaleSetRollingUpgrades virtualMachineScaleSetRollingUpgrades; + + private VirtualMachineScaleSetVMExtensions virtualMachineScaleSetVMExtensions; + + private VirtualMachineScaleSetVMs virtualMachineScaleSetVMs; + + private VirtualMachineExtensions virtualMachineExtensions; + + private VirtualMachines virtualMachines; + + private VirtualMachineImages virtualMachineImages; + + private VirtualMachineImagesEdgeZones virtualMachineImagesEdgeZones; + + private VirtualMachineExtensionImages virtualMachineExtensionImages; + + private AvailabilitySets availabilitySets; + + private ProximityPlacementGroups proximityPlacementGroups; + + private DedicatedHostGroups dedicatedHostGroups; + + private DedicatedHosts dedicatedHosts; + + private SshPublicKeys sshPublicKeys; + + private Images images; + + private RestorePointCollections restorePointCollections; + + private RestorePoints restorePoints; + + private CapacityReservationGroups capacityReservationGroups; + + private CapacityReservations capacityReservations; + + private LogAnalytics logAnalytics; + + private VirtualMachineRunCommands virtualMachineRunCommands; + + private VirtualMachineScaleSetVMRunCommands virtualMachineScaleSetVMRunCommands; + + private Disks disks; + + private DiskAccesses diskAccesses; + + private DiskEncryptionSets diskEncryptionSets; + + private DiskRestorePoints diskRestorePoints; + + private Snapshots snapshots; + + private ResourceSkus resourceSkus; + + 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 CommunityGalleries communityGalleries; + + private CommunityGalleryImages communityGalleryImages; + + private CommunityGalleryImageVersions communityGalleryImageVersions; + + private CloudServiceRoleInstances cloudServiceRoleInstances; + + private CloudServiceRoles cloudServiceRoles; + + private CloudServices cloudServices; + + private CloudServicesUpdateDomains cloudServicesUpdateDomains; + + private CloudServiceOperatingSystems cloudServiceOperatingSystems; + + private final ComputeManagementClient clientObject; + + private ComputeManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = + new ComputeManagementClientBuilder() + .pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of Compute service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Compute service API instance. + */ + public static ComputeManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return configure().authenticate(credential, profile); + } + + /** + * Creates an instance of Compute service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the Compute service API instance. + */ + public static ComputeManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new ComputeManager(httpPipeline, profile, null); + } + + /** + * 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 static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + + private HttpClient httpClient; + private HttpLogOptions httpLogOptions; + private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); + private RetryPolicy retryPolicy; + private RetryOptions retryOptions; + private Duration defaultPollInterval; + + private Configurable() { + } + + /** + * Sets the http client. + * + * @param httpClient the HTTP client. + * @return the configurable object itself. + */ + public Configurable withHttpClient(HttpClient httpClient) { + this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); + return this; + } + + /** + * Sets the logging options to the HTTP pipeline. + * + * @param httpLogOptions the HTTP log options. + * @return the configurable object itself. + */ + public Configurable withLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); + return this; + } + + /** + * Adds the pipeline policy to the HTTP pipeline. + * + * @param policy the HTTP pipeline policy. + * @return the configurable object itself. + */ + public Configurable withPolicy(HttpPipelinePolicy policy) { + this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); + return this; + } + + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + + /** + * Sets the retry policy to the HTTP pipeline. + * + * @param retryPolicy the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); + return this; + } + + /** + * Sets the retry options for the HTTP pipeline retry policy. + * + *

This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + * + * @param retryOptions the retry options for the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryOptions(RetryOptions retryOptions) { + this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' 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, "'defaultPollInterval' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of Compute service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Compute service API instance. + */ + public ComputeManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + + StringBuilder userAgentBuilder = new StringBuilder(); + userAgentBuilder + .append("azsdk-java") + .append("-") + .append("com.azure.resourcemanager.compute.generated") + .append("/") + .append("1.0.0-beta.1"); + if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { + userAgentBuilder + .append(" (") + .append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.name")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")) + .append("; auto-generated)"); + } else { + userAgentBuilder.append(" (auto-generated)"); + } + + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } + if (retryPolicy == null) { + if (retryOptions != null) { + retryPolicy = new RetryPolicy(retryOptions); + } else { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new AddHeadersFromContextPolicy()); + policies.add(new RequestIdPolicy()); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); + 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); + } + } + + /** + * Gets the resource collection API of Operations. + * + * @return Resource collection API of Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** + * Gets the resource collection API of Usages. + * + * @return Resource collection API of Usages. + */ + public Usages usages() { + if (this.usages == null) { + this.usages = new UsagesImpl(clientObject.getUsages(), this); + } + return usages; + } + + /** + * Gets the resource collection API of VirtualMachineSizes. + * + * @return Resource collection API of VirtualMachineSizes. + */ + public VirtualMachineSizes virtualMachineSizes() { + if (this.virtualMachineSizes == null) { + this.virtualMachineSizes = new VirtualMachineSizesImpl(clientObject.getVirtualMachineSizes(), this); + } + return virtualMachineSizes; + } + + /** + * Gets the resource collection API of VirtualMachineScaleSets. It manages VirtualMachineScaleSet. + * + * @return Resource collection API of VirtualMachineScaleSets. + */ + public VirtualMachineScaleSets virtualMachineScaleSets() { + if (this.virtualMachineScaleSets == null) { + this.virtualMachineScaleSets = + new VirtualMachineScaleSetsImpl(clientObject.getVirtualMachineScaleSets(), this); + } + return virtualMachineScaleSets; + } + + /** + * Gets the resource collection API of VirtualMachineScaleSetExtensions. It manages VirtualMachineScaleSetExtension. + * + * @return Resource collection API of VirtualMachineScaleSetExtensions. + */ + public VirtualMachineScaleSetExtensions virtualMachineScaleSetExtensions() { + if (this.virtualMachineScaleSetExtensions == null) { + this.virtualMachineScaleSetExtensions = + new VirtualMachineScaleSetExtensionsImpl(clientObject.getVirtualMachineScaleSetExtensions(), this); + } + return virtualMachineScaleSetExtensions; + } + + /** + * Gets the resource collection API of VirtualMachineScaleSetRollingUpgrades. + * + * @return Resource collection API of VirtualMachineScaleSetRollingUpgrades. + */ + public VirtualMachineScaleSetRollingUpgrades virtualMachineScaleSetRollingUpgrades() { + if (this.virtualMachineScaleSetRollingUpgrades == null) { + this.virtualMachineScaleSetRollingUpgrades = + new VirtualMachineScaleSetRollingUpgradesImpl( + clientObject.getVirtualMachineScaleSetRollingUpgrades(), this); + } + return virtualMachineScaleSetRollingUpgrades; + } + + /** + * Gets the resource collection API of VirtualMachineScaleSetVMExtensions. It manages + * VirtualMachineScaleSetVMExtension. + * + * @return Resource collection API of VirtualMachineScaleSetVMExtensions. + */ + public VirtualMachineScaleSetVMExtensions virtualMachineScaleSetVMExtensions() { + if (this.virtualMachineScaleSetVMExtensions == null) { + this.virtualMachineScaleSetVMExtensions = + new VirtualMachineScaleSetVMExtensionsImpl(clientObject.getVirtualMachineScaleSetVMExtensions(), this); + } + return virtualMachineScaleSetVMExtensions; + } + + /** + * Gets the resource collection API of VirtualMachineScaleSetVMs. + * + * @return Resource collection API of VirtualMachineScaleSetVMs. + */ + public VirtualMachineScaleSetVMs virtualMachineScaleSetVMs() { + if (this.virtualMachineScaleSetVMs == null) { + this.virtualMachineScaleSetVMs = + new VirtualMachineScaleSetVMsImpl(clientObject.getVirtualMachineScaleSetVMs(), this); + } + return virtualMachineScaleSetVMs; + } + + /** + * Gets the resource collection API of VirtualMachineExtensions. It manages VirtualMachineExtension. + * + * @return Resource collection API of VirtualMachineExtensions. + */ + public VirtualMachineExtensions virtualMachineExtensions() { + if (this.virtualMachineExtensions == null) { + this.virtualMachineExtensions = + new VirtualMachineExtensionsImpl(clientObject.getVirtualMachineExtensions(), this); + } + return virtualMachineExtensions; + } + + /** + * Gets the resource collection API of VirtualMachines. It manages VirtualMachine. + * + * @return Resource collection API of VirtualMachines. + */ + public VirtualMachines virtualMachines() { + if (this.virtualMachines == null) { + this.virtualMachines = new VirtualMachinesImpl(clientObject.getVirtualMachines(), this); + } + return virtualMachines; + } + + /** + * Gets the resource collection API of VirtualMachineImages. + * + * @return Resource collection API of VirtualMachineImages. + */ + public VirtualMachineImages virtualMachineImages() { + if (this.virtualMachineImages == null) { + this.virtualMachineImages = new VirtualMachineImagesImpl(clientObject.getVirtualMachineImages(), this); + } + return virtualMachineImages; + } + + /** + * Gets the resource collection API of VirtualMachineImagesEdgeZones. + * + * @return Resource collection API of VirtualMachineImagesEdgeZones. + */ + public VirtualMachineImagesEdgeZones virtualMachineImagesEdgeZones() { + if (this.virtualMachineImagesEdgeZones == null) { + this.virtualMachineImagesEdgeZones = + new VirtualMachineImagesEdgeZonesImpl(clientObject.getVirtualMachineImagesEdgeZones(), this); + } + return virtualMachineImagesEdgeZones; + } + + /** + * Gets the resource collection API of VirtualMachineExtensionImages. + * + * @return Resource collection API of VirtualMachineExtensionImages. + */ + public VirtualMachineExtensionImages virtualMachineExtensionImages() { + if (this.virtualMachineExtensionImages == null) { + this.virtualMachineExtensionImages = + new VirtualMachineExtensionImagesImpl(clientObject.getVirtualMachineExtensionImages(), this); + } + return virtualMachineExtensionImages; + } + + /** + * Gets the resource collection API of AvailabilitySets. It manages AvailabilitySet. + * + * @return Resource collection API of AvailabilitySets. + */ + public AvailabilitySets availabilitySets() { + if (this.availabilitySets == null) { + this.availabilitySets = new AvailabilitySetsImpl(clientObject.getAvailabilitySets(), this); + } + return availabilitySets; + } + + /** + * Gets the resource collection API of ProximityPlacementGroups. It manages ProximityPlacementGroup. + * + * @return Resource collection API of ProximityPlacementGroups. + */ + public ProximityPlacementGroups proximityPlacementGroups() { + if (this.proximityPlacementGroups == null) { + this.proximityPlacementGroups = + new ProximityPlacementGroupsImpl(clientObject.getProximityPlacementGroups(), this); + } + return proximityPlacementGroups; + } + + /** + * Gets the resource collection API of DedicatedHostGroups. It manages DedicatedHostGroup. + * + * @return Resource collection API of DedicatedHostGroups. + */ + public DedicatedHostGroups dedicatedHostGroups() { + if (this.dedicatedHostGroups == null) { + this.dedicatedHostGroups = new DedicatedHostGroupsImpl(clientObject.getDedicatedHostGroups(), this); + } + return dedicatedHostGroups; + } + + /** + * Gets the resource collection API of DedicatedHosts. It manages DedicatedHost. + * + * @return Resource collection API of DedicatedHosts. + */ + public DedicatedHosts dedicatedHosts() { + if (this.dedicatedHosts == null) { + this.dedicatedHosts = new DedicatedHostsImpl(clientObject.getDedicatedHosts(), this); + } + return dedicatedHosts; + } + + /** + * Gets the resource collection API of SshPublicKeys. It manages SshPublicKeyResource. + * + * @return Resource collection API of SshPublicKeys. + */ + public SshPublicKeys sshPublicKeys() { + if (this.sshPublicKeys == null) { + this.sshPublicKeys = new SshPublicKeysImpl(clientObject.getSshPublicKeys(), this); + } + return sshPublicKeys; + } + + /** + * Gets the resource collection API of Images. It manages Image. + * + * @return Resource collection API of Images. + */ + public Images images() { + if (this.images == null) { + this.images = new ImagesImpl(clientObject.getImages(), this); + } + return images; + } + + /** + * Gets the resource collection API of RestorePointCollections. It manages RestorePointCollection. + * + * @return Resource collection API of RestorePointCollections. + */ + public RestorePointCollections restorePointCollections() { + if (this.restorePointCollections == null) { + this.restorePointCollections = + new RestorePointCollectionsImpl(clientObject.getRestorePointCollections(), this); + } + return restorePointCollections; + } + + /** + * Gets the resource collection API of RestorePoints. It manages RestorePoint. + * + * @return Resource collection API of RestorePoints. + */ + public RestorePoints restorePoints() { + if (this.restorePoints == null) { + this.restorePoints = new RestorePointsImpl(clientObject.getRestorePoints(), this); + } + return restorePoints; + } + + /** + * Gets the resource collection API of CapacityReservationGroups. It manages CapacityReservationGroup. + * + * @return Resource collection API of CapacityReservationGroups. + */ + public CapacityReservationGroups capacityReservationGroups() { + if (this.capacityReservationGroups == null) { + this.capacityReservationGroups = + new CapacityReservationGroupsImpl(clientObject.getCapacityReservationGroups(), this); + } + return capacityReservationGroups; + } + + /** + * Gets the resource collection API of CapacityReservations. It manages CapacityReservation. + * + * @return Resource collection API of CapacityReservations. + */ + public CapacityReservations capacityReservations() { + if (this.capacityReservations == null) { + this.capacityReservations = new CapacityReservationsImpl(clientObject.getCapacityReservations(), this); + } + return capacityReservations; + } + + /** + * Gets the resource collection API of LogAnalytics. + * + * @return Resource collection API of LogAnalytics. + */ + public LogAnalytics logAnalytics() { + if (this.logAnalytics == null) { + this.logAnalytics = new LogAnalyticsImpl(clientObject.getLogAnalytics(), this); + } + return logAnalytics; + } + + /** + * Gets the resource collection API of VirtualMachineRunCommands. It manages VirtualMachineRunCommand. + * + * @return Resource collection API of VirtualMachineRunCommands. + */ + public VirtualMachineRunCommands virtualMachineRunCommands() { + if (this.virtualMachineRunCommands == null) { + this.virtualMachineRunCommands = + new VirtualMachineRunCommandsImpl(clientObject.getVirtualMachineRunCommands(), this); + } + return virtualMachineRunCommands; + } + + /** + * Gets the resource collection API of VirtualMachineScaleSetVMRunCommands. + * + * @return Resource collection API of VirtualMachineScaleSetVMRunCommands. + */ + public VirtualMachineScaleSetVMRunCommands virtualMachineScaleSetVMRunCommands() { + if (this.virtualMachineScaleSetVMRunCommands == null) { + this.virtualMachineScaleSetVMRunCommands = + new VirtualMachineScaleSetVMRunCommandsImpl( + clientObject.getVirtualMachineScaleSetVMRunCommands(), this); + } + return virtualMachineScaleSetVMRunCommands; + } + + /** + * Gets the resource collection API of Disks. It manages Disk. + * + * @return Resource collection API of Disks. + */ + public Disks disks() { + if (this.disks == null) { + this.disks = new DisksImpl(clientObject.getDisks(), this); + } + return disks; + } + + /** + * Gets the resource collection API of DiskAccesses. It manages DiskAccess. + * + * @return Resource collection API of DiskAccesses. + */ + public DiskAccesses diskAccesses() { + if (this.diskAccesses == null) { + this.diskAccesses = new DiskAccessesImpl(clientObject.getDiskAccesses(), this); + } + return diskAccesses; + } + + /** + * Gets the resource collection API of DiskEncryptionSets. It manages DiskEncryptionSet. + * + * @return Resource collection API of DiskEncryptionSets. + */ + public DiskEncryptionSets diskEncryptionSets() { + if (this.diskEncryptionSets == null) { + this.diskEncryptionSets = new DiskEncryptionSetsImpl(clientObject.getDiskEncryptionSets(), this); + } + return diskEncryptionSets; + } + + /** + * Gets the resource collection API of DiskRestorePoints. + * + * @return Resource collection API of DiskRestorePoints. + */ + public DiskRestorePoints diskRestorePoints() { + if (this.diskRestorePoints == null) { + this.diskRestorePoints = new DiskRestorePointsImpl(clientObject.getDiskRestorePoints(), this); + } + return diskRestorePoints; + } + + /** + * Gets the resource collection API of Snapshots. It manages Snapshot. + * + * @return Resource collection API of Snapshots. + */ + public Snapshots snapshots() { + if (this.snapshots == null) { + this.snapshots = new SnapshotsImpl(clientObject.getSnapshots(), this); + } + return snapshots; + } + + /** + * Gets the resource collection API of ResourceSkus. + * + * @return Resource collection API of ResourceSkus. + */ + public ResourceSkus resourceSkus() { + if (this.resourceSkus == null) { + this.resourceSkus = new ResourceSkusImpl(clientObject.getResourceSkus(), this); + } + return resourceSkus; + } + + /** + * Gets the resource collection API of Galleries. It manages Gallery. + * + * @return Resource collection API of Galleries. + */ + public Galleries galleries() { + if (this.galleries == null) { + this.galleries = new GalleriesImpl(clientObject.getGalleries(), this); + } + return galleries; + } + + /** + * Gets the resource collection API of GalleryImages. It manages GalleryImage. + * + * @return Resource collection API of GalleryImages. + */ + public GalleryImages galleryImages() { + if (this.galleryImages == null) { + this.galleryImages = new GalleryImagesImpl(clientObject.getGalleryImages(), this); + } + return galleryImages; + } + + /** + * Gets the resource collection API of GalleryImageVersions. It manages GalleryImageVersion. + * + * @return Resource collection API of GalleryImageVersions. + */ + public GalleryImageVersions galleryImageVersions() { + if (this.galleryImageVersions == null) { + this.galleryImageVersions = new GalleryImageVersionsImpl(clientObject.getGalleryImageVersions(), this); + } + return galleryImageVersions; + } + + /** + * Gets the resource collection API of GalleryApplications. It manages GalleryApplication. + * + * @return Resource collection API of GalleryApplications. + */ + public GalleryApplications galleryApplications() { + if (this.galleryApplications == null) { + this.galleryApplications = new GalleryApplicationsImpl(clientObject.getGalleryApplications(), this); + } + return galleryApplications; + } + + /** + * Gets the resource collection API of GalleryApplicationVersions. It manages GalleryApplicationVersion. + * + * @return Resource collection API of GalleryApplicationVersions. + */ + public GalleryApplicationVersions galleryApplicationVersions() { + if (this.galleryApplicationVersions == null) { + this.galleryApplicationVersions = + new GalleryApplicationVersionsImpl(clientObject.getGalleryApplicationVersions(), this); + } + return galleryApplicationVersions; + } + + /** + * Gets the resource collection API of GallerySharingProfiles. + * + * @return Resource collection API of GallerySharingProfiles. + */ + public GallerySharingProfiles gallerySharingProfiles() { + if (this.gallerySharingProfiles == null) { + this.gallerySharingProfiles = + new GallerySharingProfilesImpl(clientObject.getGallerySharingProfiles(), this); + } + return gallerySharingProfiles; + } + + /** + * Gets the resource collection API of SharedGalleries. + * + * @return Resource collection API of SharedGalleries. + */ + public SharedGalleries sharedGalleries() { + if (this.sharedGalleries == null) { + this.sharedGalleries = new SharedGalleriesImpl(clientObject.getSharedGalleries(), this); + } + return sharedGalleries; + } + + /** + * Gets the resource collection API of SharedGalleryImages. + * + * @return Resource collection API of SharedGalleryImages. + */ + public SharedGalleryImages sharedGalleryImages() { + if (this.sharedGalleryImages == null) { + this.sharedGalleryImages = new SharedGalleryImagesImpl(clientObject.getSharedGalleryImages(), this); + } + return sharedGalleryImages; + } + + /** + * Gets the resource collection API of SharedGalleryImageVersions. + * + * @return Resource collection API of SharedGalleryImageVersions. + */ + public SharedGalleryImageVersions sharedGalleryImageVersions() { + if (this.sharedGalleryImageVersions == null) { + this.sharedGalleryImageVersions = + new SharedGalleryImageVersionsImpl(clientObject.getSharedGalleryImageVersions(), this); + } + return sharedGalleryImageVersions; + } + + /** + * Gets the resource collection API of CommunityGalleries. + * + * @return Resource collection API of CommunityGalleries. + */ + public CommunityGalleries communityGalleries() { + if (this.communityGalleries == null) { + this.communityGalleries = new CommunityGalleriesImpl(clientObject.getCommunityGalleries(), this); + } + return communityGalleries; + } + + /** + * Gets the resource collection API of CommunityGalleryImages. + * + * @return Resource collection API of CommunityGalleryImages. + */ + public CommunityGalleryImages communityGalleryImages() { + if (this.communityGalleryImages == null) { + this.communityGalleryImages = + new CommunityGalleryImagesImpl(clientObject.getCommunityGalleryImages(), this); + } + return communityGalleryImages; + } + + /** + * Gets the resource collection API of CommunityGalleryImageVersions. + * + * @return Resource collection API of CommunityGalleryImageVersions. + */ + public CommunityGalleryImageVersions communityGalleryImageVersions() { + if (this.communityGalleryImageVersions == null) { + this.communityGalleryImageVersions = + new CommunityGalleryImageVersionsImpl(clientObject.getCommunityGalleryImageVersions(), this); + } + return communityGalleryImageVersions; + } + + /** + * Gets the resource collection API of CloudServiceRoleInstances. + * + * @return Resource collection API of CloudServiceRoleInstances. + */ + public CloudServiceRoleInstances cloudServiceRoleInstances() { + if (this.cloudServiceRoleInstances == null) { + this.cloudServiceRoleInstances = + new CloudServiceRoleInstancesImpl(clientObject.getCloudServiceRoleInstances(), this); + } + return cloudServiceRoleInstances; + } + + /** + * Gets the resource collection API of CloudServiceRoles. + * + * @return Resource collection API of CloudServiceRoles. + */ + public CloudServiceRoles cloudServiceRoles() { + if (this.cloudServiceRoles == null) { + this.cloudServiceRoles = new CloudServiceRolesImpl(clientObject.getCloudServiceRoles(), this); + } + return cloudServiceRoles; + } + + /** + * Gets the resource collection API of CloudServices. It manages CloudService. + * + * @return Resource collection API of CloudServices. + */ + public CloudServices cloudServices() { + if (this.cloudServices == null) { + this.cloudServices = new CloudServicesImpl(clientObject.getCloudServices(), this); + } + return cloudServices; + } + + /** + * Gets the resource collection API of CloudServicesUpdateDomains. + * + * @return Resource collection API of CloudServicesUpdateDomains. + */ + public CloudServicesUpdateDomains cloudServicesUpdateDomains() { + if (this.cloudServicesUpdateDomains == null) { + this.cloudServicesUpdateDomains = + new CloudServicesUpdateDomainsImpl(clientObject.getCloudServicesUpdateDomains(), this); + } + return cloudServicesUpdateDomains; + } + + /** + * Gets the resource collection API of CloudServiceOperatingSystems. + * + * @return Resource collection API of CloudServiceOperatingSystems. + */ + public CloudServiceOperatingSystems cloudServiceOperatingSystems() { + if (this.cloudServiceOperatingSystems == null) { + this.cloudServiceOperatingSystems = + new CloudServiceOperatingSystemsImpl(clientObject.getCloudServiceOperatingSystems(), this); + } + return cloudServiceOperatingSystems; + } + + /** + * @return Wrapped service client ComputeManagementClient providing direct access to the underlying auto-generated + * API implementation, based on Azure REST API. + */ + public ComputeManagementClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/AvailabilitySetsClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/AvailabilitySetsClient.java new file mode 100644 index 0000000000000..36002820ade2b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/AvailabilitySetsClient.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.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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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 along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, String availabilitySetName, AvailabilitySetInner parameters, 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 com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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); + + /** + * 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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 along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, String availabilitySetName, AvailabilitySetUpdate 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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); + + /** + * 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String availabilitySetName, 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.resourcemanager.compute.generated.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 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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 along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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); + + /** + * Lists all availability sets in 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 Availability Set operation response as paginated response with {@link PagedIterable}. + */ + @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.resourcemanager.compute.generated.models.ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + @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.resourcemanager.compute.generated.models.ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + @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.resourcemanager.compute.generated.models.ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + @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.resourcemanager.compute.generated.models.ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + @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.resourcemanager.compute.generated.models.ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAvailableSizes( + String resourceGroupName, String availabilitySetName, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CapacityReservationGroupsClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CapacityReservationGroupsClient.java new file mode 100644 index 0000000000000..0f2a58550c039 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CapacityReservationGroupsClient.java @@ -0,0 +1,236 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.CapacityReservationGroupInner; +import com.azure.resourcemanager.compute.generated.models.CapacityReservationGroupInstanceViewTypes; +import com.azure.resourcemanager.compute.generated.models.CapacityReservationGroupUpdate; +import com.azure.resourcemanager.compute.generated.models.ExpandTypesForGetCapacityReservationGroups; + +/** An instance of this class provides access to all the operations defined in CapacityReservationGroupsClient. */ +public interface CapacityReservationGroupsClient { + /** + * The operation to create or update a capacity reservation group. When updating a capacity reservation group, only + * tags may be modified. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param parameters Parameters supplied to the Create capacity reservation Group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation group that the capacity reservations should be + * assigned to along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String capacityReservationGroupName, + CapacityReservationGroupInner parameters, + Context context); + + /** + * The operation to create or update a capacity reservation group. When updating a capacity reservation group, only + * tags may be modified. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param parameters Parameters supplied to the Create capacity reservation Group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation group that the capacity reservations should be + * assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CapacityReservationGroupInner createOrUpdate( + String resourceGroupName, String capacityReservationGroupName, CapacityReservationGroupInner parameters); + + /** + * The operation to update a capacity reservation group. When updating a capacity reservation group, only tags may + * be modified. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param parameters Parameters supplied to the Update capacity reservation Group operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation group that the capacity reservations should be + * assigned to along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String capacityReservationGroupName, + CapacityReservationGroupUpdate parameters, + Context context); + + /** + * The operation to update a capacity reservation group. When updating a capacity reservation group, only tags may + * be modified. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param parameters Parameters supplied to the Update capacity reservation Group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation group that the capacity reservations should be + * assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CapacityReservationGroupInner update( + String resourceGroupName, String capacityReservationGroupName, CapacityReservationGroupUpdate parameters); + + /** + * The operation to delete a capacity reservation group. This operation is allowed only if all the associated + * resources are disassociated from the reservation group and all capacity reservations under the reservation group + * have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String capacityReservationGroupName, Context context); + + /** + * The operation to delete a capacity reservation group. This operation is allowed only if all the associated + * resources are disassociated from the reservation group and all capacity reservations under the reservation group + * have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String capacityReservationGroupName); + + /** + * The operation that retrieves information about a capacity reservation group. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param expand The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance + * views of the capacity reservations under the capacity reservation group which is a snapshot of the runtime + * properties of a capacity reservation that is managed by the platform and can change outside of control plane + * operations. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation group that the capacity reservations should be + * assigned to along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, + String capacityReservationGroupName, + CapacityReservationGroupInstanceViewTypes expand, + Context context); + + /** + * The operation that retrieves information about a capacity reservation group. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation group that the capacity reservations should be + * assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CapacityReservationGroupInner getByResourceGroup(String resourceGroupName, String capacityReservationGroupName); + + /** + * Lists all of the capacity reservation groups in the specified resource group. Use the nextLink property in the + * response to get the next page of capacity reservation groups. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List capacity reservation group with resource group response as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all of the capacity reservation groups in the specified resource group. Use the nextLink property in the + * response to get the next page of capacity reservation groups. + * + * @param resourceGroupName The name of the resource group. + * @param expand The expand expression to apply on the operation. Based on the expand param(s) specified we return + * Virtual Machine or ScaleSet VM Instance or both resource Ids which are associated to capacity reservation + * group in the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List capacity reservation group with resource group response as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup( + String resourceGroupName, ExpandTypesForGetCapacityReservationGroups expand, Context context); + + /** + * Lists all of the capacity reservation groups in the subscription. Use the nextLink property in the response to + * get the next page of capacity reservation groups. + * + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List capacity reservation group with resource group response as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all of the capacity reservation groups in the subscription. Use the nextLink property in the response to + * get the next page of capacity reservation groups. + * + * @param expand The expand expression to apply on the operation. Based on the expand param(s) specified we return + * Virtual Machine or ScaleSet VM Instance or both resource Ids which are associated to capacity reservation + * group in the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List capacity reservation group with resource group response as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + ExpandTypesForGetCapacityReservationGroups expand, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CapacityReservationsClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CapacityReservationsClient.java new file mode 100644 index 0000000000000..5fa3e916a7f95 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CapacityReservationsClient.java @@ -0,0 +1,335 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.compute.generated.fluent.models.CapacityReservationInner; +import com.azure.resourcemanager.compute.generated.models.CapacityReservationInstanceViewTypes; +import com.azure.resourcemanager.compute.generated.models.CapacityReservationUpdate; + +/** An instance of this class provides access to all the operations defined in CapacityReservationsClient. */ +public interface CapacityReservationsClient { + /** + * The operation to create or update a capacity reservation. Please note some properties can be set only during + * capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param parameters Parameters supplied to the Create capacity reservation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of specifies information about the capacity reservation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CapacityReservationInner> beginCreateOrUpdate( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + CapacityReservationInner parameters); + + /** + * The operation to create or update a capacity reservation. Please note some properties can be set only during + * capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param parameters Parameters supplied to the Create capacity reservation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of specifies information about the capacity reservation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CapacityReservationInner> beginCreateOrUpdate( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + CapacityReservationInner parameters, + Context context); + + /** + * The operation to create or update a capacity reservation. Please note some properties can be set only during + * capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param parameters Parameters supplied to the Create capacity reservation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CapacityReservationInner createOrUpdate( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + CapacityReservationInner parameters); + + /** + * The operation to create or update a capacity reservation. Please note some properties can be set only during + * capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param parameters Parameters supplied to the Create capacity reservation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CapacityReservationInner createOrUpdate( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + CapacityReservationInner parameters, + Context context); + + /** + * The operation to update a capacity reservation. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param parameters Parameters supplied to the Update capacity reservation operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of specifies information about the capacity reservation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CapacityReservationInner> beginUpdate( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + CapacityReservationUpdate parameters); + + /** + * The operation to update a capacity reservation. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param parameters Parameters supplied to the Update capacity reservation operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of specifies information about the capacity reservation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CapacityReservationInner> beginUpdate( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + CapacityReservationUpdate parameters, + Context context); + + /** + * The operation to update a capacity reservation. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param parameters Parameters supplied to the Update capacity reservation operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CapacityReservationInner update( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + CapacityReservationUpdate parameters); + + /** + * The operation to update a capacity reservation. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param parameters Parameters supplied to the Update capacity reservation operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CapacityReservationInner update( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + CapacityReservationUpdate parameters, + Context context); + + /** + * The operation to delete a capacity reservation. This operation is allowed only when all the associated resources + * are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more + * details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String capacityReservationGroupName, String capacityReservationName); + + /** + * The operation to delete a capacity reservation. This operation is allowed only when all the associated resources + * are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more + * details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String capacityReservationGroupName, String capacityReservationName, Context context); + + /** + * The operation to delete a capacity reservation. This operation is allowed only when all the associated resources + * are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more + * details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String capacityReservationGroupName, String capacityReservationName); + + /** + * The operation to delete a capacity reservation. This operation is allowed only when all the associated resources + * are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more + * details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete( + String resourceGroupName, String capacityReservationGroupName, String capacityReservationName, Context context); + + /** + * The operation that retrieves information about the capacity reservation. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param expand The expand expression to apply on the operation. 'InstanceView' retrieves a snapshot of the runtime + * properties of the capacity reservation that is managed by the platform and can change outside of control + * plane operations. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + CapacityReservationInstanceViewTypes expand, + Context context); + + /** + * The operation that retrieves information about the capacity reservation. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CapacityReservationInner get( + String resourceGroupName, String capacityReservationGroupName, String capacityReservationName); + + /** + * Lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in + * the response to get the next page of capacity reservations. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list capacity reservation operation response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByCapacityReservationGroup( + String resourceGroupName, String capacityReservationGroupName); + + /** + * Lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in + * the response to get the next page of capacity reservations. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list capacity reservation operation response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByCapacityReservationGroup( + String resourceGroupName, String capacityReservationGroupName, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CloudServiceOperatingSystemsClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CloudServiceOperatingSystemsClient.java new file mode 100644 index 0000000000000..837b38e183576 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CloudServiceOperatingSystemsClient.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.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.OSFamilyInner; +import com.azure.resourcemanager.compute.generated.fluent.models.OSVersionInner; + +/** An instance of this class provides access to all the operations defined in CloudServiceOperatingSystemsClient. */ +public interface CloudServiceOperatingSystemsClient { + /** + * Gets properties of a guest operating system version that can be specified in the XML service configuration + * (.cscfg) for a cloud service. + * + * @param location Name of the location that the OS version pertains to. + * @param osVersionName Name of the OS version. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a guest operating system version that can be specified in the XML service configuration + * (.cscfg) for a cloud service along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getOSVersionWithResponse(String location, String osVersionName, Context context); + + /** + * Gets properties of a guest operating system version that can be specified in the XML service configuration + * (.cscfg) for a cloud service. + * + * @param location Name of the location that the OS version pertains to. + * @param osVersionName Name of the OS version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a guest operating system version that can be specified in the XML service configuration + * (.cscfg) for a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OSVersionInner getOSVersion(String location, String osVersionName); + + /** + * Gets a list of all guest operating system versions available to be specified in the XML service configuration + * (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS versions. Do this + * till nextLink is null to fetch all the OS versions. + * + * @param location Name of the location that the OS versions pertain to. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all guest operating system versions available to be specified in the XML service configuration + * (.cscfg) for a cloud service as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listOSVersions(String location); + + /** + * Gets a list of all guest operating system versions available to be specified in the XML service configuration + * (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS versions. Do this + * till nextLink is null to fetch all the OS versions. + * + * @param location Name of the location that the OS versions pertain to. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all guest operating system versions available to be specified in the XML service configuration + * (.cscfg) for a cloud service as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listOSVersions(String location, Context context); + + /** + * Gets properties of a guest operating system family that can be specified in the XML service configuration + * (.cscfg) for a cloud service. + * + * @param location Name of the location that the OS family pertains to. + * @param osFamilyName Name of the OS family. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a guest operating system family that can be specified in the XML service configuration + * (.cscfg) for a cloud service along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getOSFamilyWithResponse(String location, String osFamilyName, Context context); + + /** + * Gets properties of a guest operating system family that can be specified in the XML service configuration + * (.cscfg) for a cloud service. + * + * @param location Name of the location that the OS family pertains to. + * @param osFamilyName Name of the OS family. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a guest operating system family that can be specified in the XML service configuration + * (.cscfg) for a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OSFamilyInner getOSFamily(String location, String osFamilyName); + + /** + * Gets a list of all guest operating system families available to be specified in the XML service configuration + * (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS Families. Do this + * till nextLink is null to fetch all the OS Families. + * + * @param location Name of the location that the OS families pertain to. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all guest operating system families available to be specified in the XML service configuration + * (.cscfg) for a cloud service as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listOSFamilies(String location); + + /** + * Gets a list of all guest operating system families available to be specified in the XML service configuration + * (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS Families. Do this + * till nextLink is null to fetch all the OS Families. + * + * @param location Name of the location that the OS families pertain to. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all guest operating system families available to be specified in the XML service configuration + * (.cscfg) for a cloud service as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listOSFamilies(String location, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CloudServiceRoleInstancesClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CloudServiceRoleInstancesClient.java new file mode 100644 index 0000000000000..b2b68fd19bd59 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CloudServiceRoleInstancesClient.java @@ -0,0 +1,412 @@ +// Copyright (c) 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.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.compute.generated.fluent.models.RoleInstanceInner; +import com.azure.resourcemanager.compute.generated.fluent.models.RoleInstanceViewInner; +import com.azure.resourcemanager.compute.generated.models.InstanceViewTypes; + +/** An instance of this class provides access to all the operations defined in CloudServiceRoleInstancesClient. */ +public interface CloudServiceRoleInstancesClient { + /** + * Deletes a role instance from a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String roleInstanceName, String resourceGroupName, String cloudServiceName); + + /** + * Deletes a role instance from a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context); + + /** + * Deletes a role instance from a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String roleInstanceName, String resourceGroupName, String cloudServiceName); + + /** + * Deletes a role instance from a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context); + + /** + * Gets a role instance from a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param expand The expand expression to apply to the operation. 'UserData' is not supported for cloud services. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a role instance from a cloud service along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String roleInstanceName, + String resourceGroupName, + String cloudServiceName, + InstanceViewTypes expand, + Context context); + + /** + * Gets a role instance from a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a role instance from a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RoleInstanceInner get(String roleInstanceName, String resourceGroupName, String cloudServiceName); + + /** + * Retrieves information about the run-time state of a role instance in a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the instance view of the role instance along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getInstanceViewWithResponse( + String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context); + + /** + * Retrieves information about the run-time state of a role instance in a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the instance view of the role instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RoleInstanceViewInner getInstanceView(String roleInstanceName, String resourceGroupName, String cloudServiceName); + + /** + * Gets the list of all role instances in a cloud service. Use nextLink property in the response to get the next + * page of role instances. Do this till nextLink is null to fetch all the role instances. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of all role instances in a cloud service as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String cloudServiceName); + + /** + * Gets the list of all role instances in a cloud service. Use nextLink property in the response to get the next + * page of role instances. Do this till nextLink is null to fetch all the role instances. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param expand The expand expression to apply to the operation. 'UserData' is not supported for cloud services. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of all role instances in a cloud service as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String cloudServiceName, InstanceViewTypes expand, Context context); + + /** + * The Reboot Role Instance asynchronous operation requests a reboot of a role instance in the cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginRestart( + String roleInstanceName, String resourceGroupName, String cloudServiceName); + + /** + * The Reboot Role Instance asynchronous operation requests a reboot of a role instance in the cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginRestart( + String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context); + + /** + * The Reboot Role Instance asynchronous operation requests a reboot of a role instance in the cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void restart(String roleInstanceName, String resourceGroupName, String cloudServiceName); + + /** + * The Reboot Role Instance asynchronous operation requests a reboot of a role instance in the cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void restart(String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context); + + /** + * The Reimage Role Instance asynchronous operation reinstalls the operating system on instances of web roles or + * worker roles. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginReimage( + String roleInstanceName, String resourceGroupName, String cloudServiceName); + + /** + * The Reimage Role Instance asynchronous operation reinstalls the operating system on instances of web roles or + * worker roles. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginReimage( + String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context); + + /** + * The Reimage Role Instance asynchronous operation reinstalls the operating system on instances of web roles or + * worker roles. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void reimage(String roleInstanceName, String resourceGroupName, String cloudServiceName); + + /** + * The Reimage Role Instance asynchronous operation reinstalls the operating system on instances of web roles or + * worker roles. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void reimage(String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context); + + /** + * The Rebuild Role Instance asynchronous operation reinstalls the operating system on instances of web roles or + * worker roles and initializes the storage resources that are used by them. If you do not want to initialize + * storage resources, you can use Reimage Role Instance. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginRebuild( + String roleInstanceName, String resourceGroupName, String cloudServiceName); + + /** + * The Rebuild Role Instance asynchronous operation reinstalls the operating system on instances of web roles or + * worker roles and initializes the storage resources that are used by them. If you do not want to initialize + * storage resources, you can use Reimage Role Instance. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginRebuild( + String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context); + + /** + * The Rebuild Role Instance asynchronous operation reinstalls the operating system on instances of web roles or + * worker roles and initializes the storage resources that are used by them. If you do not want to initialize + * storage resources, you can use Reimage Role Instance. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void rebuild(String roleInstanceName, String resourceGroupName, String cloudServiceName); + + /** + * The Rebuild Role Instance asynchronous operation reinstalls the operating system on instances of web roles or + * worker roles and initializes the storage resources that are used by them. If you do not want to initialize + * storage resources, you can use Reimage Role Instance. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void rebuild(String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context); + + /** + * Gets a remote desktop file for a role instance in a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a remote desktop file for a role instance in a cloud service along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getRemoteDesktopFileWithResponse( + String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context); + + /** + * Gets a remote desktop file for a role instance in a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a remote desktop file for a role instance in a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BinaryData getRemoteDesktopFile(String roleInstanceName, String resourceGroupName, String cloudServiceName); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CloudServiceRolesClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CloudServiceRolesClient.java new file mode 100644 index 0000000000000..835835d2df323 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CloudServiceRolesClient.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.CloudServiceRoleInner; + +/** An instance of this class provides access to all the operations defined in CloudServiceRolesClient. */ +public interface CloudServiceRolesClient { + /** + * Gets a role from a cloud service. + * + * @param roleName Name of the role. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a role from a cloud service along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String roleName, String resourceGroupName, String cloudServiceName, Context context); + + /** + * Gets a role from a cloud service. + * + * @param roleName Name of the role. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a role from a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CloudServiceRoleInner get(String roleName, String resourceGroupName, String cloudServiceName); + + /** + * Gets a list of all roles in a cloud service. Use nextLink property in the response to get the next page of roles. + * Do this till nextLink is null to fetch all the roles. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all roles in a cloud service as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String cloudServiceName); + + /** + * Gets a list of all roles in a cloud service. Use nextLink property in the response to get the next page of roles. + * Do this till nextLink is null to fetch all the roles. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all roles in a cloud service as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String cloudServiceName, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CloudServicesClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CloudServicesClient.java new file mode 100644 index 0000000000000..2508e6bfa6bbb --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CloudServicesClient.java @@ -0,0 +1,682 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.compute.generated.fluent.models.CloudServiceInner; +import com.azure.resourcemanager.compute.generated.fluent.models.CloudServiceInstanceViewInner; +import com.azure.resourcemanager.compute.generated.models.CloudServiceUpdate; +import com.azure.resourcemanager.compute.generated.models.RoleInstances; + +/** An instance of this class provides access to all the operations defined in CloudServicesClient. */ +public interface CloudServicesClient { + /** + * Create or update a cloud service. Please note some properties can be set only during cloud service creation. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes the cloud service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CloudServiceInner> beginCreateOrUpdate( + String resourceGroupName, String cloudServiceName); + + /** + * Create or update a cloud service. Please note some properties can be set only during cloud service creation. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters The cloud service object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes the cloud service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CloudServiceInner> beginCreateOrUpdate( + String resourceGroupName, String cloudServiceName, CloudServiceInner parameters, Context context); + + /** + * Create or update a cloud service. Please note some properties can be set only during cloud service creation. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CloudServiceInner createOrUpdate(String resourceGroupName, String cloudServiceName); + + /** + * Create or update a cloud service. Please note some properties can be set only during cloud service creation. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters The cloud service object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CloudServiceInner createOrUpdate( + String resourceGroupName, String cloudServiceName, CloudServiceInner parameters, Context context); + + /** + * Update a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes the cloud service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CloudServiceInner> beginUpdate( + String resourceGroupName, String cloudServiceName); + + /** + * Update a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters The cloud service object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes the cloud service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CloudServiceInner> beginUpdate( + String resourceGroupName, String cloudServiceName, CloudServiceUpdate parameters, Context context); + + /** + * Update a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CloudServiceInner update(String resourceGroupName, String cloudServiceName); + + /** + * Update a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters The cloud service object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CloudServiceInner update( + String resourceGroupName, String cloudServiceName, CloudServiceUpdate parameters, Context context); + + /** + * Deletes a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String cloudServiceName); + + /** + * Deletes a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String cloudServiceName, Context context); + + /** + * Deletes a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String cloudServiceName); + + /** + * Deletes a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String cloudServiceName, Context context); + + /** + * Display information about a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String cloudServiceName, Context context); + + /** + * Display information about a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CloudServiceInner getByResourceGroup(String resourceGroupName, String cloudServiceName); + + /** + * Gets the status of a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a cloud service along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getInstanceViewWithResponse( + String resourceGroupName, String cloudServiceName, Context context); + + /** + * Gets the status of a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CloudServiceInstanceViewInner getInstanceView(String resourceGroupName, String cloudServiceName); + + /** + * Gets a list of all cloud services in the subscription, regardless of the associated resource group. Use nextLink + * property in the response to get the next page of Cloud Services. Do this till nextLink is null to fetch all the + * Cloud Services. + * + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all cloud services in the subscription, regardless of the associated resource group as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets a list of all cloud services in the subscription, regardless of the associated resource group. Use nextLink + * property in the response to get the next page of Cloud Services. Do this till nextLink is null to fetch all the + * Cloud Services. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all cloud services in the subscription, regardless of the associated resource group as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Gets a list of all cloud services under a resource group. Use nextLink property in the response to get the next + * page of Cloud Services. Do this till nextLink is null to fetch all the Cloud Services. + * + * @param resourceGroupName Name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all cloud services under a resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets a list of all cloud services under a resource group. Use nextLink property in the response to get the next + * page of Cloud Services. Do this till nextLink is null to fetch all the Cloud Services. + * + * @param resourceGroupName Name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all cloud services under a resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Starts the cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginStart(String resourceGroupName, String cloudServiceName); + + /** + * Starts the cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginStart(String resourceGroupName, String cloudServiceName, Context context); + + /** + * Starts the cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void start(String resourceGroupName, String cloudServiceName); + + /** + * Starts the cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void start(String resourceGroupName, String cloudServiceName, Context context); + + /** + * Power off the cloud service. Note that resources are still attached and you are getting charged for the + * resources. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginPowerOff(String resourceGroupName, String cloudServiceName); + + /** + * Power off the cloud service. Note that resources are still attached and you are getting charged for the + * resources. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginPowerOff( + String resourceGroupName, String cloudServiceName, Context context); + + /** + * Power off the cloud service. Note that resources are still attached and you are getting charged for the + * resources. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void powerOff(String resourceGroupName, String cloudServiceName); + + /** + * Power off the cloud service. Note that resources are still attached and you are getting charged for the + * resources. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void powerOff(String resourceGroupName, String cloudServiceName, Context context); + + /** + * Restarts one or more role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginRestart(String resourceGroupName, String cloudServiceName); + + /** + * Restarts one or more role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginRestart( + String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context); + + /** + * Restarts one or more role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void restart(String resourceGroupName, String cloudServiceName); + + /** + * Restarts one or more role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void restart(String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context); + + /** + * Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginReimage(String resourceGroupName, String cloudServiceName); + + /** + * Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginReimage( + String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context); + + /** + * Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void reimage(String resourceGroupName, String cloudServiceName); + + /** + * Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void reimage(String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context); + + /** + * Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes + * the storage resources that are used by them. If you do not want to initialize storage resources, you can use + * Reimage Role Instances. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginRebuild(String resourceGroupName, String cloudServiceName); + + /** + * Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes + * the storage resources that are used by them. If you do not want to initialize storage resources, you can use + * Reimage Role Instances. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginRebuild( + String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context); + + /** + * Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes + * the storage resources that are used by them. If you do not want to initialize storage resources, you can use + * Reimage Role Instances. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void rebuild(String resourceGroupName, String cloudServiceName); + + /** + * Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes + * the storage resources that are used by them. If you do not want to initialize storage resources, you can use + * Reimage Role Instances. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void rebuild(String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context); + + /** + * Deletes role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDeleteInstances(String resourceGroupName, String cloudServiceName); + + /** + * Deletes role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDeleteInstances( + String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context); + + /** + * Deletes role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deleteInstances(String resourceGroupName, String cloudServiceName); + + /** + * Deletes role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deleteInstances(String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CloudServicesUpdateDomainsClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CloudServicesUpdateDomainsClient.java new file mode 100644 index 0000000000000..ee1f1ba323f90 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CloudServicesUpdateDomainsClient.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.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.compute.generated.fluent.models.UpdateDomainInner; + +/** An instance of this class provides access to all the operations defined in CloudServicesUpdateDomainsClient. */ +public interface CloudServicesUpdateDomainsClient { + /** + * Updates the role instances in the specified update domain. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param updateDomain Specifies an integer value that identifies the update domain. Update domains are identified + * with a zero-based index: the first update domain has an ID of 0, the second has an ID of 1, and so on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginWalkUpdateDomain( + String resourceGroupName, String cloudServiceName, int updateDomain); + + /** + * Updates the role instances in the specified update domain. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param updateDomain Specifies an integer value that identifies the update domain. Update domains are identified + * with a zero-based index: the first update domain has an ID of 0, the second has an ID of 1, and so on. + * @param parameters The update domain object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginWalkUpdateDomain( + String resourceGroupName, + String cloudServiceName, + int updateDomain, + UpdateDomainInner parameters, + Context context); + + /** + * Updates the role instances in the specified update domain. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param updateDomain Specifies an integer value that identifies the update domain. Update domains are identified + * with a zero-based index: the first update domain has an ID of 0, the second has an ID of 1, and so on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void walkUpdateDomain(String resourceGroupName, String cloudServiceName, int updateDomain); + + /** + * Updates the role instances in the specified update domain. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param updateDomain Specifies an integer value that identifies the update domain. Update domains are identified + * with a zero-based index: the first update domain has an ID of 0, the second has an ID of 1, and so on. + * @param parameters The update domain object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void walkUpdateDomain( + String resourceGroupName, + String cloudServiceName, + int updateDomain, + UpdateDomainInner parameters, + Context context); + + /** + * Gets the specified update domain of a cloud service. Use nextLink property in the response to get the next page + * of update domains. Do this till nextLink is null to fetch all the update domains. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param updateDomain Specifies an integer value that identifies the update domain. Update domains are identified + * with a zero-based index: the first update domain has an ID of 0, the second has an ID of 1, and so on. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified update domain of a cloud service along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getUpdateDomainWithResponse( + String resourceGroupName, String cloudServiceName, int updateDomain, Context context); + + /** + * Gets the specified update domain of a cloud service. Use nextLink property in the response to get the next page + * of update domains. Do this till nextLink is null to fetch all the update domains. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param updateDomain Specifies an integer value that identifies the update domain. Update domains are identified + * with a zero-based index: the first update domain has an ID of 0, the second has an ID of 1, and so on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified update domain of a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + UpdateDomainInner getUpdateDomain(String resourceGroupName, String cloudServiceName, int updateDomain); + + /** + * Gets a list of all update domains in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all update domains in a cloud service as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listUpdateDomains(String resourceGroupName, String cloudServiceName); + + /** + * Gets a list of all update domains in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all update domains in a cloud service as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listUpdateDomains( + String resourceGroupName, String cloudServiceName, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CommunityGalleriesClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CommunityGalleriesClient.java new file mode 100644 index 0000000000000..091663799ea0a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CommunityGalleriesClient.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; + +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.CommunityGalleryInner; + +/** An instance of this class provides access to all the operations defined in CommunityGalleriesClient. */ +public interface CommunityGalleriesClient { + /** + * Get a community gallery by gallery public name. + * + * @param location Resource location. + * @param publicGalleryName The public name of the community 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 community gallery by gallery public name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String location, String publicGalleryName, Context context); + + /** + * Get a community gallery by gallery public name. + * + * @param location Resource location. + * @param publicGalleryName The public name of the community 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 community gallery by gallery public name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CommunityGalleryInner get(String location, String publicGalleryName); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CommunityGalleryImageVersionsClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CommunityGalleryImageVersionsClient.java new file mode 100644 index 0000000000000..5d327b202bc59 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CommunityGalleryImageVersionsClient.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; + +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.CommunityGalleryImageVersionInner; + +/** An instance of this class provides access to all the operations defined in CommunityGalleryImageVersionsClient. */ +public interface CommunityGalleryImageVersionsClient { + /** + * Get a community gallery image version. + * + * @param location Resource location. + * @param publicGalleryName The public name of the community gallery. + * @param galleryImageName The name of the community gallery image definition. + * @param galleryImageVersionName The name of the community gallery image version. 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 community gallery image version along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String location, + String publicGalleryName, + String galleryImageName, + String galleryImageVersionName, + Context context); + + /** + * Get a community gallery image version. + * + * @param location Resource location. + * @param publicGalleryName The public name of the community gallery. + * @param galleryImageName The name of the community gallery image definition. + * @param galleryImageVersionName The name of the community gallery image version. 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 community gallery image version. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CommunityGalleryImageVersionInner get( + String location, String publicGalleryName, String galleryImageName, String galleryImageVersionName); + + /** + * List community gallery image versions inside an image. + * + * @param location Resource location. + * @param publicGalleryName The public name of the community gallery. + * @param galleryImageName The name of the community gallery image definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Community Gallery Image versions operation response as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String location, String publicGalleryName, String galleryImageName); + + /** + * List community gallery image versions inside an image. + * + * @param location Resource location. + * @param publicGalleryName The public name of the community gallery. + * @param galleryImageName The name of the community gallery image definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Community Gallery Image versions operation response as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String location, String publicGalleryName, String galleryImageName, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CommunityGalleryImagesClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CommunityGalleryImagesClient.java new file mode 100644 index 0000000000000..6aac6b149d351 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CommunityGalleryImagesClient.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.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.CommunityGalleryImageInner; + +/** An instance of this class provides access to all the operations defined in CommunityGalleryImagesClient. */ +public interface CommunityGalleryImagesClient { + /** + * Get a community gallery image. + * + * @param location Resource location. + * @param publicGalleryName The public name of the community gallery. + * @param galleryImageName The name of the community gallery image definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a community gallery image along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String location, String publicGalleryName, String galleryImageName, Context context); + + /** + * Get a community gallery image. + * + * @param location Resource location. + * @param publicGalleryName The public name of the community gallery. + * @param galleryImageName The name of the community gallery image definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a community gallery image. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CommunityGalleryImageInner get(String location, String publicGalleryName, String galleryImageName); + + /** + * List community gallery images inside a gallery. + * + * @param location Resource location. + * @param publicGalleryName The public name of the community 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 Community Gallery Images operation response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location, String publicGalleryName); + + /** + * List community gallery images inside a gallery. + * + * @param location Resource location. + * @param publicGalleryName The public name of the community 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 the List Community Gallery Images operation response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location, String publicGalleryName, 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..59788a853a630 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/ComputeManagementClient.java @@ -0,0 +1,383 @@ +// Copyright (c) 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 UsagesClient object to access its operations. + * + * @return the UsagesClient object. + */ + UsagesClient getUsages(); + + /** + * Gets the VirtualMachineSizesClient object to access its operations. + * + * @return the VirtualMachineSizesClient object. + */ + VirtualMachineSizesClient getVirtualMachineSizes(); + + /** + * Gets the VirtualMachineScaleSetsClient object to access its operations. + * + * @return the VirtualMachineScaleSetsClient object. + */ + VirtualMachineScaleSetsClient getVirtualMachineScaleSets(); + + /** + * 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 VirtualMachineExtensionsClient object to access its operations. + * + * @return the VirtualMachineExtensionsClient object. + */ + VirtualMachineExtensionsClient getVirtualMachineExtensions(); + + /** + * Gets the VirtualMachinesClient object to access its operations. + * + * @return the VirtualMachinesClient object. + */ + VirtualMachinesClient getVirtualMachines(); + + /** + * 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 VirtualMachineExtensionImagesClient object to access its operations. + * + * @return the VirtualMachineExtensionImagesClient object. + */ + VirtualMachineExtensionImagesClient getVirtualMachineExtensionImages(); + + /** + * 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 ImagesClient object to access its operations. + * + * @return the ImagesClient object. + */ + ImagesClient getImages(); + + /** + * Gets the RestorePointCollectionsClient object to access its operations. + * + * @return the RestorePointCollectionsClient object. + */ + RestorePointCollectionsClient getRestorePointCollections(); + + /** + * Gets the RestorePointsClient object to access its operations. + * + * @return the RestorePointsClient object. + */ + RestorePointsClient getRestorePoints(); + + /** + * Gets the CapacityReservationGroupsClient object to access its operations. + * + * @return the CapacityReservationGroupsClient object. + */ + CapacityReservationGroupsClient getCapacityReservationGroups(); + + /** + * Gets the CapacityReservationsClient object to access its operations. + * + * @return the CapacityReservationsClient object. + */ + CapacityReservationsClient getCapacityReservations(); + + /** + * Gets the 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 DisksClient object to access its operations. + * + * @return the DisksClient object. + */ + DisksClient getDisks(); + + /** + * Gets the DiskAccessesClient object to access its operations. + * + * @return the DiskAccessesClient object. + */ + DiskAccessesClient getDiskAccesses(); + + /** + * Gets the DiskEncryptionSetsClient object to access its operations. + * + * @return the DiskEncryptionSetsClient object. + */ + DiskEncryptionSetsClient getDiskEncryptionSets(); + + /** + * Gets the DiskRestorePointsClient object to access its operations. + * + * @return the DiskRestorePointsClient object. + */ + DiskRestorePointsClient getDiskRestorePoints(); + + /** + * Gets the SnapshotsClient object to access its operations. + * + * @return the SnapshotsClient object. + */ + SnapshotsClient getSnapshots(); + + /** + * Gets the ResourceSkusClient object to access its operations. + * + * @return the ResourceSkusClient object. + */ + ResourceSkusClient getResourceSkus(); + + /** + * Gets the GalleriesClient object to access its operations. + * + * @return the GalleriesClient object. + */ + GalleriesClient getGalleries(); + + /** + * Gets the GalleryImagesClient object to access its operations. + * + * @return the GalleryImagesClient object. + */ + GalleryImagesClient getGalleryImages(); + + /** + * Gets the GalleryImageVersionsClient object to access its operations. + * + * @return the GalleryImageVersionsClient object. + */ + GalleryImageVersionsClient getGalleryImageVersions(); + + /** + * Gets the GalleryApplicationsClient object to access its operations. + * + * @return the GalleryApplicationsClient object. + */ + GalleryApplicationsClient getGalleryApplications(); + + /** + * Gets the GalleryApplicationVersionsClient object to access its operations. + * + * @return the GalleryApplicationVersionsClient object. + */ + GalleryApplicationVersionsClient getGalleryApplicationVersions(); + + /** + * Gets the GallerySharingProfilesClient object to access its operations. + * + * @return the GallerySharingProfilesClient object. + */ + GallerySharingProfilesClient getGallerySharingProfiles(); + + /** + * Gets the SharedGalleriesClient object to access its operations. + * + * @return the SharedGalleriesClient object. + */ + SharedGalleriesClient getSharedGalleries(); + + /** + * Gets the SharedGalleryImagesClient object to access its operations. + * + * @return the SharedGalleryImagesClient object. + */ + SharedGalleryImagesClient getSharedGalleryImages(); + + /** + * Gets the SharedGalleryImageVersionsClient object to access its operations. + * + * @return the SharedGalleryImageVersionsClient object. + */ + SharedGalleryImageVersionsClient getSharedGalleryImageVersions(); + + /** + * Gets the CommunityGalleriesClient object to access its operations. + * + * @return the CommunityGalleriesClient object. + */ + CommunityGalleriesClient getCommunityGalleries(); + + /** + * Gets the CommunityGalleryImagesClient object to access its operations. + * + * @return the CommunityGalleryImagesClient object. + */ + CommunityGalleryImagesClient getCommunityGalleryImages(); + + /** + * Gets the CommunityGalleryImageVersionsClient object to access its operations. + * + * @return the CommunityGalleryImageVersionsClient object. + */ + CommunityGalleryImageVersionsClient getCommunityGalleryImageVersions(); + + /** + * Gets the CloudServiceRoleInstancesClient object to access its operations. + * + * @return the CloudServiceRoleInstancesClient object. + */ + CloudServiceRoleInstancesClient getCloudServiceRoleInstances(); + + /** + * Gets the CloudServiceRolesClient object to access its operations. + * + * @return the CloudServiceRolesClient object. + */ + CloudServiceRolesClient getCloudServiceRoles(); + + /** + * Gets the CloudServicesClient object to access its operations. + * + * @return the CloudServicesClient object. + */ + CloudServicesClient getCloudServices(); + + /** + * Gets the CloudServicesUpdateDomainsClient object to access its operations. + * + * @return the CloudServicesUpdateDomainsClient object. + */ + CloudServicesUpdateDomainsClient getCloudServicesUpdateDomains(); + + /** + * Gets the CloudServiceOperatingSystemsClient object to access its operations. + * + * @return the CloudServiceOperatingSystemsClient object. + */ + CloudServiceOperatingSystemsClient getCloudServiceOperatingSystems(); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/DedicatedHostGroupsClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/DedicatedHostGroupsClient.java new file mode 100644 index 0000000000000..9dd45109f25c9 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/DedicatedHostGroupsClient.java @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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 along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, String hostGroupName, DedicatedHostGroupInner parameters, 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 com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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); + + /** + * 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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 along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, String hostGroupName, DedicatedHostGroupUpdate 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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); + + /** + * 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String hostGroupName, 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.resourcemanager.compute.generated.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 hostGroupName); + + /** + * Retrieves information about a dedicated host group. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param expand The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance + * views of the dedicated hosts under the dedicated host group. 'UserData' is not supported for dedicated host + * group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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 along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String hostGroupName, InstanceViewTypes expand, 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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); + + /** + * 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.resourcemanager.compute.generated.models.ApiErrorException thrown 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 as paginated response with {@link + * PagedIterable}. + */ + @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.resourcemanager.compute.generated.models.ApiErrorException thrown 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 as paginated response with {@link + * PagedIterable}. + */ + @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.resourcemanager.compute.generated.models.ApiErrorException thrown 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 as paginated response with {@link + * PagedIterable}. + */ + @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.resourcemanager.compute.generated.models.ApiErrorException thrown 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 as paginated response with {@link + * PagedIterable}. + */ + @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..2b3cde1f61f73 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/DedicatedHostsClient.java @@ -0,0 +1,408 @@ +// Copyright (c) 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of specifies information about the Dedicated host. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of specifies information about the Dedicated host. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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 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 Update Dedicated Host operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of specifies information about the Dedicated host. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DedicatedHostInner> beginUpdate( + String resourceGroupName, String hostGroupName, String hostname, DedicatedHostUpdate parameters); + + /** + * 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 Update Dedicated Host 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 {@link SyncPoller} for polling of specifies information about the Dedicated host. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DedicatedHostInner> beginUpdate( + String resourceGroupName, + String hostGroupName, + String hostname, + DedicatedHostUpdate parameters, + Context context); + + /** + * 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 Update Dedicated Host operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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 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 Update Dedicated Host 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 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String 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.resourcemanager.compute.generated.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 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.resourcemanager.compute.generated.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 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. + * @param expand The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance + * views of the dedicated host. 'UserData' is not supported for dedicated host. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String hostGroupName, String hostname, InstanceViewTypes expand, 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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); + + /** + * 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.resourcemanager.compute.generated.models.ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + @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.resourcemanager.compute.generated.models.ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByHostGroup(String resourceGroupName, String hostGroupName, Context context); + + /** + * Restart the dedicated host. The operation will complete successfully once the dedicated host has restarted and is + * running. To determine the health of VMs deployed on the dedicated host after the restart check the Resource + * Health Center in the Azure Portal. Please refer to + * https://docs.microsoft.com/azure/service-health/resource-health-overview for more details. + * + * @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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginRestart(String resourceGroupName, String hostGroupName, String hostname); + + /** + * Restart the dedicated host. The operation will complete successfully once the dedicated host has restarted and is + * running. To determine the health of VMs deployed on the dedicated host after the restart check the Resource + * Health Center in the Azure Portal. Please refer to + * https://docs.microsoft.com/azure/service-health/resource-health-overview for more details. + * + * @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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginRestart( + String resourceGroupName, String hostGroupName, String hostname, Context context); + + /** + * Restart the dedicated host. The operation will complete successfully once the dedicated host has restarted and is + * running. To determine the health of VMs deployed on the dedicated host after the restart check the Resource + * Health Center in the Azure Portal. Please refer to + * https://docs.microsoft.com/azure/service-health/resource-health-overview for more details. + * + * @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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void restart(String resourceGroupName, String hostGroupName, String hostname); + + /** + * Restart the dedicated host. The operation will complete successfully once the dedicated host has restarted and is + * running. To determine the health of VMs deployed on the dedicated host after the restart check the Resource + * Health Center in the Azure Portal. Please refer to + * https://docs.microsoft.com/azure/service-health/resource-health-overview for more details. + * + * @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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void restart(String resourceGroupName, String hostGroupName, String hostname, Context context); + + /** + * Lists all available dedicated host sizes to which the specified dedicated host can be resized. NOTE: The + * dedicated host sizes provided can be used to only scale up the existing 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.resourcemanager.compute.generated.models.ApiErrorException thrown 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 sizes operation response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAvailableSizes(String resourceGroupName, String hostGroupName, String hostname); + + /** + * Lists all available dedicated host sizes to which the specified dedicated host can be resized. NOTE: The + * dedicated host sizes provided can be used to only scale up the existing 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.resourcemanager.compute.generated.models.ApiErrorException thrown 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 sizes operation response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAvailableSizes( + String resourceGroupName, String hostGroupName, String hostname, 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..b5edf63b245b2 --- /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 the {@link SyncPoller} for polling of disk access resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of disk access resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of disk access resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of disk access resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String diskAccessName, 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); + + /** + * 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getPrivateLinkResourcesWithResponse( + String resourceGroupName, String diskAccessName, 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); + + /** + * 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 {@link SyncPoller} for polling of the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getAPrivateEndpointConnectionWithResponse( + String resourceGroupName, String diskAccessName, String privateEndpointConnectionName, 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); + + /** + * 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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..c635701ebc9bf --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/DiskEncryptionSetsClient.java @@ -0,0 +1,372 @@ +// Copyright (c) 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 the {@link SyncPoller} for polling of disk encryption set resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of disk encryption set resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of disk encryption set resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of disk encryption set resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String diskEncryptionSetName, 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); + + /** + * 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link + * PagedIterable}. + */ + @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 as paginated response with {@link + * PagedIterable}. + */ + @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..c82acc51e9ea3 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/DiskRestorePointsClient.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.AccessUriInner; +import com.azure.resourcemanager.compute.generated.fluent.models.DiskRestorePointInner; +import com.azure.resourcemanager.compute.generated.models.GrantAccessData; + +/** An instance of this class provides access to all the operations defined in DiskRestorePointsClient. */ +public interface DiskRestorePointsClient { + /** + * Get disk restorePoint resource. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. + * @param diskRestorePointName The name of the disk restore point created. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName, + 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. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. + * @param diskRestorePointName The name of the disk restore point created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.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); + + /** + * 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. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + @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. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByRestorePoint( + String resourceGroupName, String restorePointCollectionName, String vmRestorePointName, Context context); + + /** + * Grants access to a diskRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. + * @param diskRestorePointName The name of the disk restore point created. + * @param grantAccessData Access data object supplied in the body of the get disk access operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AccessUriInner> beginGrantAccess( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName, + GrantAccessData grantAccessData); + + /** + * Grants access to a diskRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. + * @param diskRestorePointName The name of the disk restore point created. + * @param grantAccessData Access data object supplied in the body of the get disk access operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AccessUriInner> beginGrantAccess( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName, + GrantAccessData grantAccessData, + Context context); + + /** + * Grants access to a diskRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. + * @param diskRestorePointName The name of the disk restore point created. + * @param grantAccessData Access data object supplied in the body of the get disk access operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccessUriInner grantAccess( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName, + GrantAccessData grantAccessData); + + /** + * Grants access to a diskRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. + * @param diskRestorePointName The name of the disk restore point created. + * @param grantAccessData Access data object supplied in the body of the get disk access operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccessUriInner grantAccess( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName, + GrantAccessData grantAccessData, + Context context); + + /** + * Revokes access to a diskRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. + * @param diskRestorePointName The name of the disk restore point created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginRevokeAccess( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName); + + /** + * Revokes access to a diskRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. + * @param diskRestorePointName The name of the disk restore point created. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginRevokeAccess( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName, + Context context); + + /** + * Revokes access to a diskRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. + * @param diskRestorePointName The name of the disk restore point created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void revokeAccess( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName); + + /** + * Revokes access to a diskRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. + * @param diskRestorePointName The name of the disk restore point created. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void revokeAccess( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName, + Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/DisksClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/DisksClient.java new file mode 100644 index 0000000000000..8453bd332da8a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/DisksClient.java @@ -0,0 +1,423 @@ +// Copyright (c) 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 the {@link SyncPoller} for polling of disk resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of disk resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of disk resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of disk resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String diskName, 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); + + /** + * 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 the {@link SyncPoller} for polling of a disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of a disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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..5b7c4133e9a25 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/GalleriesClient.java @@ -0,0 +1,304 @@ +// Copyright (c) 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.GalleryExpandParams; +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 the {@link SyncPoller} for polling of specifies information about the Shared Image Gallery that you want + * to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of specifies information about the Shared Image Gallery that you want + * to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of specifies information about the Shared Image Gallery that you want + * to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of specifies information about the Shared Image Gallery that you want + * to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param select The select expression to apply on the operation. + * @param expand The expand query option 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 along with {@link + * Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, + String galleryName, + SelectPermissions select, + GalleryExpandParams expand, + 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); + + /** + * 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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..37d1257d5063d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/GalleryApplicationVersionsClient.java @@ -0,0 +1,403 @@ +// Copyright (c) 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 the {@link SyncPoller} for polling of specifies information about the gallery Application Version that + * you want to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of specifies information about the gallery Application Version that + * you want to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of specifies information about the gallery Application Version that + * you want to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of specifies information about the gallery Application Version that + * you want to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @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 along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + ReplicationStatusTypes expand, + 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); + + /** + * 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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..5929fd910e0ff --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/GalleryApplicationsClient.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.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 the {@link SyncPoller} for polling of specifies information about the gallery Application Definition that + * you want to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of specifies information about the gallery Application Definition that + * you want to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of specifies information about the gallery Application Definition that + * you want to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of specifies information about the gallery Application Definition that + * you want to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request 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 along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String galleryName, String galleryApplicationName, 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); + + /** + * 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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..41d0653077709 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/GalleryImageVersionsClient.java @@ -0,0 +1,375 @@ +// Copyright (c) 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 the {@link SyncPoller} for polling of specifies information about the gallery image version that you want + * to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of specifies information about the gallery image version that you want + * to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of specifies information about the gallery image version that you want + * to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of specifies information about the gallery image version that you want + * to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @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 along with {@link + * Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String galleryName, + String galleryImageName, + String galleryImageVersionName, + ReplicationStatusTypes expand, + 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); + + /** + * 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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..96fed6d1a10d8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/GalleryImagesClient.java @@ -0,0 +1,318 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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 the {@link SyncPoller} for polling of specifies information about the gallery image definition that you + * want to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of specifies information about the gallery image definition that you + * want to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of specifies information about the gallery image definition that you + * want to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of specifies information about the gallery image definition that you + * want to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request 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 along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String galleryName, String galleryImageName, 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); + + /** + * 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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..ac70e8a16a637 --- /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 the {@link SyncPoller} for polling of specifies information about the gallery sharing profile update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of specifies information about the gallery sharing profile update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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..637f364abeada --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/ImagesClient.java @@ -0,0 +1,286 @@ +// Copyright (c) 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the source user image virtual hard disk. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the source user image virtual hard disk. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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.resourcemanager.compute.generated.models.ApiErrorException 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.resourcemanager.compute.generated.models.ApiErrorException 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the source user image virtual hard disk. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the source user image virtual hard disk. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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.resourcemanager.compute.generated.models.ApiErrorException 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.resourcemanager.compute.generated.models.ApiErrorException 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String 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.resourcemanager.compute.generated.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 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.resourcemanager.compute.generated.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 imageName, Context 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String imageName, String expand, 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.resourcemanager.compute.generated.models.ApiErrorException 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 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.resourcemanager.compute.generated.models.ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + @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.resourcemanager.compute.generated.models.ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + @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.resourcemanager.compute.generated.models.ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + @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.resourcemanager.compute.generated.models.ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + @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..e1dd6ff81d4b1 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/LogAnalyticsClient.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of logAnalytics operation status response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of logAnalytics operation status response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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.resourcemanager.compute.generated.models.ApiErrorException 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.resourcemanager.compute.generated.models.ApiErrorException 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of logAnalytics operation status response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of logAnalytics operation status response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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.resourcemanager.compute.generated.models.ApiErrorException 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.resourcemanager.compute.generated.models.ApiErrorException 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..abd34aacc96fc --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/OperationsClient.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.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.resourcemanager.compute.generated.models.ApiErrorException thrown if 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 as paginated response with {@link PagedIterable}. + */ + @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.resourcemanager.compute.generated.models.ApiErrorException thrown if 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 as paginated response with {@link PagedIterable}. + */ + @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..21b1799e8f077 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/ProximityPlacementGroupsClient.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.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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String proximityPlacementGroupName, + ProximityPlacementGroupInner parameters, + 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 com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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); + + /** + * 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String proximityPlacementGroupName, + ProximityPlacementGroupUpdate 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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); + + /** + * 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String proximityPlacementGroupName, 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.resourcemanager.compute.generated.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 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String proximityPlacementGroupName, String includeColocationStatus, 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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); + + /** + * Lists all proximity placement groups in 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 Proximity Placement Group operation response as paginated response with {@link PagedIterable}. + */ + @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.resourcemanager.compute.generated.models.ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + @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.resourcemanager.compute.generated.models.ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + @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.resourcemanager.compute.generated.models.ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + @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..c85cac0361b42 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/ResourceSkusClient.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.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.Compute SKUs available for your Subscription as paginated response with {@link + * PagedIterable}. + */ + @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 includeExtendedLocations To Include Extended Locations information or not in the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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.Compute SKUs available for your Subscription as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String filter, String includeExtendedLocations, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/RestorePointCollectionsClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/RestorePointCollectionsClient.java new file mode 100644 index 0000000000000..7b54cd5c3464b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/RestorePointCollectionsClient.java @@ -0,0 +1,248 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.compute.generated.fluent.models.RestorePointCollectionInner; +import com.azure.resourcemanager.compute.generated.models.RestorePointCollectionExpandOptions; +import com.azure.resourcemanager.compute.generated.models.RestorePointCollectionUpdate; + +/** An instance of this class provides access to all the operations defined in RestorePointCollectionsClient. */ +public interface RestorePointCollectionsClient { + /** + * The operation to create or update the restore point collection. Please refer to https://aka.ms/RestorePoints for + * more details. When updating a restore point collection, only tags may be modified. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param parameters Parameters supplied to the Create or Update restore point collection operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return create or update Restore Point collection parameters along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String restorePointCollectionName, + RestorePointCollectionInner parameters, + Context context); + + /** + * The operation to create or update the restore point collection. Please refer to https://aka.ms/RestorePoints for + * more details. When updating a restore point collection, only tags may be modified. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param parameters Parameters supplied to the Create or Update restore point collection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return create or update Restore Point collection parameters. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RestorePointCollectionInner createOrUpdate( + String resourceGroupName, String restorePointCollectionName, RestorePointCollectionInner parameters); + + /** + * The operation to update the restore point collection. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param parameters Parameters supplied to the Update restore point collection operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return create or update Restore Point collection parameters along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String restorePointCollectionName, + RestorePointCollectionUpdate parameters, + Context context); + + /** + * The operation to update the restore point collection. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param parameters Parameters supplied to the Update restore point collection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return create or update Restore Point collection parameters. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RestorePointCollectionInner update( + String resourceGroupName, String restorePointCollectionName, RestorePointCollectionUpdate parameters); + + /** + * The operation to delete the restore point collection. This operation will also delete all the contained restore + * points. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the Restore Point Collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String restorePointCollectionName); + + /** + * The operation to delete the restore point collection. This operation will also delete all the contained restore + * points. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the Restore Point Collection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String restorePointCollectionName, Context context); + + /** + * The operation to delete the restore point collection. This operation will also delete all the contained restore + * points. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the Restore Point Collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String restorePointCollectionName); + + /** + * The operation to delete the restore point collection. This operation will also delete all the contained restore + * points. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the Restore Point Collection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String restorePointCollectionName, Context context); + + /** + * The operation to get the restore point collection. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param expand The expand expression to apply on the operation. If expand=restorePoints, server will return all + * contained restore points in the restorePointCollection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return create or update Restore Point collection parameters along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, + String restorePointCollectionName, + RestorePointCollectionExpandOptions expand, + Context context); + + /** + * The operation to get the restore point collection. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return create or update Restore Point collection parameters. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RestorePointCollectionInner getByResourceGroup(String resourceGroupName, String restorePointCollectionName); + + /** + * Gets the list of restore point collections in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of restore point collections in a resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets the list of restore point collections in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of restore point collections in a resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets the list of restore point collections in the subscription. Use nextLink property in the response to get the + * next page of restore point collections. Do this till nextLink is not null to fetch all the restore point + * collections. + * + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of restore point collections in the subscription as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets the list of restore point collections in the subscription. Use nextLink property in the response to get the + * next page of restore point collections. Do this till nextLink is not null to fetch all the restore point + * collections. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of restore point collections in the subscription as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/RestorePointsClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/RestorePointsClient.java new file mode 100644 index 0000000000000..9bac09a6e38d6 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/RestorePointsClient.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.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.compute.generated.fluent.models.RestorePointInner; +import com.azure.resourcemanager.compute.generated.models.RestorePointExpandOptions; + +/** An instance of this class provides access to all the operations defined in RestorePointsClient. */ +public interface RestorePointsClient { + /** + * The operation to create the restore point. Updating properties of an existing restore point is not allowed. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param restorePointName The name of the restore point. + * @param parameters Parameters supplied to the Create restore point operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of restore Point details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RestorePointInner> beginCreate( + String resourceGroupName, + String restorePointCollectionName, + String restorePointName, + RestorePointInner parameters); + + /** + * The operation to create the restore point. Updating properties of an existing restore point is not allowed. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param restorePointName The name of the restore point. + * @param parameters Parameters supplied to the Create restore point operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of restore Point details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RestorePointInner> beginCreate( + String resourceGroupName, + String restorePointCollectionName, + String restorePointName, + RestorePointInner parameters, + Context context); + + /** + * The operation to create the restore point. Updating properties of an existing restore point is not allowed. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param restorePointName The name of the restore point. + * @param parameters Parameters supplied to the Create restore point operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return restore Point details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RestorePointInner create( + String resourceGroupName, + String restorePointCollectionName, + String restorePointName, + RestorePointInner parameters); + + /** + * The operation to create the restore point. Updating properties of an existing restore point is not allowed. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param restorePointName The name of the restore point. + * @param parameters Parameters supplied to the Create restore point operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return restore Point details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RestorePointInner create( + String resourceGroupName, + String restorePointCollectionName, + String restorePointName, + RestorePointInner parameters, + Context context); + + /** + * The operation to delete the restore point. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the Restore Point Collection. + * @param restorePointName The name of the restore point. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String restorePointCollectionName, String restorePointName); + + /** + * The operation to delete the restore point. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the Restore Point Collection. + * @param restorePointName The name of the restore point. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String restorePointCollectionName, String restorePointName, Context context); + + /** + * The operation to delete the restore point. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the Restore Point Collection. + * @param restorePointName The name of the restore point. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String restorePointCollectionName, String restorePointName); + + /** + * The operation to delete the restore point. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the Restore Point Collection. + * @param restorePointName The name of the restore point. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String restorePointCollectionName, String restorePointName, Context context); + + /** + * The operation to get the restore point. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param restorePointName The name of the restore point. + * @param expand The expand expression to apply on the operation. 'InstanceView' retrieves information about the + * run-time state of a restore point. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return restore Point details along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String restorePointCollectionName, + String restorePointName, + RestorePointExpandOptions expand, + Context context); + + /** + * The operation to get the restore point. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param restorePointName The name of the restore point. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return restore Point details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RestorePointInner get(String resourceGroupName, String restorePointCollectionName, String restorePointName); +} 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..c51caba1b1b34 --- /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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String location, String galleryUniqueName, 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); +} 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..8d3a93e2a2035 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/SharedGalleryImageVersionsClient.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.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 as paginated response with {@link + * PagedIterable}. + */ + @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 as paginated response with {@link + * PagedIterable}. + */ + @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>. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String location, + String galleryUniqueName, + String galleryImageName, + String galleryImageVersionName, + 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); +} 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..2d6a9328af861 --- /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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String location, String galleryUniqueName, String galleryImageName, 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); +} 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..c7344fa983f7c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/SnapshotsClient.java @@ -0,0 +1,426 @@ +// Copyright (c) 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 the {@link SyncPoller} for polling of snapshot resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of snapshot resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of snapshot resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of snapshot resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String snapshotName, 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); + + /** + * 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 the {@link SyncPoller} for polling of a disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of a disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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..f8b9f7dc0db99 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/SshPublicKeysClient.java @@ -0,0 +1,228 @@ +// Copyright (c) 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.resourcemanager.compute.generated.models.ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + @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.resourcemanager.compute.generated.models.ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + @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.resourcemanager.compute.generated.models.ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + @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.resourcemanager.compute.generated.models.ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + @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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse( + String resourceGroupName, String sshPublicKeyName, SshPublicKeyResourceInner parameters, 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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); + + /** + * 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, String sshPublicKeyName, SshPublicKeyUpdateResource 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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); + + /** + * 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String sshPublicKeyName, 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.resourcemanager.compute.generated.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 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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); + + /** + * 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.resourcemanager.compute.generated.models.ApiErrorException 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response generateKeyPairWithResponse( + 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.resourcemanager.compute.generated.models.ApiErrorException 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); +} 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..24ac1c4f5e7af --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/UsagesClient.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; + +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.resourcemanager.compute.generated.models.ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + @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.resourcemanager.compute.generated.models.ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + @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..a2da99657bbcb --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineExtensionImagesClient.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.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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String location, String publisherName, String type, String version, 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 com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 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.resourcemanager.compute.generated.models.ApiErrorException thrown if 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response> listTypesWithResponse( + String location, String publisherName, 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.resourcemanager.compute.generated.models.ApiErrorException thrown if 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 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.resourcemanager.compute.generated.models.ApiErrorException thrown if 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response> listVersionsWithResponse( + String location, + String publisherName, + String type, + String filter, + Integer top, + String orderby, + 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.resourcemanager.compute.generated.models.ApiErrorException thrown if 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); +} 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..39eacc600ba0e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineExtensionsClient.java @@ -0,0 +1,311 @@ +// Copyright (c) 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes a Virtual Machine Extension. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes a Virtual Machine Extension. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes a Virtual Machine Extension. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes a Virtual Machine Extension. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String 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.resourcemanager.compute.generated.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 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.resourcemanager.compute.generated.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 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. + * @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 Extension along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String vmName, String vmExtensionName, String expand, 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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 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.resourcemanager.compute.generated.models.ApiErrorException thrown 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse( + String resourceGroupName, String vmName, 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.resourcemanager.compute.generated.models.ApiErrorException thrown 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); +} 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..6ea7f5bc5a1a3 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineImagesClient.java @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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 com.azure.resourcemanager.compute.generated.fluent.models.VmImagesInEdgeZoneListResultInner; +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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String location, String publisherName, String offer, String skus, String version, 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 com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 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.resourcemanager.compute.generated.models.ApiErrorException thrown if 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 along + * with {@link Response}. + */ + @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 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.resourcemanager.compute.generated.models.ApiErrorException thrown if 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 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.resourcemanager.compute.generated.models.ApiErrorException thrown if 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 along with {@link + * Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response> listOffersWithResponse( + String location, String publisherName, 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.resourcemanager.compute.generated.models.ApiErrorException thrown if 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 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.resourcemanager.compute.generated.models.ApiErrorException thrown if 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response> listPublishersWithResponse(String location, 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.resourcemanager.compute.generated.models.ApiErrorException thrown if 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 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.resourcemanager.compute.generated.models.ApiErrorException thrown if 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 along with {@link + * Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response> listSkusWithResponse( + String location, String publisherName, String offer, 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.resourcemanager.compute.generated.models.ApiErrorException thrown if 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 all virtual machine image versions for the specified 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 all virtual machine image versions for the specified edge zone along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listByEdgeZoneWithResponse( + String location, String edgeZone, Context context); + + /** + * Gets a list of all virtual machine image versions for the specified 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 all virtual machine image versions for the specified edge zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VmImagesInEdgeZoneListResultInner listByEdgeZone(String location, String edgeZone); +} 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..e0f0cc0be0a75 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineImagesEdgeZonesClient.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.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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String location, + String edgeZone, + String publisherName, + String offer, + String skus, + String version, + 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 com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 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 along with {@link Response}. + */ + @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 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 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 along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response> listOffersWithResponse( + String location, String edgeZone, String publisherName, 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 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 along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response> listPublishersWithResponse( + String location, String edgeZone, 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 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 along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response> listSkusWithResponse( + String location, String edgeZone, String publisherName, String offer, 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); +} 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..0900a5fe6cce6 --- /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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String location, String commandId, 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); + + /** + * 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 the {@link SyncPoller} for polling of describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByVirtualMachineWithResponse( + String resourceGroupName, String vmName, String runCommandName, String expand, 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 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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..3c328152a3b69 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineScaleSetExtensionsClient.java @@ -0,0 +1,315 @@ +// Copyright (c) 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes a Virtual Machine Scale Set Extension. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes a Virtual Machine Scale Set Extension. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes a Virtual Machine Scale Set Extension. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes a Virtual Machine Scale Set Extension. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String 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.resourcemanager.compute.generated.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 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.resourcemanager.compute.generated.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 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. + * @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 Scale Set Extension along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String vmScaleSetName, String vmssExtensionName, String expand, 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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); + + /** + * 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.resourcemanager.compute.generated.models.ApiErrorException thrown if 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 as paginated response with {@link PagedIterable}. + */ + @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.resourcemanager.compute.generated.models.ApiErrorException thrown if 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 as paginated response with {@link PagedIterable}. + */ + @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..f9990a59fb153 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineScaleSetRollingUpgradesClient.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.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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> 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.resourcemanager.compute.generated.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 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.resourcemanager.compute.generated.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 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> 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.resourcemanager.compute.generated.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 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.resourcemanager.compute.generated.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 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> 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.resourcemanager.compute.generated.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 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.resourcemanager.compute.generated.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 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getLatestWithResponse( + 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.resourcemanager.compute.generated.models.ApiErrorException 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); +} 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..8d9d23069500b --- /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 the {@link SyncPoller} for polling of describes a VMSS VM Extension. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of describes a VMSS VM Extension. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of describes a VMSS VM Extension. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of describes a VMSS VM Extension. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String vmExtensionName, + String expand, + 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 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse( + String resourceGroupName, String vmScaleSetName, String instanceId, 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); +} 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..87f7b21f497d8 --- /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 the {@link SyncPoller} for polling of describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String runCommandName, + String expand, + 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 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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..5c3a481935d86 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineScaleSetVMsClient.java @@ -0,0 +1,941 @@ +// Copyright (c) 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginReimage(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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void reimage(String resourceGroupName, String 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void reimage( + String resourceGroupName, + String 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> 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.resourcemanager.compute.generated.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 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.resourcemanager.compute.generated.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 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> 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.resourcemanager.compute.generated.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 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.resourcemanager.compute.generated.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 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes a virtual machine scale set virtual machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes a virtual machine scale set virtual machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.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); + + /** + * 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.resourcemanager.compute.generated.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, 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. + * @param expand The expand expression to apply on the operation. 'InstanceView' will retrieve the instance view of + * the virtual machine. 'UserData' will retrieve the UserData of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String vmScaleSetName, String instanceId, InstanceViewTypes expand, 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.resourcemanager.compute.generated.models.ApiErrorException 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 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.resourcemanager.compute.generated.models.ApiErrorException 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getInstanceViewWithResponse( + String resourceGroupName, String vmScaleSetName, String instanceId, 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.resourcemanager.compute.generated.models.ApiErrorException 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 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.resourcemanager.compute.generated.models.ApiErrorException thrown if 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 as paginated response with {@link PagedIterable}. + */ + @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.resourcemanager.compute.generated.models.ApiErrorException thrown if 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 as paginated response with {@link PagedIterable}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginPowerOff( + 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void powerOff(String resourceGroupName, String 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void powerOff( + String resourceGroupName, String 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginRestart(String resourceGroupName, String 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginRestart( + String resourceGroupName, String 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void restart(String resourceGroupName, String 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void restart(String resourceGroupName, String 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginStart(String resourceGroupName, String 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginStart( + String resourceGroupName, String 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void start(String resourceGroupName, String 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void start(String resourceGroupName, String 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> 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.resourcemanager.compute.generated.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 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.resourcemanager.compute.generated.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 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. + * @param sasUriExpirationTimeInMinutes Expiration duration in minutes for the SAS URIs with a value between 1 to + * 1440 minutes. **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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response retrieveBootDiagnosticsDataWithResponse( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + Integer sasUriExpirationTimeInMinutes, + 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); + + /** + * 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> 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.resourcemanager.compute.generated.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 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.resourcemanager.compute.generated.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 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response simulateEvictionWithResponse( + 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.resourcemanager.compute.generated.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 simulateEviction(String resourceGroupName, String vmScaleSetName, String instanceId); + + /** + * 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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..77a6ad67cf7f3 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineScaleSetsClient.java @@ -0,0 +1,1347 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.compute.generated.fluent.models.RecoveryWalkResponseInner; +import com.azure.resourcemanager.compute.generated.fluent.models.UpgradeOperationHistoricalStatusInfoInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetInstanceViewInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetSkuInner; +import com.azure.resourcemanager.compute.generated.models.ExpandTypesForGetVMScaleSets; +import com.azure.resourcemanager.compute.generated.models.OrchestrationServiceStateInput; +import com.azure.resourcemanager.compute.generated.models.VMScaleSetConvertToSinglePlacementGroupInput; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetReimageParameters; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetUpdate; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMInstanceIDs; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMInstanceRequiredIDs; + +/** An instance of this class provides access to all the operations defined in VirtualMachineScaleSetsClient. */ +public interface VirtualMachineScaleSetsClient { + /** + * Gets all the VM scale sets under the specified subscription for the specified location. + * + * @param location The location for which VM scale sets under the subscription are queried. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the VM scale sets under the specified subscription for the specified location as paginated response + * with {@link PagedIterable}. + */ + @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 as paginated response + * with {@link PagedIterable}. + */ + @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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes a Virtual Machine Scale Set. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes a Virtual Machine Scale Set. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes a Virtual Machine Scale Set. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes a Virtual Machine Scale Set. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.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); + + /** + * 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.resourcemanager.compute.generated.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, 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. + * @param expand The expand expression to apply on the operation. 'UserData' retrieves the UserData property of the + * VM scale set that was provided by the user during the VM scale set Create/Update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String vmScaleSetName, ExpandTypesForGetVMScaleSets expand, 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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); + + /** + * 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDeallocate(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 hibernate Optional parameter to hibernate a virtual machine from the VM scale set. (This feature is + * available for VMSS with Flexible OrchestrationMode only). + * @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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDeallocate( + String resourceGroupName, + String vmScaleSetName, + Boolean hibernate, + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.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 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 hibernate Optional parameter to hibernate a virtual machine from the VM scale set. (This feature is + * available for VMSS with Flexible OrchestrationMode only). + * @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.resourcemanager.compute.generated.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 deallocate( + String resourceGroupName, + String vmScaleSetName, + Boolean hibernate, + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDeleteInstances( + 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deleteInstances( + String resourceGroupName, String 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deleteInstances( + String resourceGroupName, + String 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getInstanceViewWithResponse( + String resourceGroupName, String vmScaleSetName, 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.resourcemanager.compute.generated.models.ApiErrorException 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 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.resourcemanager.compute.generated.models.ApiErrorException thrown if 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 as paginated response with {@link PagedIterable}. + */ + @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.resourcemanager.compute.generated.models.ApiErrorException thrown if 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 as paginated response with {@link PagedIterable}. + */ + @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.resourcemanager.compute.generated.models.ApiErrorException thrown if 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 as paginated + * response with {@link PagedIterable}. + */ + @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.resourcemanager.compute.generated.models.ApiErrorException thrown if 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 as paginated + * response with {@link PagedIterable}. + */ + @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.resourcemanager.compute.generated.models.ApiErrorException thrown if 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 as paginated response with {@link PagedIterable}. + */ + @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.resourcemanager.compute.generated.models.ApiErrorException thrown if 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 as paginated response with {@link PagedIterable}. + */ + @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.resourcemanager.compute.generated.models.ApiErrorException 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 as paginated response with {@link PagedIterable}. + */ + @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.resourcemanager.compute.generated.models.ApiErrorException 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 as paginated response with {@link PagedIterable}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginPowerOff(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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void powerOff(String resourceGroupName, String 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void powerOff( + String resourceGroupName, + String 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginRestart(String resourceGroupName, String 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginRestart( + String resourceGroupName, + String 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void restart(String resourceGroupName, String 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void restart( + String resourceGroupName, + String 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginStart(String resourceGroupName, String 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginStart( + String resourceGroupName, + String 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void start(String resourceGroupName, String 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void start( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context); + + /** + * Reapplies the Virtual Machine Scale Set Virtual Machine Profile to the Virtual Machine Instances. + * + * @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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginReapply(String resourceGroupName, String vmScaleSetName); + + /** + * Reapplies the Virtual Machine Scale Set Virtual Machine Profile to the Virtual Machine Instances. + * + * @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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginReapply(String resourceGroupName, String vmScaleSetName, Context context); + + /** + * Reapplies the Virtual Machine Scale Set Virtual Machine Profile to the Virtual Machine Instances. + * + * @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.resourcemanager.compute.generated.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 vmScaleSetName); + + /** + * Reapplies the Virtual Machine Scale Set Virtual Machine Profile to the Virtual Machine Instances. + * + * @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.resourcemanager.compute.generated.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 vmScaleSetName, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginRedeploy(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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.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 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.resourcemanager.compute.generated.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 redeploy( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context); + + /** + * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not + * eligible for perform maintenance will be failed. Please refer to best practices for more details: + * https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginPerformMaintenance(String resourceGroupName, String vmScaleSetName); + + /** + * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not + * eligible for perform maintenance will be failed. Please refer to best practices for more details: + * https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginPerformMaintenance( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context); + + /** + * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not + * eligible for perform maintenance will be failed. Please refer to best practices for more details: + * https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.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 performMaintenance(String resourceGroupName, String vmScaleSetName); + + /** + * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not + * eligible for perform maintenance will be failed. Please refer to best practices for more details: + * https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.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 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> 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.resourcemanager.compute.generated.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 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.resourcemanager.compute.generated.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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginReimage(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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void reimage(String resourceGroupName, String 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void reimage( + String resourceGroupName, + String 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginReimageAll(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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.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 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.resourcemanager.compute.generated.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 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. + * @param zone The zone in which the manual recovery walk is requested for cross zone virtual machine scale set. + * @param placementGroupId The placement group id for which the 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.resourcemanager.compute.generated.models.ApiErrorException 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response forceRecoveryServiceFabricPlatformUpdateDomainWalkWithResponse( + String resourceGroupName, + String vmScaleSetName, + int platformUpdateDomain, + String zone, + String placementGroupId, + 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.resourcemanager.compute.generated.models.ApiErrorException 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); + + /** + * 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response convertToSinglePlacementGroupWithResponse( + String resourceGroupName, + String vmScaleSetName, + VMScaleSetConvertToSinglePlacementGroupInput parameters, + 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.resourcemanager.compute.generated.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 convertToSinglePlacementGroup( + String resourceGroupName, String vmScaleSetName, VMScaleSetConvertToSinglePlacementGroupInput 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> 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.resourcemanager.compute.generated.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 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.resourcemanager.compute.generated.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 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..41998e206421b --- /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/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.resourcemanager.compute.generated.models.ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location); + + /** + * This API is deprecated. Use [Resources Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list). + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + @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..b5522f2addd48 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachinesClient.java @@ -0,0 +1,1324 @@ +// Copyright (c) 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.ExpandTypeForListVMs; +import com.azure.resourcemanager.compute.generated.models.ExpandTypesForListVMs; +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.resourcemanager.compute.generated.models.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 virtual machines under the specified subscription for the specified location as paginated + * response with {@link PagedIterable}. + */ + @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.resourcemanager.compute.generated.models.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 virtual machines under the specified subscription for the specified location as paginated + * response with {@link PagedIterable}. + */ + @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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of output of virtual machine capture operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of output of virtual machine capture operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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.resourcemanager.compute.generated.models.ApiErrorException 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.resourcemanager.compute.generated.models.ApiErrorException 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes a Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes a Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes a Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes a Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.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); + + /** + * 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.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, 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. + * @param expand The expand expression to apply on the operation. 'InstanceView' retrieves a snapshot of the runtime + * properties of the virtual machine that is managed by the platform and can change outside of control plane + * operations. 'UserData' retrieves the UserData property as part of the VM model view that was provided by the + * user during the VM Create/Update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String vmName, InstanceViewTypes expand, 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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 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.resourcemanager.compute.generated.models.ApiErrorException 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response instanceViewWithResponse( + String resourceGroupName, String vmName, 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.resourcemanager.compute.generated.models.ApiErrorException 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); + + /** + * 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> 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.resourcemanager.compute.generated.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 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.resourcemanager.compute.generated.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 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> 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 hibernate Optional parameter to hibernate a virtual machine. (Feature in Preview). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDeallocate( + String resourceGroupName, String vmName, Boolean hibernate, 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.resourcemanager.compute.generated.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 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 hibernate Optional parameter to hibernate a virtual machine. (Feature in Preview). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.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 deallocate(String resourceGroupName, String vmName, Boolean hibernate, Context context); + + /** + * Sets the OS state of the virtual machine to generalized. It is recommended to sysprep the virtual machine before + * performing this operation. For Windows, please refer to [Create a managed image of a generalized VM in + * Azure](https://docs.microsoft.com/azure/virtual-machines/windows/capture-image-resource). For Linux, please refer + * to [How to create an image of a virtual machine or + * VHD](https://docs.microsoft.com/azure/virtual-machines/linux/capture-image). + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response generalizeWithResponse(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. For Windows, please refer to [Create a managed image of a generalized VM in + * Azure](https://docs.microsoft.com/azure/virtual-machines/windows/capture-image-resource). For Linux, please refer + * to [How to create an image of a virtual machine or + * VHD](https://docs.microsoft.com/azure/virtual-machines/linux/capture-image). + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.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 generalize(String resourceGroupName, String vmName); + + /** + * 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.resourcemanager.compute.generated.models.ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + @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 filter The system query option to filter VMs returned in the response. Allowed value is + * 'virtualMachineScaleSet/id' eq + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}'. + * @param expand The expand expression to apply on operation. 'instanceView' enables fetching run time status of all + * Virtual Machines, this can only be specified if a valid $filter option is specified. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup( + String resourceGroupName, String filter, ExpandTypeForListVMs expand, 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.resourcemanager.compute.generated.models.ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + @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 filter The system query option to filter VMs returned in the response. Allowed value is + * 'virtualMachineScaleSet/id' eq + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}'. + * @param expand The expand expression to apply on operation. 'instanceView' enables fetching run time status of all + * Virtual Machines, this can only be specified if a valid $filter option is specified. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String statusOnly, String filter, ExpandTypesForListVMs expand, 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.resourcemanager.compute.generated.models.ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + @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.resourcemanager.compute.generated.models.ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginPowerOff(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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void powerOff(String resourceGroupName, String 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void powerOff(String resourceGroupName, String 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginRestart(String resourceGroupName, String 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginRestart(String resourceGroupName, String 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void restart(String resourceGroupName, String 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void restart(String resourceGroupName, String 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginStart(String resourceGroupName, String 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginStart(String resourceGroupName, String 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void start(String resourceGroupName, String 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void start(String resourceGroupName, String 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> 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.resourcemanager.compute.generated.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 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.resourcemanager.compute.generated.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 redeploy(String resourceGroupName, String vmName, Context context); + + /** + * Reimages (upgrade the operating system) a virtual machine 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. NOTE: The retaining of old + * OS disk depends on the value of deleteOption of OS disk. If deleteOption is detach, the old OS disk will be + * preserved after reimage. If deleteOption is delete, the old OS disk will be deleted after reimage. The + * deleteOption of the OS disk should be updated accordingly before performing the reimage. + * + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginReimage(String resourceGroupName, String vmName); + + /** + * Reimages (upgrade the operating system) a virtual machine 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. NOTE: The retaining of old + * OS disk depends on the value of deleteOption of OS disk. If deleteOption is detach, the old OS disk will be + * preserved after reimage. If deleteOption is delete, the old OS disk will be deleted after reimage. The + * deleteOption of the OS disk should be updated accordingly before performing the reimage. + * + * @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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginReimage( + String resourceGroupName, String vmName, VirtualMachineReimageParameters parameters, Context context); + + /** + * Reimages (upgrade the operating system) a virtual machine 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. NOTE: The retaining of old + * OS disk depends on the value of deleteOption of OS disk. If deleteOption is detach, the old OS disk will be + * preserved after reimage. If deleteOption is delete, the old OS disk will be deleted after reimage. The + * deleteOption of the OS disk should be updated accordingly before performing the reimage. + * + * @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 reimage(String resourceGroupName, String vmName); + + /** + * Reimages (upgrade the operating system) a virtual machine 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. NOTE: The retaining of old + * OS disk depends on the value of deleteOption of OS disk. If deleteOption is detach, the old OS disk will be + * preserved after reimage. If deleteOption is delete, the old OS disk will be deleted after reimage. The + * deleteOption of the OS disk should be updated accordingly before performing the reimage. + * + * @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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void reimage(String resourceGroupName, String 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. + * @param sasUriExpirationTimeInMinutes Expiration duration in minutes for the SAS URIs with a value between 1 to + * 1440 minutes. **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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response retrieveBootDiagnosticsDataWithResponse( + String resourceGroupName, String vmName, Integer sasUriExpirationTimeInMinutes, 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 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> 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.resourcemanager.compute.generated.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 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.resourcemanager.compute.generated.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 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response simulateEvictionWithResponse(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.resourcemanager.compute.generated.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 simulateEviction(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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes the properties of an AssessPatches result. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of describes the properties of an AssessPatches result. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of the result summary of an installation operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of the result summary of an installation operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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..a724f7b47d1b3 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/AccessUriInner.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.fasterxml.jackson.annotation.JsonProperty; + +/** A disk access SAS uri. */ +@Immutable +public final class AccessUriInner { + /* + * A SAS uri for accessing a disk. + */ + @JsonProperty(value = "accessSAS", access = JsonProperty.Access.WRITE_ONLY) + private String accessSas; + + /* + * A SAS uri for accessing a VM guest state. + */ + @JsonProperty(value = "securityDataAccessSAS", access = JsonProperty.Access.WRITE_ONLY) + private String securityDataAccessSas; + + /** Creates an instance of AccessUriInner class. */ + public AccessUriInner() { + } + + /** + * Get the accessSas property: A SAS uri for accessing a disk. + * + * @return the accessSas value. + */ + public String accessSas() { + return this.accessSas; + } + + /** + * Get the securityDataAccessSas property: A SAS uri for accessing a VM guest state. + * + * @return the securityDataAccessSas value. + */ + public String securityDataAccessSas() { + return this.securityDataAccessSas; + } + + /** + * 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..a69bc04a7f7c8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/AvailabilitySetInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.compute.generated.models.InstanceViewStatus; +import com.azure.resourcemanager.compute.generated.models.Sku; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** + * Specifies information about the availability set that the virtual machine should be assigned to. Virtual machines + * specified in the same availability set are allocated to different nodes to maximize availability. For more + * information about availability sets, see [Availability sets + * overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). For more information on Azure + * planned maintenance, see [Maintenance and updates for Virtual Machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates). Currently, a VM can only be added + * to an availability set at creation time. An existing VM cannot be added to an availability set. + */ +@Fluent +public final class AvailabilitySetInner extends Resource { + /* + * The instance view of a resource. + */ + @JsonProperty(value = "properties") + private AvailabilitySetProperties innerProperties; + + /* + * 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; + + /** Creates an instance of AvailabilitySetInner class. */ + public AvailabilitySetInner() { + } + + /** + * Get the innerProperties property: The instance view of a resource. + * + * @return the innerProperties value. + */ + private AvailabilitySetProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** {@inheritDoc} */ + @Override + public AvailabilitySetInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public AvailabilitySetInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the platformUpdateDomainCount property: Update Domain count. + * + * @return the platformUpdateDomainCount value. + */ + public Integer platformUpdateDomainCount() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new AvailabilitySetProperties(); + } + this.innerProperties().withPlatformUpdateDomainCount(platformUpdateDomainCount); + return this; + } + + /** + * Get the platformFaultDomainCount property: Fault Domain count. + * + * @return the platformFaultDomainCount value. + */ + public Integer platformFaultDomainCount() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new AvailabilitySetProperties(); + } + this.innerProperties().withPlatformFaultDomainCount(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new AvailabilitySetProperties(); + } + this.innerProperties().withVirtualMachines(virtualMachines); + return this; + } + + /** + * Get the proximityPlacementGroup property: Specifies information about the proximity placement group that the + * availability set should be assigned to. Minimum api-version: 2018-04-01. + * + * @return the proximityPlacementGroup value. + */ + public SubResource proximityPlacementGroup() { + return this.innerProperties() == null ? null : this.innerProperties().proximityPlacementGroup(); + } + + /** + * Set the proximityPlacementGroup property: Specifies information about the proximity placement group that the + * availability set should be assigned to. Minimum api-version: 2018-04-01. + * + * @param proximityPlacementGroup the proximityPlacementGroup value to set. + * @return the AvailabilitySetInner object itself. + */ + public AvailabilitySetInner withProximityPlacementGroup(SubResource proximityPlacementGroup) { + if (this.innerProperties() == null) { + this.innerProperties = new AvailabilitySetProperties(); + } + this.innerProperties().withProximityPlacementGroup(proximityPlacementGroup); + return this; + } + + /** + * Get the statuses property: The resource status information. + * + * @return the statuses value. + */ + public List statuses() { + return this.innerProperties() == null ? null : this.innerProperties().statuses(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + if (sku() != null) { + sku().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/AvailabilitySetProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/AvailabilitySetProperties.java new file mode 100644 index 0000000000000..905963151dd9d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/AvailabilitySetProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.compute.generated.models.InstanceViewStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The instance view of a resource. */ +@Fluent +public final class AvailabilitySetProperties { + /* + * Update Domain count. + */ + @JsonProperty(value = "platformUpdateDomainCount") + private Integer platformUpdateDomainCount; + + /* + * Fault Domain count. + */ + @JsonProperty(value = "platformFaultDomainCount") + private Integer platformFaultDomainCount; + + /* + * A list of references to all virtual machines in the availability set. + */ + @JsonProperty(value = "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 = "proximityPlacementGroup") + private SubResource proximityPlacementGroup; + + /* + * The resource status information. + */ + @JsonProperty(value = "statuses", access = JsonProperty.Access.WRITE_ONLY) + private List statuses; + + /** Creates an instance of AvailabilitySetProperties class. */ + public AvailabilitySetProperties() { + } + + /** + * 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 AvailabilitySetProperties object itself. + */ + public AvailabilitySetProperties 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 AvailabilitySetProperties object itself. + */ + public AvailabilitySetProperties 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 AvailabilitySetProperties object itself. + */ + public AvailabilitySetProperties 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. 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. Minimum api-version: 2018-04-01. + * + * @param proximityPlacementGroup the proximityPlacementGroup value to set. + * @return the AvailabilitySetProperties object itself. + */ + public AvailabilitySetProperties 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (statuses() != null) { + statuses().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/CapacityReservationGroupInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/CapacityReservationGroupInner.java new file mode 100644 index 0000000000000..646ae20a05644 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/CapacityReservationGroupInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.resourcemanager.compute.generated.models.CapacityReservationGroupInstanceView; +import com.azure.resourcemanager.compute.generated.models.SubResourceReadOnly; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** + * Specifies information about the capacity reservation group that the capacity reservations should be assigned to. + * Currently, a capacity reservation can only be added to a capacity reservation group at creation time. An existing + * capacity reservation cannot be added or moved to another capacity reservation group. + */ +@Fluent +public final class CapacityReservationGroupInner extends Resource { + /* + * capacity reservation group Properties. + */ + @JsonProperty(value = "properties") + private CapacityReservationGroupProperties innerProperties; + + /* + * Availability Zones to use for this capacity reservation group. The zones can be assigned only during creation. + * If not provided, the group supports only regional resources in the region. If provided, enforces each capacity + * reservation in the group to be in one of the zones. + */ + @JsonProperty(value = "zones") + private List zones; + + /** Creates an instance of CapacityReservationGroupInner class. */ + public CapacityReservationGroupInner() { + } + + /** + * Get the innerProperties property: capacity reservation group Properties. + * + * @return the innerProperties value. + */ + private CapacityReservationGroupProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the zones property: Availability Zones to use for this capacity reservation group. The zones can be assigned + * only during creation. If not provided, the group supports only regional resources in the region. If provided, + * enforces each capacity reservation in the group to be in one of the zones. + * + * @return the zones value. + */ + public List zones() { + return this.zones; + } + + /** + * Set the zones property: Availability Zones to use for this capacity reservation group. The zones can be assigned + * only during creation. If not provided, the group supports only regional resources in the region. If provided, + * enforces each capacity reservation in the group to be in one of the zones. + * + * @param zones the zones value to set. + * @return the CapacityReservationGroupInner object itself. + */ + public CapacityReservationGroupInner withZones(List zones) { + this.zones = zones; + return this; + } + + /** {@inheritDoc} */ + @Override + public CapacityReservationGroupInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public CapacityReservationGroupInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the capacityReservations property: A list of all capacity reservation resource ids that belong to capacity + * reservation group. + * + * @return the capacityReservations value. + */ + public List capacityReservations() { + return this.innerProperties() == null ? null : this.innerProperties().capacityReservations(); + } + + /** + * Get the virtualMachinesAssociated property: A list of references to all virtual machines associated to the + * capacity reservation group. + * + * @return the virtualMachinesAssociated value. + */ + public List virtualMachinesAssociated() { + return this.innerProperties() == null ? null : this.innerProperties().virtualMachinesAssociated(); + } + + /** + * Get the instanceView property: The capacity reservation group instance view which has the list of instance views + * for all the capacity reservations that belong to the capacity reservation group. + * + * @return the instanceView value. + */ + public CapacityReservationGroupInstanceView instanceView() { + return this.innerProperties() == null ? null : this.innerProperties().instanceView(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/CapacityReservationGroupProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/CapacityReservationGroupProperties.java new file mode 100644 index 0000000000000..3264369e05455 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/CapacityReservationGroupProperties.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.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.compute.generated.models.CapacityReservationGroupInstanceView; +import com.azure.resourcemanager.compute.generated.models.SubResourceReadOnly; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** capacity reservation group Properties. */ +@Immutable +public final class CapacityReservationGroupProperties { + /* + * A list of all capacity reservation resource ids that belong to capacity reservation group. + */ + @JsonProperty(value = "capacityReservations", access = JsonProperty.Access.WRITE_ONLY) + private List capacityReservations; + + /* + * A list of references to all virtual machines associated to the capacity reservation group. + */ + @JsonProperty(value = "virtualMachinesAssociated", access = JsonProperty.Access.WRITE_ONLY) + private List virtualMachinesAssociated; + + /* + * The capacity reservation group instance view which has the list of instance views for all the capacity + * reservations that belong to the capacity reservation group. + */ + @JsonProperty(value = "instanceView", access = JsonProperty.Access.WRITE_ONLY) + private CapacityReservationGroupInstanceView instanceView; + + /** Creates an instance of CapacityReservationGroupProperties class. */ + public CapacityReservationGroupProperties() { + } + + /** + * Get the capacityReservations property: A list of all capacity reservation resource ids that belong to capacity + * reservation group. + * + * @return the capacityReservations value. + */ + public List capacityReservations() { + return this.capacityReservations; + } + + /** + * Get the virtualMachinesAssociated property: A list of references to all virtual machines associated to the + * capacity reservation group. + * + * @return the virtualMachinesAssociated value. + */ + public List virtualMachinesAssociated() { + return this.virtualMachinesAssociated; + } + + /** + * Get the instanceView property: The capacity reservation group instance view which has the list of instance views + * for all the capacity reservations that belong to the capacity reservation group. + * + * @return the instanceView value. + */ + public CapacityReservationGroupInstanceView instanceView() { + return this.instanceView; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (capacityReservations() != null) { + capacityReservations().forEach(e -> e.validate()); + } + if (virtualMachinesAssociated() != null) { + virtualMachinesAssociated().forEach(e -> e.validate()); + } + if (instanceView() != null) { + instanceView().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/CapacityReservationInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/CapacityReservationInner.java new file mode 100644 index 0000000000000..8e14331916776 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/CapacityReservationInner.java @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.models.CapacityReservationInstanceView; +import com.azure.resourcemanager.compute.generated.models.Sku; +import com.azure.resourcemanager.compute.generated.models.SubResourceReadOnly; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** Specifies information about the capacity reservation. */ +@Fluent +public final class CapacityReservationInner extends Resource { + /* + * Properties of the Capacity reservation. + */ + @JsonProperty(value = "properties") + private CapacityReservationProperties innerProperties; + + /* + * SKU of the resource for which capacity needs be reserved. The SKU name and capacity is required to be set. + * Currently VM Skus with the capability called 'CapacityReservationSupported' set to true are supported. Refer to + * List Microsoft.Compute SKUs in a region (https://docs.microsoft.com/rest/api/compute/resourceskus/list) for + * supported values. + */ + @JsonProperty(value = "sku", required = true) + private Sku sku; + + /* + * Availability Zone to use for this capacity reservation. The zone has to be single value and also should be part + * for the list of zones specified during the capacity reservation group creation. The zone can be assigned only + * during creation. If not provided, the reservation supports only non-zonal deployments. If provided, enforces + * VM/VMSS using this capacity reservation to be in same zone. + */ + @JsonProperty(value = "zones") + private List zones; + + /** Creates an instance of CapacityReservationInner class. */ + public CapacityReservationInner() { + } + + /** + * Get the innerProperties property: Properties of the Capacity reservation. + * + * @return the innerProperties value. + */ + private CapacityReservationProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the sku property: SKU of the resource for which capacity needs be reserved. The SKU name and capacity is + * required to be set. Currently VM Skus with the capability called 'CapacityReservationSupported' set to true are + * supported. Refer to List Microsoft.Compute SKUs in a region + * (https://docs.microsoft.com/rest/api/compute/resourceskus/list) for supported values. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: SKU of the resource for which capacity needs be reserved. The SKU name and capacity is + * required to be set. Currently VM Skus with the capability called 'CapacityReservationSupported' set to true are + * supported. Refer to List Microsoft.Compute SKUs in a region + * (https://docs.microsoft.com/rest/api/compute/resourceskus/list) for supported values. + * + * @param sku the sku value to set. + * @return the CapacityReservationInner object itself. + */ + public CapacityReservationInner withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the zones property: Availability Zone to use for this capacity reservation. The zone has to be single value + * and also should be part for the list of zones specified during the capacity reservation group creation. The zone + * can be assigned only during creation. If not provided, the reservation supports only non-zonal deployments. If + * provided, enforces VM/VMSS using this capacity reservation to be in same zone. + * + * @return the zones value. + */ + public List zones() { + return this.zones; + } + + /** + * Set the zones property: Availability Zone to use for this capacity reservation. The zone has to be single value + * and also should be part for the list of zones specified during the capacity reservation group creation. The zone + * can be assigned only during creation. If not provided, the reservation supports only non-zonal deployments. If + * provided, enforces VM/VMSS using this capacity reservation to be in same zone. + * + * @param zones the zones value to set. + * @return the CapacityReservationInner object itself. + */ + public CapacityReservationInner withZones(List zones) { + this.zones = zones; + return this; + } + + /** {@inheritDoc} */ + @Override + public CapacityReservationInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public CapacityReservationInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the reservationId property: A unique id generated and assigned to the capacity reservation by the platform + * which does not change throughout the lifetime of the resource. + * + * @return the reservationId value. + */ + public String reservationId() { + return this.innerProperties() == null ? null : this.innerProperties().reservationId(); + } + + /** + * Get the platformFaultDomainCount property: Specifies the value of fault domain count that Capacity Reservation + * supports for requested VM size. **Note:** The fault domain count specified for a resource (like virtual machines + * scale set) must be less than or equal to this value if it deploys using capacity reservation. Minimum + * api-version: 2022-08-01. + * + * @return the platformFaultDomainCount value. + */ + public Integer platformFaultDomainCount() { + return this.innerProperties() == null ? null : this.innerProperties().platformFaultDomainCount(); + } + + /** + * Get the virtualMachinesAssociated property: A list of all virtual machine resource ids that are associated with + * the capacity reservation. + * + * @return the virtualMachinesAssociated value. + */ + public List virtualMachinesAssociated() { + return this.innerProperties() == null ? null : this.innerProperties().virtualMachinesAssociated(); + } + + /** + * Get the provisioningTime property: The date time when the capacity reservation was last updated. + * + * @return the provisioningTime value. + */ + public OffsetDateTime provisioningTime() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningTime(); + } + + /** + * Get the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the instanceView property: The Capacity reservation instance view. + * + * @return the instanceView value. + */ + public CapacityReservationInstanceView instanceView() { + return this.innerProperties() == null ? null : this.innerProperties().instanceView(); + } + + /** + * Get the timeCreated property: Specifies the time at which the Capacity Reservation resource was created. Minimum + * api-version: 2021-11-01. + * + * @return the timeCreated value. + */ + public OffsetDateTime timeCreated() { + return this.innerProperties() == null ? null : this.innerProperties().timeCreated(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + if (sku() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property sku in model CapacityReservationInner")); + } else { + sku().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CapacityReservationInner.class); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/CapacityReservationProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/CapacityReservationProperties.java new file mode 100644 index 0000000000000..4ae7aa92be3b4 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/CapacityReservationProperties.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.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.compute.generated.models.CapacityReservationInstanceView; +import com.azure.resourcemanager.compute.generated.models.SubResourceReadOnly; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Properties of the Capacity reservation. */ +@Immutable +public final class CapacityReservationProperties { + /* + * A unique id generated and assigned to the capacity reservation by the platform which does not change throughout + * the lifetime of the resource. + */ + @JsonProperty(value = "reservationId", access = JsonProperty.Access.WRITE_ONLY) + private String reservationId; + + /* + * Specifies the value of fault domain count that Capacity Reservation supports for requested VM size. **Note:** + * The fault domain count specified for a resource (like virtual machines scale set) must be less than or equal to + * this value if it deploys using capacity reservation. Minimum api-version: 2022-08-01. + */ + @JsonProperty(value = "platformFaultDomainCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer platformFaultDomainCount; + + /* + * A list of all virtual machine resource ids that are associated with the capacity reservation. + */ + @JsonProperty(value = "virtualMachinesAssociated", access = JsonProperty.Access.WRITE_ONLY) + private List virtualMachinesAssociated; + + /* + * The date time when the capacity reservation was last updated. + */ + @JsonProperty(value = "provisioningTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime provisioningTime; + + /* + * The provisioning state, which only appears in the response. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The Capacity reservation instance view. + */ + @JsonProperty(value = "instanceView", access = JsonProperty.Access.WRITE_ONLY) + private CapacityReservationInstanceView instanceView; + + /* + * Specifies the time at which the Capacity Reservation resource was created. Minimum api-version: 2021-11-01. + */ + @JsonProperty(value = "timeCreated", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime timeCreated; + + /** Creates an instance of CapacityReservationProperties class. */ + public CapacityReservationProperties() { + } + + /** + * Get the reservationId property: A unique id generated and assigned to the capacity reservation by the platform + * which does not change throughout the lifetime of the resource. + * + * @return the reservationId value. + */ + public String reservationId() { + return this.reservationId; + } + + /** + * Get the platformFaultDomainCount property: Specifies the value of fault domain count that Capacity Reservation + * supports for requested VM size. **Note:** The fault domain count specified for a resource (like virtual machines + * scale set) must be less than or equal to this value if it deploys using capacity reservation. Minimum + * api-version: 2022-08-01. + * + * @return the platformFaultDomainCount value. + */ + public Integer platformFaultDomainCount() { + return this.platformFaultDomainCount; + } + + /** + * Get the virtualMachinesAssociated property: A list of all virtual machine resource ids that are associated with + * the capacity reservation. + * + * @return the virtualMachinesAssociated value. + */ + public List virtualMachinesAssociated() { + return this.virtualMachinesAssociated; + } + + /** + * Get the provisioningTime property: The date time when the capacity reservation was last updated. + * + * @return the provisioningTime value. + */ + public OffsetDateTime provisioningTime() { + return this.provisioningTime; + } + + /** + * Get the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the instanceView property: The Capacity reservation instance view. + * + * @return the instanceView value. + */ + public CapacityReservationInstanceView instanceView() { + return this.instanceView; + } + + /** + * Get the timeCreated property: Specifies the time at which the Capacity Reservation resource was created. Minimum + * api-version: 2021-11-01. + * + * @return the timeCreated value. + */ + public OffsetDateTime timeCreated() { + return this.timeCreated; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (virtualMachinesAssociated() != null) { + virtualMachinesAssociated().forEach(e -> e.validate()); + } + if (instanceView() != null) { + instanceView().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/CloudServiceInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/CloudServiceInner.java new file mode 100644 index 0000000000000..5b9441e7d5aa8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/CloudServiceInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.compute.generated.models.CloudServiceProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Describes the cloud service. */ +@Fluent +public final class CloudServiceInner extends Resource { + /* + * Cloud service properties + */ + @JsonProperty(value = "properties") + private CloudServiceProperties properties; + + /* + * The system meta data relating to this resource. + */ + @JsonProperty(value = "systemData") + private SystemData systemData; + + /* + * List of logical availability zone of the resource. List should contain only 1 zone where cloud service should be + * provisioned. This field is optional. + */ + @JsonProperty(value = "zones") + private List zones; + + /** Creates an instance of CloudServiceInner class. */ + public CloudServiceInner() { + } + + /** + * Get the properties property: Cloud service properties. + * + * @return the properties value. + */ + public CloudServiceProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Cloud service properties. + * + * @param properties the properties value to set. + * @return the CloudServiceInner object itself. + */ + public CloudServiceInner withProperties(CloudServiceProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Set the systemData property: The system meta data relating to this resource. + * + * @param systemData the systemData value to set. + * @return the CloudServiceInner object itself. + */ + public CloudServiceInner withSystemData(SystemData systemData) { + this.systemData = systemData; + return this; + } + + /** + * Get the zones property: List of logical availability zone of the resource. List should contain only 1 zone where + * cloud service should be provisioned. This field is optional. + * + * @return the zones value. + */ + public List zones() { + return this.zones; + } + + /** + * Set the zones property: List of logical availability zone of the resource. List should contain only 1 zone where + * cloud service should be provisioned. This field is optional. + * + * @param zones the zones value to set. + * @return the CloudServiceInner object itself. + */ + public CloudServiceInner withZones(List zones) { + this.zones = zones; + return this; + } + + /** {@inheritDoc} */ + @Override + public CloudServiceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public CloudServiceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/CloudServiceInstanceViewInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/CloudServiceInstanceViewInner.java new file mode 100644 index 0000000000000..5af7ab4ec837f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/CloudServiceInstanceViewInner.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.resourcemanager.compute.generated.models.InstanceViewStatusesSummary; +import com.azure.resourcemanager.compute.generated.models.ResourceInstanceViewStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** InstanceView of CloudService as a whole. */ +@Fluent +public final class CloudServiceInstanceViewInner { + /* + * Instance view statuses. + */ + @JsonProperty(value = "roleInstance") + private InstanceViewStatusesSummary roleInstance; + + /* + * The version of the SDK that was used to generate the package for the cloud service. + */ + @JsonProperty(value = "sdkVersion", access = JsonProperty.Access.WRITE_ONLY) + private String sdkVersion; + + /* + * Specifies a list of unique identifiers generated internally for the cloud service.

NOTE: If you are + * using Azure Diagnostics extension, this property can be used as 'DeploymentId' for querying details. + */ + @JsonProperty(value = "privateIds", access = JsonProperty.Access.WRITE_ONLY) + private List privateIds; + + /* + * The statuses property. + */ + @JsonProperty(value = "statuses", access = JsonProperty.Access.WRITE_ONLY) + private List statuses; + + /** Creates an instance of CloudServiceInstanceViewInner class. */ + public CloudServiceInstanceViewInner() { + } + + /** + * Get the roleInstance property: Instance view statuses. + * + * @return the roleInstance value. + */ + public InstanceViewStatusesSummary roleInstance() { + return this.roleInstance; + } + + /** + * Set the roleInstance property: Instance view statuses. + * + * @param roleInstance the roleInstance value to set. + * @return the CloudServiceInstanceViewInner object itself. + */ + public CloudServiceInstanceViewInner withRoleInstance(InstanceViewStatusesSummary roleInstance) { + this.roleInstance = roleInstance; + return this; + } + + /** + * Get the sdkVersion property: The version of the SDK that was used to generate the package for the cloud service. + * + * @return the sdkVersion value. + */ + public String sdkVersion() { + return this.sdkVersion; + } + + /** + * Get the privateIds property: Specifies a list of unique identifiers generated internally for the cloud service. + * <br /><br /> NOTE: If you are using Azure Diagnostics extension, this property can be used as + * 'DeploymentId' for querying details. + * + * @return the privateIds value. + */ + public List privateIds() { + return this.privateIds; + } + + /** + * Get the statuses property: The statuses property. + * + * @return the statuses value. + */ + public List statuses() { + return this.statuses; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (roleInstance() != null) { + roleInstance().validate(); + } + if (statuses() != null) { + statuses().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/CloudServiceRoleInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/CloudServiceRoleInner.java new file mode 100644 index 0000000000000..e9cf8ec07b3ee --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/CloudServiceRoleInner.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.compute.generated.models.CloudServiceRoleProperties; +import com.azure.resourcemanager.compute.generated.models.CloudServiceRoleSku; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a role of the cloud service. */ +@Fluent +public final class CloudServiceRoleInner { + /* + * Resource id + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * Resource name + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Resource type + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * Resource location + */ + @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) + private String location; + + /* + * Describes the cloud service role sku. + */ + @JsonProperty(value = "sku") + private CloudServiceRoleSku sku; + + /* + * The cloud service role properties. + */ + @JsonProperty(value = "properties") + private CloudServiceRoleProperties properties; + + /** Creates an instance of CloudServiceRoleInner class. */ + public CloudServiceRoleInner() { + } + + /** + * Get the id property: Resource id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: Resource name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the type property: Resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the location property: Resource location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the sku property: Describes the cloud service role sku. + * + * @return the sku value. + */ + public CloudServiceRoleSku sku() { + return this.sku; + } + + /** + * Set the sku property: Describes the cloud service role sku. + * + * @param sku the sku value to set. + * @return the CloudServiceRoleInner object itself. + */ + public CloudServiceRoleInner withSku(CloudServiceRoleSku sku) { + this.sku = sku; + return this; + } + + /** + * Get the properties property: The cloud service role properties. + * + * @return the properties value. + */ + public CloudServiceRoleProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The cloud service role properties. + * + * @param properties the properties value to set. + * @return the CloudServiceRoleInner object itself. + */ + public CloudServiceRoleInner withProperties(CloudServiceRoleProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() != null) { + sku().validate(); + } + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/CommunityGalleryIdentifier.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/CommunityGalleryIdentifier.java new file mode 100644 index 0000000000000..ba654ed7104c2 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/CommunityGalleryIdentifier.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The identifier information of community gallery. */ +@Fluent +public final class CommunityGalleryIdentifier { + /* + * The unique id of this community gallery. + */ + @JsonProperty(value = "uniqueId") + private String uniqueId; + + /** Creates an instance of CommunityGalleryIdentifier class. */ + public CommunityGalleryIdentifier() { + } + + /** + * Get the uniqueId property: The unique id of this community gallery. + * + * @return the uniqueId value. + */ + public String uniqueId() { + return this.uniqueId; + } + + /** + * Set the uniqueId property: The unique id of this community gallery. + * + * @param uniqueId the uniqueId value to set. + * @return the CommunityGalleryIdentifier object itself. + */ + public CommunityGalleryIdentifier withUniqueId(String uniqueId) { + this.uniqueId = uniqueId; + 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/CommunityGalleryImageInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/CommunityGalleryImageInner.java new file mode 100644 index 0000000000000..30400f1025e94 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/CommunityGalleryImageInner.java @@ -0,0 +1,351 @@ +// Copyright (c) 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.resourcemanager.compute.generated.models.Architecture; +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.PirCommunityGalleryResource; +import com.azure.resourcemanager.compute.generated.models.RecommendedMachineConfiguration; +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. */ +@Fluent +public final class CommunityGalleryImageInner extends PirCommunityGalleryResource { + /* + * Describes the properties of a gallery image definition. + */ + @JsonProperty(value = "properties") + private CommunityGalleryImageProperties innerProperties; + + /** Creates an instance of CommunityGalleryImageInner class. */ + public CommunityGalleryImageInner() { + } + + /** + * Get the innerProperties property: Describes the properties of a gallery image definition. + * + * @return the innerProperties value. + */ + private CommunityGalleryImageProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public CommunityGalleryImageInner withUniqueId(String uniqueId) { + super.withUniqueId(uniqueId); + 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.innerProperties() == null ? null : this.innerProperties().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 CommunityGalleryImageInner object itself. + */ + public CommunityGalleryImageInner withOsType(OperatingSystemTypes osType) { + if (this.innerProperties() == null) { + this.innerProperties = new CommunityGalleryImageProperties(); + } + this.innerProperties().withOsType(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.innerProperties() == null ? null : this.innerProperties().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 CommunityGalleryImageInner object itself. + */ + public CommunityGalleryImageInner withOsState(OperatingSystemStateTypes osState) { + if (this.innerProperties() == null) { + this.innerProperties = new CommunityGalleryImageProperties(); + } + this.innerProperties().withOsState(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.innerProperties() == null ? null : this.innerProperties().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 CommunityGalleryImageInner object itself. + */ + public CommunityGalleryImageInner withEndOfLifeDate(OffsetDateTime endOfLifeDate) { + if (this.innerProperties() == null) { + this.innerProperties = new CommunityGalleryImageProperties(); + } + this.innerProperties().withEndOfLifeDate(endOfLifeDate); + return this; + } + + /** + * Get the identifier property: This is the gallery image definition identifier. + * + * @return the identifier value. + */ + public GalleryImageIdentifier identifier() { + return this.innerProperties() == null ? null : this.innerProperties().identifier(); + } + + /** + * Set the identifier property: This is the gallery image definition identifier. + * + * @param identifier the identifier value to set. + * @return the CommunityGalleryImageInner object itself. + */ + public CommunityGalleryImageInner withIdentifier(GalleryImageIdentifier identifier) { + if (this.innerProperties() == null) { + this.innerProperties = new CommunityGalleryImageProperties(); + } + this.innerProperties().withIdentifier(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.innerProperties() == null ? null : this.innerProperties().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 CommunityGalleryImageInner object itself. + */ + public CommunityGalleryImageInner withRecommended(RecommendedMachineConfiguration recommended) { + if (this.innerProperties() == null) { + this.innerProperties = new CommunityGalleryImageProperties(); + } + this.innerProperties().withRecommended(recommended); + return this; + } + + /** + * Get the disallowed property: Describes the disallowed disk types. + * + * @return the disallowed value. + */ + public Disallowed disallowed() { + return this.innerProperties() == null ? null : this.innerProperties().disallowed(); + } + + /** + * Set the disallowed property: Describes the disallowed disk types. + * + * @param disallowed the disallowed value to set. + * @return the CommunityGalleryImageInner object itself. + */ + public CommunityGalleryImageInner withDisallowed(Disallowed disallowed) { + if (this.innerProperties() == null) { + this.innerProperties = new CommunityGalleryImageProperties(); + } + this.innerProperties().withDisallowed(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.innerProperties() == null ? null : this.innerProperties().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 CommunityGalleryImageInner object itself. + */ + public CommunityGalleryImageInner withHyperVGeneration(HyperVGeneration hyperVGeneration) { + if (this.innerProperties() == null) { + this.innerProperties = new CommunityGalleryImageProperties(); + } + this.innerProperties().withHyperVGeneration(hyperVGeneration); + return this; + } + + /** + * Get the features property: A list of gallery image features. + * + * @return the features value. + */ + public List features() { + return this.innerProperties() == null ? null : this.innerProperties().features(); + } + + /** + * Set the features property: A list of gallery image features. + * + * @param features the features value to set. + * @return the CommunityGalleryImageInner object itself. + */ + public CommunityGalleryImageInner withFeatures(List features) { + if (this.innerProperties() == null) { + this.innerProperties = new CommunityGalleryImageProperties(); + } + this.innerProperties().withFeatures(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.innerProperties() == null ? null : this.innerProperties().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 CommunityGalleryImageInner object itself. + */ + public CommunityGalleryImageInner withPurchasePlan(ImagePurchasePlan purchasePlan) { + if (this.innerProperties() == null) { + this.innerProperties = new CommunityGalleryImageProperties(); + } + this.innerProperties().withPurchasePlan(purchasePlan); + return this; + } + + /** + * Get the architecture property: The architecture of the image. Applicable to OS disks only. + * + * @return the architecture value. + */ + public Architecture architecture() { + return this.innerProperties() == null ? null : this.innerProperties().architecture(); + } + + /** + * Set the architecture property: The architecture of the image. Applicable to OS disks only. + * + * @param architecture the architecture value to set. + * @return the CommunityGalleryImageInner object itself. + */ + public CommunityGalleryImageInner withArchitecture(Architecture architecture) { + if (this.innerProperties() == null) { + this.innerProperties = new CommunityGalleryImageProperties(); + } + this.innerProperties().withArchitecture(architecture); + return this; + } + + /** + * Get the privacyStatementUri property: Privacy statement uri for the current community gallery image. + * + * @return the privacyStatementUri value. + */ + public String privacyStatementUri() { + return this.innerProperties() == null ? null : this.innerProperties().privacyStatementUri(); + } + + /** + * Set the privacyStatementUri property: Privacy statement uri for the current community gallery image. + * + * @param privacyStatementUri the privacyStatementUri value to set. + * @return the CommunityGalleryImageInner object itself. + */ + public CommunityGalleryImageInner withPrivacyStatementUri(String privacyStatementUri) { + if (this.innerProperties() == null) { + this.innerProperties = new CommunityGalleryImageProperties(); + } + this.innerProperties().withPrivacyStatementUri(privacyStatementUri); + return this; + } + + /** + * Get the eula property: End-user license agreement for the current community gallery image. + * + * @return the eula value. + */ + public String eula() { + return this.innerProperties() == null ? null : this.innerProperties().eula(); + } + + /** + * Set the eula property: End-user license agreement for the current community gallery image. + * + * @param eula the eula value to set. + * @return the CommunityGalleryImageInner object itself. + */ + public CommunityGalleryImageInner withEula(String eula) { + if (this.innerProperties() == null) { + this.innerProperties = new CommunityGalleryImageProperties(); + } + this.innerProperties().withEula(eula); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/CommunityGalleryImageProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/CommunityGalleryImageProperties.java new file mode 100644 index 0000000000000..d21da11ac2310 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/CommunityGalleryImageProperties.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.models.Architecture; +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.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Describes the properties of a gallery image definition. */ +@Fluent +public final class CommunityGalleryImageProperties { + /* + * 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 = "osType", required = true) + private OperatingSystemTypes osType; + + /* + * This property allows the user to specify whether the virtual machines created under this image are 'Generalized' + * or 'Specialized'. + */ + @JsonProperty(value = "osState", required = true) + 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 = "endOfLifeDate") + private OffsetDateTime endOfLifeDate; + + /* + * This is the gallery image definition identifier. + */ + @JsonProperty(value = "identifier", required = true) + private GalleryImageIdentifier identifier; + + /* + * The properties describe the recommended machine configuration for this Image Definition. These properties are + * updatable. + */ + @JsonProperty(value = "recommended") + private RecommendedMachineConfiguration recommended; + + /* + * Describes the disallowed disk types. + */ + @JsonProperty(value = "disallowed") + private Disallowed disallowed; + + /* + * The hypervisor generation of the Virtual Machine. Applicable to OS disks only. + */ + @JsonProperty(value = "hyperVGeneration") + private HyperVGeneration hyperVGeneration; + + /* + * A list of gallery image features. + */ + @JsonProperty(value = "features") + private List features; + + /* + * Describes the gallery image definition purchase plan. This is used by marketplace images. + */ + @JsonProperty(value = "purchasePlan") + private ImagePurchasePlan purchasePlan; + + /* + * The architecture of the image. Applicable to OS disks only. + */ + @JsonProperty(value = "architecture") + private Architecture architecture; + + /* + * Privacy statement uri for the current community gallery image. + */ + @JsonProperty(value = "privacyStatementUri") + private String privacyStatementUri; + + /* + * End-user license agreement for the current community gallery image. + */ + @JsonProperty(value = "eula") + private String eula; + + /** Creates an instance of CommunityGalleryImageProperties class. */ + public CommunityGalleryImageProperties() { + } + + /** + * 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 CommunityGalleryImageProperties object itself. + */ + public CommunityGalleryImageProperties 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 CommunityGalleryImageProperties object itself. + */ + public CommunityGalleryImageProperties 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 CommunityGalleryImageProperties object itself. + */ + public CommunityGalleryImageProperties 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 CommunityGalleryImageProperties object itself. + */ + public CommunityGalleryImageProperties 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 CommunityGalleryImageProperties object itself. + */ + public CommunityGalleryImageProperties 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 CommunityGalleryImageProperties object itself. + */ + public CommunityGalleryImageProperties 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 CommunityGalleryImageProperties object itself. + */ + public CommunityGalleryImageProperties 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 CommunityGalleryImageProperties object itself. + */ + public CommunityGalleryImageProperties 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 CommunityGalleryImageProperties object itself. + */ + public CommunityGalleryImageProperties withPurchasePlan(ImagePurchasePlan purchasePlan) { + this.purchasePlan = purchasePlan; + return this; + } + + /** + * Get the architecture property: The architecture of the image. Applicable to OS disks only. + * + * @return the architecture value. + */ + public Architecture architecture() { + return this.architecture; + } + + /** + * Set the architecture property: The architecture of the image. Applicable to OS disks only. + * + * @param architecture the architecture value to set. + * @return the CommunityGalleryImageProperties object itself. + */ + public CommunityGalleryImageProperties withArchitecture(Architecture architecture) { + this.architecture = architecture; + return this; + } + + /** + * Get the privacyStatementUri property: Privacy statement uri for the current community gallery image. + * + * @return the privacyStatementUri value. + */ + public String privacyStatementUri() { + return this.privacyStatementUri; + } + + /** + * Set the privacyStatementUri property: Privacy statement uri for the current community gallery image. + * + * @param privacyStatementUri the privacyStatementUri value to set. + * @return the CommunityGalleryImageProperties object itself. + */ + public CommunityGalleryImageProperties withPrivacyStatementUri(String privacyStatementUri) { + this.privacyStatementUri = privacyStatementUri; + return this; + } + + /** + * Get the eula property: End-user license agreement for the current community gallery image. + * + * @return the eula value. + */ + public String eula() { + return this.eula; + } + + /** + * Set the eula property: End-user license agreement for the current community gallery image. + * + * @param eula the eula value to set. + * @return the CommunityGalleryImageProperties object itself. + */ + public CommunityGalleryImageProperties withEula(String eula) { + this.eula = eula; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (osType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property osType in model CommunityGalleryImageProperties")); + } + if (osState() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property osState in model CommunityGalleryImageProperties")); + } + if (identifier() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property identifier in model CommunityGalleryImageProperties")); + } else { + 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(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CommunityGalleryImageProperties.class); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/CommunityGalleryImageVersionInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/CommunityGalleryImageVersionInner.java new file mode 100644 index 0000000000000..683c521fbbac0 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/CommunityGalleryImageVersionInner.java @@ -0,0 +1,153 @@ +// Copyright (c) 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.resourcemanager.compute.generated.models.PirCommunityGalleryResource; +import com.azure.resourcemanager.compute.generated.models.SharedGalleryImageVersionStorageProfile; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Specifies information about the gallery image version that you want to create or update. */ +@Fluent +public final class CommunityGalleryImageVersionInner extends PirCommunityGalleryResource { + /* + * Describes the properties of a gallery image version. + */ + @JsonProperty(value = "properties") + private CommunityGalleryImageVersionProperties innerProperties; + + /** Creates an instance of CommunityGalleryImageVersionInner class. */ + public CommunityGalleryImageVersionInner() { + } + + /** + * Get the innerProperties property: Describes the properties of a gallery image version. + * + * @return the innerProperties value. + */ + private CommunityGalleryImageVersionProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public CommunityGalleryImageVersionInner withUniqueId(String uniqueId) { + super.withUniqueId(uniqueId); + return this; + } + + /** + * 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.innerProperties() == null ? null : this.innerProperties().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 CommunityGalleryImageVersionInner object itself. + */ + public CommunityGalleryImageVersionInner withPublishedDate(OffsetDateTime publishedDate) { + if (this.innerProperties() == null) { + this.innerProperties = new CommunityGalleryImageVersionProperties(); + } + this.innerProperties().withPublishedDate(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.innerProperties() == null ? null : this.innerProperties().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 CommunityGalleryImageVersionInner object itself. + */ + public CommunityGalleryImageVersionInner withEndOfLifeDate(OffsetDateTime endOfLifeDate) { + if (this.innerProperties() == null) { + this.innerProperties = new CommunityGalleryImageVersionProperties(); + } + this.innerProperties().withEndOfLifeDate(endOfLifeDate); + 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.innerProperties() == null ? null : this.innerProperties().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 CommunityGalleryImageVersionInner object itself. + */ + public CommunityGalleryImageVersionInner withExcludeFromLatest(Boolean excludeFromLatest) { + if (this.innerProperties() == null) { + this.innerProperties = new CommunityGalleryImageVersionProperties(); + } + this.innerProperties().withExcludeFromLatest(excludeFromLatest); + return this; + } + + /** + * Get the storageProfile property: Describes the storage profile of the image version. + * + * @return the storageProfile value. + */ + public SharedGalleryImageVersionStorageProfile storageProfile() { + return this.innerProperties() == null ? null : this.innerProperties().storageProfile(); + } + + /** + * Set the storageProfile property: Describes the storage profile of the image version. + * + * @param storageProfile the storageProfile value to set. + * @return the CommunityGalleryImageVersionInner object itself. + */ + public CommunityGalleryImageVersionInner withStorageProfile( + SharedGalleryImageVersionStorageProfile storageProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new CommunityGalleryImageVersionProperties(); + } + this.innerProperties().withStorageProfile(storageProfile); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/CommunityGalleryImageVersionProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/CommunityGalleryImageVersionProperties.java new file mode 100644 index 0000000000000..f9d4b97fd3f2b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/CommunityGalleryImageVersionProperties.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.compute.generated.models.SharedGalleryImageVersionStorageProfile; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Describes the properties of a gallery image version. */ +@Fluent +public final class CommunityGalleryImageVersionProperties { + /* + * The published date of the gallery image version Definition. This property can be used for decommissioning + * purposes. This property is updatable. + */ + @JsonProperty(value = "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 = "endOfLifeDate") + private OffsetDateTime endOfLifeDate; + + /* + * 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; + + /* + * Describes the storage profile of the image version. + */ + @JsonProperty(value = "storageProfile") + private SharedGalleryImageVersionStorageProfile storageProfile; + + /** Creates an instance of CommunityGalleryImageVersionProperties class. */ + public CommunityGalleryImageVersionProperties() { + } + + /** + * 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 CommunityGalleryImageVersionProperties object itself. + */ + public CommunityGalleryImageVersionProperties 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 CommunityGalleryImageVersionProperties object itself. + */ + public CommunityGalleryImageVersionProperties withEndOfLifeDate(OffsetDateTime endOfLifeDate) { + this.endOfLifeDate = endOfLifeDate; + 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 CommunityGalleryImageVersionProperties object itself. + */ + public CommunityGalleryImageVersionProperties withExcludeFromLatest(Boolean excludeFromLatest) { + this.excludeFromLatest = excludeFromLatest; + return this; + } + + /** + * Get the storageProfile property: Describes the storage profile of the image version. + * + * @return the storageProfile value. + */ + public SharedGalleryImageVersionStorageProfile storageProfile() { + return this.storageProfile; + } + + /** + * Set the storageProfile property: Describes the storage profile of the image version. + * + * @param storageProfile the storageProfile value to set. + * @return the CommunityGalleryImageVersionProperties object itself. + */ + public CommunityGalleryImageVersionProperties withStorageProfile( + SharedGalleryImageVersionStorageProfile storageProfile) { + this.storageProfile = storageProfile; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void 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/CommunityGalleryInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/CommunityGalleryInner.java new file mode 100644 index 0000000000000..c1e250fb1e145 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/CommunityGalleryInner.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.compute.generated.models.PirCommunityGalleryResource; + +/** Specifies information about the Community Gallery that you want to create or update. */ +@Fluent +public final class CommunityGalleryInner extends PirCommunityGalleryResource { + /** Creates an instance of CommunityGalleryInner class. */ + public CommunityGalleryInner() { + } + + /** {@inheritDoc} */ + @Override + public CommunityGalleryInner 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/ComputeOperationValueDisplay.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/ComputeOperationValueDisplay.java new file mode 100644 index 0000000000000..ab3ca5cd89e10 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/ComputeOperationValueDisplay.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.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the properties of a Compute Operation Value Display. */ +@Immutable +public final class ComputeOperationValueDisplay { + /* + * The display name of the compute operation. + */ + @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) + private String operation; + + /* + * The display name of the resource the operation applies to. + */ + @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) + private String resource; + + /* + * The description of the operation. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /* + * The resource provider for the operation. + */ + @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) + private String provider; + + /** Creates an instance of ComputeOperationValueDisplay class. */ + public ComputeOperationValueDisplay() { + } + + /** + * 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/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..8dd0cf962554b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/ComputeOperationValueInner.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.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the properties of a Compute Operation value. */ +@Immutable +public final class ComputeOperationValueInner { + /* + * 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; + + /* + * Describes the properties of a Compute Operation Value Display. + */ + @JsonProperty(value = "display") + private ComputeOperationValueDisplay innerDisplay; + + /** Creates an instance of ComputeOperationValueInner class. */ + public ComputeOperationValueInner() { + } + + /** + * 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 innerDisplay property: Describes the properties of a Compute Operation Value Display. + * + * @return the innerDisplay value. + */ + private ComputeOperationValueDisplay innerDisplay() { + return this.innerDisplay; + } + + /** + * Get the operation property: The display name of the compute operation. + * + * @return the operation value. + */ + public String operation() { + return this.innerDisplay() == null ? null : this.innerDisplay().operation(); + } + + /** + * Get the resource property: The display name of the resource the operation applies to. + * + * @return the resource value. + */ + public String resource() { + return this.innerDisplay() == null ? null : this.innerDisplay().resource(); + } + + /** + * Get the description property: The description of the operation. + * + * @return the description value. + */ + public String description() { + return this.innerDisplay() == null ? null : this.innerDisplay().description(); + } + + /** + * Get the provider property: The resource provider for the operation. + * + * @return the provider value. + */ + public String provider() { + return this.innerDisplay() == null ? null : this.innerDisplay().provider(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerDisplay() != null) { + innerDisplay().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..9de6a8cae8c8a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/DedicatedHostGroupInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.resourcemanager.compute.generated.models.DedicatedHostGroupInstanceView; +import com.azure.resourcemanager.compute.generated.models.DedicatedHostGroupPropertiesAdditionalCapabilities; +import com.azure.resourcemanager.compute.generated.models.SubResourceReadOnly; +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. 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. + */ +@Fluent +public final class DedicatedHostGroupInner extends Resource { + /* + * Dedicated Host Group Properties. + */ + @JsonProperty(value = "properties") + private DedicatedHostGroupProperties innerProperties; + + /* + * 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; + + /** Creates an instance of DedicatedHostGroupInner class. */ + public DedicatedHostGroupInner() { + } + + /** + * Get the innerProperties property: Dedicated Host Group Properties. + * + * @return the innerProperties value. + */ + private DedicatedHostGroupProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** {@inheritDoc} */ + @Override + public DedicatedHostGroupInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public DedicatedHostGroupInner withTags(Map tags) { + super.withTags(tags); + 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new DedicatedHostGroupProperties(); + } + this.innerProperties().withPlatformFaultDomainCount(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.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().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. Minimum api-version: 2020-06-01. + * + * @return the supportAutomaticPlacement value. + */ + public Boolean supportAutomaticPlacement() { + return this.innerProperties() == null ? null : this.innerProperties().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. Minimum api-version: 2020-06-01. + * + * @param supportAutomaticPlacement the supportAutomaticPlacement value to set. + * @return the DedicatedHostGroupInner object itself. + */ + public DedicatedHostGroupInner withSupportAutomaticPlacement(Boolean supportAutomaticPlacement) { + if (this.innerProperties() == null) { + this.innerProperties = new DedicatedHostGroupProperties(); + } + this.innerProperties().withSupportAutomaticPlacement(supportAutomaticPlacement); + return this; + } + + /** + * Get the additionalCapabilities property: Enables or disables a capability on the dedicated host group. Minimum + * api-version: 2022-03-01. + * + * @return the additionalCapabilities value. + */ + public DedicatedHostGroupPropertiesAdditionalCapabilities additionalCapabilities() { + return this.innerProperties() == null ? null : this.innerProperties().additionalCapabilities(); + } + + /** + * Set the additionalCapabilities property: Enables or disables a capability on the dedicated host group. Minimum + * api-version: 2022-03-01. + * + * @param additionalCapabilities the additionalCapabilities value to set. + * @return the DedicatedHostGroupInner object itself. + */ + public DedicatedHostGroupInner withAdditionalCapabilities( + DedicatedHostGroupPropertiesAdditionalCapabilities additionalCapabilities) { + if (this.innerProperties() == null) { + this.innerProperties = new DedicatedHostGroupProperties(); + } + this.innerProperties().withAdditionalCapabilities(additionalCapabilities); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/DedicatedHostGroupProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/DedicatedHostGroupProperties.java new file mode 100644 index 0000000000000..ed03e2b54ad86 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/DedicatedHostGroupProperties.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.resourcemanager.compute.generated.models.DedicatedHostGroupInstanceView; +import com.azure.resourcemanager.compute.generated.models.DedicatedHostGroupPropertiesAdditionalCapabilities; +import com.azure.resourcemanager.compute.generated.models.SubResourceReadOnly; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Dedicated Host Group Properties. */ +@Fluent +public final class DedicatedHostGroupProperties { + /* + * Number of fault domains that the host group can span. + */ + @JsonProperty(value = "platformFaultDomainCount", required = true) + private int platformFaultDomainCount; + + /* + * A list of references to all dedicated hosts in the dedicated host group. + */ + @JsonProperty(value = "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 = "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 = "supportAutomaticPlacement") + private Boolean supportAutomaticPlacement; + + /* + * Enables or disables a capability on the dedicated host group. Minimum api-version: 2022-03-01. + */ + @JsonProperty(value = "additionalCapabilities") + private DedicatedHostGroupPropertiesAdditionalCapabilities additionalCapabilities; + + /** Creates an instance of DedicatedHostGroupProperties class. */ + public DedicatedHostGroupProperties() { + } + + /** + * Get the platformFaultDomainCount property: Number of fault domains that the host group can span. + * + * @return the platformFaultDomainCount value. + */ + public int 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 DedicatedHostGroupProperties object itself. + */ + public DedicatedHostGroupProperties withPlatformFaultDomainCount(int 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. 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. Minimum api-version: 2020-06-01. + * + * @param supportAutomaticPlacement the supportAutomaticPlacement value to set. + * @return the DedicatedHostGroupProperties object itself. + */ + public DedicatedHostGroupProperties withSupportAutomaticPlacement(Boolean supportAutomaticPlacement) { + this.supportAutomaticPlacement = supportAutomaticPlacement; + return this; + } + + /** + * Get the additionalCapabilities property: Enables or disables a capability on the dedicated host group. Minimum + * api-version: 2022-03-01. + * + * @return the additionalCapabilities value. + */ + public DedicatedHostGroupPropertiesAdditionalCapabilities additionalCapabilities() { + return this.additionalCapabilities; + } + + /** + * Set the additionalCapabilities property: Enables or disables a capability on the dedicated host group. Minimum + * api-version: 2022-03-01. + * + * @param additionalCapabilities the additionalCapabilities value to set. + * @return the DedicatedHostGroupProperties object itself. + */ + public DedicatedHostGroupProperties withAdditionalCapabilities( + DedicatedHostGroupPropertiesAdditionalCapabilities additionalCapabilities) { + this.additionalCapabilities = additionalCapabilities; + 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(); + } + if (additionalCapabilities() != null) { + additionalCapabilities().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..09b4d49bfe14f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/DedicatedHostInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.models.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.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** Specifies information about the Dedicated host. */ +@Fluent +public final class DedicatedHostInner extends Resource { + /* + * Properties of the dedicated host. + */ + @JsonProperty(value = "properties") + private DedicatedHostProperties innerProperties; + + /* + * 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; + + /** Creates an instance of DedicatedHostInner class. */ + public DedicatedHostInner() { + } + + /** + * Get the innerProperties property: Properties of the dedicated host. + * + * @return the innerProperties value. + */ + private DedicatedHostProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** {@inheritDoc} */ + @Override + public DedicatedHostInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public DedicatedHostInner withTags(Map tags) { + super.withTags(tags); + 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new DedicatedHostProperties(); + } + this.innerProperties().withPlatformFaultDomain(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new DedicatedHostProperties(); + } + this.innerProperties().withAutoReplaceOnFailure(autoReplaceOnFailure); + return this; + } + + /** + * Get the hostId property: A unique id generated and assigned to the dedicated host by the platform. Does not + * change throughout the lifetime of the host. + * + * @return the hostId value. + */ + public String hostId() { + return this.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().virtualMachines(); + } + + /** + * Get the licenseType property: 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.** The + * default value is: **None.**. + * + * @return the licenseType value. + */ + public DedicatedHostLicenseTypes licenseType() { + return this.innerProperties() == null ? null : this.innerProperties().licenseType(); + } + + /** + * Set the licenseType property: 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.** The + * default value is: **None.**. + * + * @param licenseType the licenseType value to set. + * @return the DedicatedHostInner object itself. + */ + public DedicatedHostInner withLicenseType(DedicatedHostLicenseTypes licenseType) { + if (this.innerProperties() == null) { + this.innerProperties = new DedicatedHostProperties(); + } + this.innerProperties().withLicenseType(licenseType); + return this; + } + + /** + * Get the provisioningTime property: The date when the host was first provisioned. + * + * @return the provisioningTime value. + */ + public OffsetDateTime provisioningTime() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningTime(); + } + + /** + * Get the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the instanceView property: The dedicated host instance view. + * + * @return the instanceView value. + */ + public DedicatedHostInstanceView instanceView() { + return this.innerProperties() == null ? null : this.innerProperties().instanceView(); + } + + /** + * Get the timeCreated property: Specifies the time at which the Dedicated Host resource was created. Minimum + * api-version: 2021-11-01. + * + * @return the timeCreated value. + */ + public OffsetDateTime timeCreated() { + return this.innerProperties() == null ? null : this.innerProperties().timeCreated(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + if (sku() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property sku in model DedicatedHostInner")); + } else { + sku().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DedicatedHostInner.class); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/DedicatedHostProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/DedicatedHostProperties.java new file mode 100644 index 0000000000000..435af3291ef29 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/DedicatedHostProperties.java @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.compute.generated.models.DedicatedHostInstanceView; +import com.azure.resourcemanager.compute.generated.models.DedicatedHostLicenseTypes; +import com.azure.resourcemanager.compute.generated.models.SubResourceReadOnly; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Properties of the dedicated host. */ +@Fluent +public final class DedicatedHostProperties { + /* + * Fault domain of the dedicated host within a dedicated host group. + */ + @JsonProperty(value = "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 = "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 = "hostId", access = JsonProperty.Access.WRITE_ONLY) + private String hostId; + + /* + * A list of references to all virtual machines in the Dedicated Host. + */ + @JsonProperty(value = "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.** The default value is: **None.** + */ + @JsonProperty(value = "licenseType") + private DedicatedHostLicenseTypes licenseType; + + /* + * The date when the host was first provisioned. + */ + @JsonProperty(value = "provisioningTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime provisioningTime; + + /* + * The provisioning state, which only appears in the response. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The dedicated host instance view. + */ + @JsonProperty(value = "instanceView", access = JsonProperty.Access.WRITE_ONLY) + private DedicatedHostInstanceView instanceView; + + /* + * Specifies the time at which the Dedicated Host resource was created. Minimum api-version: 2021-11-01. + */ + @JsonProperty(value = "timeCreated", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime timeCreated; + + /** Creates an instance of DedicatedHostProperties class. */ + public DedicatedHostProperties() { + } + + /** + * 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 DedicatedHostProperties object itself. + */ + public DedicatedHostProperties 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 DedicatedHostProperties object itself. + */ + public DedicatedHostProperties 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. 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. Possible values are: **None,** **Windows_Server_Hybrid,** **Windows_Server_Perpetual.** The + * default value is: **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. Possible values are: **None,** **Windows_Server_Hybrid,** **Windows_Server_Perpetual.** The + * default value is: **None.**. + * + * @param licenseType the licenseType value to set. + * @return the DedicatedHostProperties object itself. + */ + public DedicatedHostProperties 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; + } + + /** + * Get the timeCreated property: Specifies the time at which the Dedicated Host resource was created. Minimum + * api-version: 2021-11-01. + * + * @return the timeCreated value. + */ + public OffsetDateTime timeCreated() { + return this.timeCreated; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void 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..45b4e80ca30db --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/DiskAccessInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.resourcemanager.compute.generated.models.ExtendedLocation; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** disk access resource. */ +@Fluent +public final class DiskAccessInner extends Resource { + /* + * The properties property. + */ + @JsonProperty(value = "properties") + private DiskAccessProperties innerProperties; + + /* + * The extended location where the disk access will be created. Extended location cannot be changed. + */ + @JsonProperty(value = "extendedLocation") + private ExtendedLocation extendedLocation; + + /** Creates an instance of DiskAccessInner class. */ + public DiskAccessInner() { + } + + /** + * Get the innerProperties property: The properties property. + * + * @return the innerProperties value. + */ + private DiskAccessProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the extendedLocation property: The extended location where the disk access 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 access will be created. Extended location + * cannot be changed. + * + * @param extendedLocation the extendedLocation value to set. + * @return the DiskAccessInner object itself. + */ + public DiskAccessInner withExtendedLocation(ExtendedLocation extendedLocation) { + this.extendedLocation = extendedLocation; + return this; + } + + /** {@inheritDoc} */ + @Override + public DiskAccessInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public DiskAccessInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * 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.innerProperties() == null ? null : this.innerProperties().privateEndpointConnections(); + } + + /** + * Get the provisioningState property: The disk access resource provisioning state. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the timeCreated property: The time when the disk access was created. + * + * @return the timeCreated value. + */ + public OffsetDateTime timeCreated() { + return this.innerProperties() == null ? null : this.innerProperties().timeCreated(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + if (extendedLocation() != null) { + extendedLocation().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/DiskAccessProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/DiskAccessProperties.java new file mode 100644 index 0000000000000..d8241a93566f3 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/DiskAccessProperties.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.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** The DiskAccessProperties model. */ +@Immutable +public final class DiskAccessProperties { + /* + * A readonly collection of private endpoint connections created on the disk. Currently only one endpoint + * connection is supported. + */ + @JsonProperty(value = "privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY) + private List privateEndpointConnections; + + /* + * The disk access resource provisioning state. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The time when the disk access was created. + */ + @JsonProperty(value = "timeCreated", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime timeCreated; + + /** Creates an instance of DiskAccessProperties class. */ + public DiskAccessProperties() { + } + + /** + * 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; + } + + /** + * 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..7e85db797a28e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/DiskEncryptionSetInner.java @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.resourcemanager.compute.generated.models.ApiError; +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.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** disk encryption set resource. */ +@Fluent +public final class DiskEncryptionSetInner extends Resource { + /* + * 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 properties property. + */ + @JsonProperty(value = "properties") + private EncryptionSetProperties innerProperties; + + /** Creates an instance of DiskEncryptionSetInner class. */ + public DiskEncryptionSetInner() { + } + + /** + * 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 innerProperties property: The properties property. + * + * @return the innerProperties value. + */ + private EncryptionSetProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public DiskEncryptionSetInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public DiskEncryptionSetInner withTags(Map tags) { + super.withTags(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new EncryptionSetProperties(); + } + this.innerProperties().withEncryptionType(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new EncryptionSetProperties(); + } + this.innerProperties().withActiveKey(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.innerProperties() == null ? null : this.innerProperties().previousKeys(); + } + + /** + * Get the provisioningState property: The disk encryption set provisioning state. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the rotationToLatestKeyVersionEnabled property: Set this flag to true to enable auto-updating of this disk + * encryption set to the latest key version. + * + * @return the rotationToLatestKeyVersionEnabled value. + */ + public Boolean rotationToLatestKeyVersionEnabled() { + return this.innerProperties() == null ? null : this.innerProperties().rotationToLatestKeyVersionEnabled(); + } + + /** + * Set the rotationToLatestKeyVersionEnabled property: Set this flag to true to enable auto-updating of this disk + * encryption set to the latest key version. + * + * @param rotationToLatestKeyVersionEnabled the rotationToLatestKeyVersionEnabled value to set. + * @return the DiskEncryptionSetInner object itself. + */ + public DiskEncryptionSetInner withRotationToLatestKeyVersionEnabled(Boolean rotationToLatestKeyVersionEnabled) { + if (this.innerProperties() == null) { + this.innerProperties = new EncryptionSetProperties(); + } + this.innerProperties().withRotationToLatestKeyVersionEnabled(rotationToLatestKeyVersionEnabled); + return this; + } + + /** + * Get the lastKeyRotationTimestamp property: The time when the active key of this disk encryption set was updated. + * + * @return the lastKeyRotationTimestamp value. + */ + public OffsetDateTime lastKeyRotationTimestamp() { + return this.innerProperties() == null ? null : this.innerProperties().lastKeyRotationTimestamp(); + } + + /** + * Get the autoKeyRotationError property: The error that was encountered during auto-key rotation. If an error is + * present, then auto-key rotation will not be attempted until the error on this disk encryption set is fixed. + * + * @return the autoKeyRotationError value. + */ + public ApiError autoKeyRotationError() { + return this.innerProperties() == null ? null : this.innerProperties().autoKeyRotationError(); + } + + /** + * Get the federatedClientId property: Multi-tenant application client id to access key vault in a different tenant. + * Setting the value to 'None' will clear the property. + * + * @return the federatedClientId value. + */ + public String federatedClientId() { + return this.innerProperties() == null ? null : this.innerProperties().federatedClientId(); + } + + /** + * Set the federatedClientId property: Multi-tenant application client id to access key vault in a different tenant. + * Setting the value to 'None' will clear the property. + * + * @param federatedClientId the federatedClientId value to set. + * @return the DiskEncryptionSetInner object itself. + */ + public DiskEncryptionSetInner withFederatedClientId(String federatedClientId) { + if (this.innerProperties() == null) { + this.innerProperties = new EncryptionSetProperties(); + } + this.innerProperties().withFederatedClientId(federatedClientId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/DiskEncryptionSetUpdateProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/DiskEncryptionSetUpdateProperties.java new file mode 100644 index 0000000000000..1c80fbe56d43c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/DiskEncryptionSetUpdateProperties.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.resourcemanager.compute.generated.models.DiskEncryptionSetType; +import com.azure.resourcemanager.compute.generated.models.KeyForDiskEncryptionSet; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** disk encryption set resource update properties. */ +@Fluent +public final class DiskEncryptionSetUpdateProperties { + /* + * The type of key used to encrypt the data of the disk. + */ + @JsonProperty(value = "encryptionType") + private DiskEncryptionSetType encryptionType; + + /* + * Key Vault Key Url to be used for server side encryption of Managed Disks and Snapshots + */ + @JsonProperty(value = "activeKey") + private KeyForDiskEncryptionSet activeKey; + + /* + * Set this flag to true to enable auto-updating of this disk encryption set to the latest key version. + */ + @JsonProperty(value = "rotationToLatestKeyVersionEnabled") + private Boolean rotationToLatestKeyVersionEnabled; + + /* + * Multi-tenant application client id to access key vault in a different tenant. Setting the value to 'None' will + * clear the property. + */ + @JsonProperty(value = "federatedClientId") + private String federatedClientId; + + /** Creates an instance of DiskEncryptionSetUpdateProperties class. */ + public DiskEncryptionSetUpdateProperties() { + } + + /** + * 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 DiskEncryptionSetUpdateProperties object itself. + */ + public DiskEncryptionSetUpdateProperties 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 DiskEncryptionSetUpdateProperties object itself. + */ + public DiskEncryptionSetUpdateProperties withActiveKey(KeyForDiskEncryptionSet activeKey) { + this.activeKey = activeKey; + return this; + } + + /** + * Get the rotationToLatestKeyVersionEnabled property: Set this flag to true to enable auto-updating of this disk + * encryption set to the latest key version. + * + * @return the rotationToLatestKeyVersionEnabled value. + */ + public Boolean rotationToLatestKeyVersionEnabled() { + return this.rotationToLatestKeyVersionEnabled; + } + + /** + * Set the rotationToLatestKeyVersionEnabled property: Set this flag to true to enable auto-updating of this disk + * encryption set to the latest key version. + * + * @param rotationToLatestKeyVersionEnabled the rotationToLatestKeyVersionEnabled value to set. + * @return the DiskEncryptionSetUpdateProperties object itself. + */ + public DiskEncryptionSetUpdateProperties withRotationToLatestKeyVersionEnabled( + Boolean rotationToLatestKeyVersionEnabled) { + this.rotationToLatestKeyVersionEnabled = rotationToLatestKeyVersionEnabled; + return this; + } + + /** + * Get the federatedClientId property: Multi-tenant application client id to access key vault in a different tenant. + * Setting the value to 'None' will clear the property. + * + * @return the federatedClientId value. + */ + public String federatedClientId() { + return this.federatedClientId; + } + + /** + * Set the federatedClientId property: Multi-tenant application client id to access key vault in a different tenant. + * Setting the value to 'None' will clear the property. + * + * @param federatedClientId the federatedClientId value to set. + * @return the DiskEncryptionSetUpdateProperties object itself. + */ + public DiskEncryptionSetUpdateProperties withFederatedClientId(String federatedClientId) { + this.federatedClientId = federatedClientId; + 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/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..077233b55f23b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/DiskInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.resourcemanager.compute.generated.models.CreationData; +import com.azure.resourcemanager.compute.generated.models.DataAccessAuthMode; +import com.azure.resourcemanager.compute.generated.models.DiskSecurityProfile; +import com.azure.resourcemanager.compute.generated.models.DiskSku; +import com.azure.resourcemanager.compute.generated.models.DiskState; +import com.azure.resourcemanager.compute.generated.models.Encryption; +import com.azure.resourcemanager.compute.generated.models.EncryptionSettingsCollection; +import com.azure.resourcemanager.compute.generated.models.ExtendedLocation; +import com.azure.resourcemanager.compute.generated.models.HyperVGeneration; +import com.azure.resourcemanager.compute.generated.models.NetworkAccessPolicy; +import com.azure.resourcemanager.compute.generated.models.OperatingSystemTypes; +import com.azure.resourcemanager.compute.generated.models.PropertyUpdatesInProgress; +import com.azure.resourcemanager.compute.generated.models.PublicNetworkAccess; +import com.azure.resourcemanager.compute.generated.models.PurchasePlanAutoGenerated; +import com.azure.resourcemanager.compute.generated.models.ShareInfoElement; +import com.azure.resourcemanager.compute.generated.models.SupportedCapabilities; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** Disk resource. */ +@Fluent +public final class DiskInner extends Resource { + /* + * A relative URI containing the ID of the VM that has the disk attached. + */ + @JsonProperty(value = "managedBy", access = JsonProperty.Access.WRITE_ONLY) + private String managedBy; + + /* + * List of relative URIs containing the IDs of the VMs that have the disk attached. maxShares should be set to a + * value greater than one for disks to allow attaching them to multiple VMs. + */ + @JsonProperty(value = "managedByExtended", access = JsonProperty.Access.WRITE_ONLY) + private List managedByExtended; + + /* + * The disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, UltraSSD_LRS, Premium_ZRS, + * StandardSSD_ZRS, or PremiumV2_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; + + /* + * Disk resource properties. + */ + @JsonProperty(value = "properties") + private DiskProperties innerProperties; + + /** Creates an instance of DiskInner class. */ + public DiskInner() { + } + + /** + * Get the managedBy property: A relative URI containing the ID of the VM that has the disk attached. + * + * @return the managedBy value. + */ + public String managedBy() { + return this.managedBy; + } + + /** + * Get the managedByExtended property: List of relative URIs containing the IDs of the VMs that have the disk + * attached. maxShares should be set to a value greater than one for disks to allow attaching them to multiple VMs. + * + * @return the managedByExtended value. + */ + public List managedByExtended() { + return this.managedByExtended; + } + + /** + * Get the sku property: The disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, UltraSSD_LRS, + * Premium_ZRS, StandardSSD_ZRS, or PremiumV2_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, UltraSSD_LRS, + * Premium_ZRS, StandardSSD_ZRS, or PremiumV2_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 innerProperties property: Disk resource properties. + * + * @return the innerProperties value. + */ + private DiskProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public DiskInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public DiskInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the timeCreated property: The time when the disk was created. + * + * @return the timeCreated value. + */ + public OffsetDateTime timeCreated() { + return this.innerProperties() == null ? null : this.innerProperties().timeCreated(); + } + + /** + * Get the osType property: The Operating System type. + * + * @return the osType value. + */ + public OperatingSystemTypes osType() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new DiskProperties(); + } + this.innerProperties().withOsType(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new DiskProperties(); + } + this.innerProperties().withHyperVGeneration(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new DiskProperties(); + } + this.innerProperties().withPurchasePlan(purchasePlan); + return this; + } + + /** + * Get the supportedCapabilities property: List of supported capabilities for the image from which the OS disk was + * created. + * + * @return the supportedCapabilities value. + */ + public SupportedCapabilities supportedCapabilities() { + return this.innerProperties() == null ? null : this.innerProperties().supportedCapabilities(); + } + + /** + * Set the supportedCapabilities property: List of supported capabilities for the image from which the OS disk was + * created. + * + * @param supportedCapabilities the supportedCapabilities value to set. + * @return the DiskInner object itself. + */ + public DiskInner withSupportedCapabilities(SupportedCapabilities supportedCapabilities) { + if (this.innerProperties() == null) { + this.innerProperties = new DiskProperties(); + } + this.innerProperties().withSupportedCapabilities(supportedCapabilities); + 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new DiskProperties(); + } + this.innerProperties().withCreationData(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new DiskProperties(); + } + this.innerProperties().withDiskSizeGB(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.innerProperties() == null ? null : this.innerProperties().diskSizeBytes(); + } + + /** + * Get the uniqueId property: Unique Guid identifying the resource. + * + * @return the uniqueId value. + */ + public String uniqueId() { + return this.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new DiskProperties(); + } + this.innerProperties().withEncryptionSettingsCollection(encryptionSettingsCollection); + return this; + } + + /** + * Get the provisioningState property: The disk provisioning state. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new DiskProperties(); + } + this.innerProperties().withDiskIopsReadWrite(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new DiskProperties(); + } + this.innerProperties().withDiskMBpsReadWrite(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new DiskProperties(); + } + this.innerProperties().withDiskIopsReadOnly(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new DiskProperties(); + } + this.innerProperties().withDiskMBpsReadOnly(diskMBpsReadOnly); + return this; + } + + /** + * Get the diskState property: The state of the disk. + * + * @return the diskState value. + */ + public DiskState diskState() { + return this.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new DiskProperties(); + } + this.innerProperties().withEncryption(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new DiskProperties(); + } + this.innerProperties().withMaxShares(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.innerProperties() == null ? null : this.innerProperties().shareInfo(); + } + + /** + * Get the networkAccessPolicy property: Policy for accessing the disk via network. + * + * @return the networkAccessPolicy value. + */ + public NetworkAccessPolicy networkAccessPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new DiskProperties(); + } + this.innerProperties().withNetworkAccessPolicy(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new DiskProperties(); + } + this.innerProperties().withDiskAccessId(diskAccessId); + return this; + } + + /** + * Get the burstingEnabledTime property: Latest time when bursting was last enabled on a disk. + * + * @return the burstingEnabledTime value. + */ + public OffsetDateTime burstingEnabledTime() { + return this.innerProperties() == null ? null : this.innerProperties().burstingEnabledTime(); + } + + /** + * 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new DiskProperties(); + } + this.innerProperties().withTier(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new DiskProperties(); + } + this.innerProperties().withBurstingEnabled(burstingEnabled); + return this; + } + + /** + * Get the propertyUpdatesInProgress property: Properties of the disk for which update is pending. + * + * @return the propertyUpdatesInProgress value. + */ + public PropertyUpdatesInProgress propertyUpdatesInProgress() { + return this.innerProperties() == null ? null : this.innerProperties().propertyUpdatesInProgress(); + } + + /** + * Get the supportsHibernation property: Indicates the OS on a disk supports hibernation. + * + * @return the supportsHibernation value. + */ + public Boolean supportsHibernation() { + return this.innerProperties() == null ? null : this.innerProperties().supportsHibernation(); + } + + /** + * Set the supportsHibernation property: Indicates the OS on a disk supports hibernation. + * + * @param supportsHibernation the supportsHibernation value to set. + * @return the DiskInner object itself. + */ + public DiskInner withSupportsHibernation(Boolean supportsHibernation) { + if (this.innerProperties() == null) { + this.innerProperties = new DiskProperties(); + } + this.innerProperties().withSupportsHibernation(supportsHibernation); + return this; + } + + /** + * Get the securityProfile property: Contains the security related information for the resource. + * + * @return the securityProfile value. + */ + public DiskSecurityProfile securityProfile() { + return this.innerProperties() == null ? null : this.innerProperties().securityProfile(); + } + + /** + * Set the securityProfile property: Contains the security related information for the resource. + * + * @param securityProfile the securityProfile value to set. + * @return the DiskInner object itself. + */ + public DiskInner withSecurityProfile(DiskSecurityProfile securityProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new DiskProperties(); + } + this.innerProperties().withSecurityProfile(securityProfile); + return this; + } + + /** + * Get the completionPercent property: Percentage complete for the background copy when a resource is created via + * the CopyStart operation. + * + * @return the completionPercent value. + */ + public Float completionPercent() { + return this.innerProperties() == null ? null : this.innerProperties().completionPercent(); + } + + /** + * Set the completionPercent property: Percentage complete for the background copy when a resource is created via + * the CopyStart operation. + * + * @param completionPercent the completionPercent value to set. + * @return the DiskInner object itself. + */ + public DiskInner withCompletionPercent(Float completionPercent) { + if (this.innerProperties() == null) { + this.innerProperties = new DiskProperties(); + } + this.innerProperties().withCompletionPercent(completionPercent); + return this; + } + + /** + * Get the publicNetworkAccess property: Policy for controlling export on the disk. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.innerProperties() == null ? null : this.innerProperties().publicNetworkAccess(); + } + + /** + * Set the publicNetworkAccess property: Policy for controlling export on the disk. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the DiskInner object itself. + */ + public DiskInner withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + if (this.innerProperties() == null) { + this.innerProperties = new DiskProperties(); + } + this.innerProperties().withPublicNetworkAccess(publicNetworkAccess); + return this; + } + + /** + * Get the dataAccessAuthMode property: Additional authentication requirements when exporting or uploading to a disk + * or snapshot. + * + * @return the dataAccessAuthMode value. + */ + public DataAccessAuthMode dataAccessAuthMode() { + return this.innerProperties() == null ? null : this.innerProperties().dataAccessAuthMode(); + } + + /** + * Set the dataAccessAuthMode property: Additional authentication requirements when exporting or uploading to a disk + * or snapshot. + * + * @param dataAccessAuthMode the dataAccessAuthMode value to set. + * @return the DiskInner object itself. + */ + public DiskInner withDataAccessAuthMode(DataAccessAuthMode dataAccessAuthMode) { + if (this.innerProperties() == null) { + this.innerProperties = new DiskProperties(); + } + this.innerProperties().withDataAccessAuthMode(dataAccessAuthMode); + return this; + } + + /** + * Get the optimizedForFrequentAttach property: Setting this property to true improves reliability and performance + * of data disks that are frequently (more than 5 times a day) by detached from one virtual machine and attached to + * another. This property should not be set for disks that are not detached and attached frequently as it causes the + * disks to not align with the fault domain of the virtual machine. + * + * @return the optimizedForFrequentAttach value. + */ + public Boolean optimizedForFrequentAttach() { + return this.innerProperties() == null ? null : this.innerProperties().optimizedForFrequentAttach(); + } + + /** + * Set the optimizedForFrequentAttach property: Setting this property to true improves reliability and performance + * of data disks that are frequently (more than 5 times a day) by detached from one virtual machine and attached to + * another. This property should not be set for disks that are not detached and attached frequently as it causes the + * disks to not align with the fault domain of the virtual machine. + * + * @param optimizedForFrequentAttach the optimizedForFrequentAttach value to set. + * @return the DiskInner object itself. + */ + public DiskInner withOptimizedForFrequentAttach(Boolean optimizedForFrequentAttach) { + if (this.innerProperties() == null) { + this.innerProperties = new DiskProperties(); + } + this.innerProperties().withOptimizedForFrequentAttach(optimizedForFrequentAttach); + 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 (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/DiskProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/DiskProperties.java new file mode 100644 index 0000000000000..6681b59088b83 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/DiskProperties.java @@ -0,0 +1,847 @@ +// Copyright (c) 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.CreationData; +import com.azure.resourcemanager.compute.generated.models.DataAccessAuthMode; +import com.azure.resourcemanager.compute.generated.models.DiskSecurityProfile; +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.HyperVGeneration; +import com.azure.resourcemanager.compute.generated.models.NetworkAccessPolicy; +import com.azure.resourcemanager.compute.generated.models.OperatingSystemTypes; +import com.azure.resourcemanager.compute.generated.models.PropertyUpdatesInProgress; +import com.azure.resourcemanager.compute.generated.models.PublicNetworkAccess; +import com.azure.resourcemanager.compute.generated.models.PurchasePlanAutoGenerated; +import com.azure.resourcemanager.compute.generated.models.ShareInfoElement; +import com.azure.resourcemanager.compute.generated.models.SupportedCapabilities; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Disk resource properties. */ +@Fluent +public final class DiskProperties { + /* + * The time when the disk was created. + */ + @JsonProperty(value = "timeCreated", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime timeCreated; + + /* + * The Operating System type. + */ + @JsonProperty(value = "osType") + private OperatingSystemTypes osType; + + /* + * The hypervisor generation of the Virtual Machine. Applicable to OS disks only. + */ + @JsonProperty(value = "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 = "purchasePlan") + private PurchasePlanAutoGenerated purchasePlan; + + /* + * List of supported capabilities for the image from which the OS disk was created. + */ + @JsonProperty(value = "supportedCapabilities") + private SupportedCapabilities supportedCapabilities; + + /* + * Disk source information. CreationData information cannot be changed after the disk has been created. + */ + @JsonProperty(value = "creationData", required = true) + 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 = "diskSizeGB") + private Integer diskSizeGB; + + /* + * The size of the disk in bytes. This field is read only. + */ + @JsonProperty(value = "diskSizeBytes", access = JsonProperty.Access.WRITE_ONLY) + private Long diskSizeBytes; + + /* + * Unique Guid identifying the resource. + */ + @JsonProperty(value = "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 = "encryptionSettingsCollection") + private EncryptionSettingsCollection encryptionSettingsCollection; + + /* + * The disk provisioning state. + */ + @JsonProperty(value = "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 = "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 = "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 = "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 = "diskMBpsReadOnly") + private Long diskMBpsReadOnly; + + /* + * The state of the disk. + */ + @JsonProperty(value = "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 = "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 = "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 = "shareInfo", access = JsonProperty.Access.WRITE_ONLY) + private List shareInfo; + + /* + * Policy for accessing the disk via network. + */ + @JsonProperty(value = "networkAccessPolicy") + private NetworkAccessPolicy networkAccessPolicy; + + /* + * ARM id of the DiskAccess resource for using private endpoints on disks. + */ + @JsonProperty(value = "diskAccessId") + private String diskAccessId; + + /* + * Latest time when bursting was last enabled on a disk. + */ + @JsonProperty(value = "burstingEnabledTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime burstingEnabledTime; + + /* + * 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 = "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 = "burstingEnabled") + private Boolean burstingEnabled; + + /* + * Properties of the disk for which update is pending. + */ + @JsonProperty(value = "propertyUpdatesInProgress", access = JsonProperty.Access.WRITE_ONLY) + private PropertyUpdatesInProgress propertyUpdatesInProgress; + + /* + * Indicates the OS on a disk supports hibernation. + */ + @JsonProperty(value = "supportsHibernation") + private Boolean supportsHibernation; + + /* + * Contains the security related information for the resource. + */ + @JsonProperty(value = "securityProfile") + private DiskSecurityProfile securityProfile; + + /* + * Percentage complete for the background copy when a resource is created via the CopyStart operation. + */ + @JsonProperty(value = "completionPercent") + private Float completionPercent; + + /* + * Policy for controlling export on the disk. + */ + @JsonProperty(value = "publicNetworkAccess") + private PublicNetworkAccess publicNetworkAccess; + + /* + * Additional authentication requirements when exporting or uploading to a disk or snapshot. + */ + @JsonProperty(value = "dataAccessAuthMode") + private DataAccessAuthMode dataAccessAuthMode; + + /* + * Setting this property to true improves reliability and performance of data disks that are frequently (more than + * 5 times a day) by detached from one virtual machine and attached to another. This property should not be set for + * disks that are not detached and attached frequently as it causes the disks to not align with the fault domain of + * the virtual machine. + */ + @JsonProperty(value = "optimizedForFrequentAttach") + private Boolean optimizedForFrequentAttach; + + /** Creates an instance of DiskProperties class. */ + public DiskProperties() { + } + + /** + * 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 DiskProperties object itself. + */ + public DiskProperties 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 DiskProperties object itself. + */ + public DiskProperties 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 DiskProperties object itself. + */ + public DiskProperties withPurchasePlan(PurchasePlanAutoGenerated purchasePlan) { + this.purchasePlan = purchasePlan; + return this; + } + + /** + * Get the supportedCapabilities property: List of supported capabilities for the image from which the OS disk was + * created. + * + * @return the supportedCapabilities value. + */ + public SupportedCapabilities supportedCapabilities() { + return this.supportedCapabilities; + } + + /** + * Set the supportedCapabilities property: List of supported capabilities for the image from which the OS disk was + * created. + * + * @param supportedCapabilities the supportedCapabilities value to set. + * @return the DiskProperties object itself. + */ + public DiskProperties withSupportedCapabilities(SupportedCapabilities supportedCapabilities) { + this.supportedCapabilities = supportedCapabilities; + 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 DiskProperties object itself. + */ + public DiskProperties 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 DiskProperties object itself. + */ + public DiskProperties 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 DiskProperties object itself. + */ + public DiskProperties 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 DiskProperties object itself. + */ + public DiskProperties 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 DiskProperties object itself. + */ + public DiskProperties 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 DiskProperties object itself. + */ + public DiskProperties 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 DiskProperties object itself. + */ + public DiskProperties 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 DiskProperties object itself. + */ + public DiskProperties 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 DiskProperties object itself. + */ + public DiskProperties 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 DiskProperties object itself. + */ + public DiskProperties 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 DiskProperties object itself. + */ + public DiskProperties withDiskAccessId(String diskAccessId) { + this.diskAccessId = diskAccessId; + return this; + } + + /** + * Get the burstingEnabledTime property: Latest time when bursting was last enabled on a disk. + * + * @return the burstingEnabledTime value. + */ + public OffsetDateTime burstingEnabledTime() { + return this.burstingEnabledTime; + } + + /** + * 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 DiskProperties object itself. + */ + public DiskProperties 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 DiskProperties object itself. + */ + public DiskProperties withBurstingEnabled(Boolean burstingEnabled) { + this.burstingEnabled = burstingEnabled; + return this; + } + + /** + * Get the propertyUpdatesInProgress property: Properties of the disk for which update is pending. + * + * @return the propertyUpdatesInProgress value. + */ + public PropertyUpdatesInProgress propertyUpdatesInProgress() { + return this.propertyUpdatesInProgress; + } + + /** + * Get the supportsHibernation property: Indicates the OS on a disk supports hibernation. + * + * @return the supportsHibernation value. + */ + public Boolean supportsHibernation() { + return this.supportsHibernation; + } + + /** + * Set the supportsHibernation property: Indicates the OS on a disk supports hibernation. + * + * @param supportsHibernation the supportsHibernation value to set. + * @return the DiskProperties object itself. + */ + public DiskProperties withSupportsHibernation(Boolean supportsHibernation) { + this.supportsHibernation = supportsHibernation; + return this; + } + + /** + * Get the securityProfile property: Contains the security related information for the resource. + * + * @return the securityProfile value. + */ + public DiskSecurityProfile securityProfile() { + return this.securityProfile; + } + + /** + * Set the securityProfile property: Contains the security related information for the resource. + * + * @param securityProfile the securityProfile value to set. + * @return the DiskProperties object itself. + */ + public DiskProperties withSecurityProfile(DiskSecurityProfile securityProfile) { + this.securityProfile = securityProfile; + return this; + } + + /** + * Get the completionPercent property: Percentage complete for the background copy when a resource is created via + * the CopyStart operation. + * + * @return the completionPercent value. + */ + public Float completionPercent() { + return this.completionPercent; + } + + /** + * Set the completionPercent property: Percentage complete for the background copy when a resource is created via + * the CopyStart operation. + * + * @param completionPercent the completionPercent value to set. + * @return the DiskProperties object itself. + */ + public DiskProperties withCompletionPercent(Float completionPercent) { + this.completionPercent = completionPercent; + return this; + } + + /** + * Get the publicNetworkAccess property: Policy for controlling export on the disk. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.publicNetworkAccess; + } + + /** + * Set the publicNetworkAccess property: Policy for controlling export on the disk. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the DiskProperties object itself. + */ + public DiskProperties withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + return this; + } + + /** + * Get the dataAccessAuthMode property: Additional authentication requirements when exporting or uploading to a disk + * or snapshot. + * + * @return the dataAccessAuthMode value. + */ + public DataAccessAuthMode dataAccessAuthMode() { + return this.dataAccessAuthMode; + } + + /** + * Set the dataAccessAuthMode property: Additional authentication requirements when exporting or uploading to a disk + * or snapshot. + * + * @param dataAccessAuthMode the dataAccessAuthMode value to set. + * @return the DiskProperties object itself. + */ + public DiskProperties withDataAccessAuthMode(DataAccessAuthMode dataAccessAuthMode) { + this.dataAccessAuthMode = dataAccessAuthMode; + return this; + } + + /** + * Get the optimizedForFrequentAttach property: Setting this property to true improves reliability and performance + * of data disks that are frequently (more than 5 times a day) by detached from one virtual machine and attached to + * another. This property should not be set for disks that are not detached and attached frequently as it causes the + * disks to not align with the fault domain of the virtual machine. + * + * @return the optimizedForFrequentAttach value. + */ + public Boolean optimizedForFrequentAttach() { + return this.optimizedForFrequentAttach; + } + + /** + * Set the optimizedForFrequentAttach property: Setting this property to true improves reliability and performance + * of data disks that are frequently (more than 5 times a day) by detached from one virtual machine and attached to + * another. This property should not be set for disks that are not detached and attached frequently as it causes the + * disks to not align with the fault domain of the virtual machine. + * + * @param optimizedForFrequentAttach the optimizedForFrequentAttach value to set. + * @return the DiskProperties object itself. + */ + public DiskProperties withOptimizedForFrequentAttach(Boolean optimizedForFrequentAttach) { + this.optimizedForFrequentAttach = optimizedForFrequentAttach; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (purchasePlan() != null) { + purchasePlan().validate(); + } + if (supportedCapabilities() != null) { + supportedCapabilities().validate(); + } + if (creationData() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property creationData in model DiskProperties")); + } else { + creationData().validate(); + } + if (encryptionSettingsCollection() != null) { + encryptionSettingsCollection().validate(); + } + if (encryption() != null) { + encryption().validate(); + } + if (shareInfo() != null) { + shareInfo().forEach(e -> e.validate()); + } + if (propertyUpdatesInProgress() != null) { + propertyUpdatesInProgress().validate(); + } + if (securityProfile() != null) { + securityProfile().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DiskProperties.class); +} 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..06c075e01689a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/DiskRestorePointInner.java @@ -0,0 +1,340 @@ +// Copyright (c) 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.resourcemanager.compute.generated.models.DiskSecurityProfile; +import com.azure.resourcemanager.compute.generated.models.Encryption; +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.ProxyOnlyResource; +import com.azure.resourcemanager.compute.generated.models.PublicNetworkAccess; +import com.azure.resourcemanager.compute.generated.models.PurchasePlanAutoGenerated; +import com.azure.resourcemanager.compute.generated.models.SupportedCapabilities; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Properties of disk restore point. */ +@Fluent +public final class DiskRestorePointInner extends ProxyOnlyResource { + /* + * Properties of an incremental disk restore point + */ + @JsonProperty(value = "properties") + private DiskRestorePointProperties innerProperties; + + /** Creates an instance of DiskRestorePointInner class. */ + public DiskRestorePointInner() { + } + + /** + * Get the innerProperties property: Properties of an incremental disk restore point. + * + * @return the innerProperties value. + */ + private DiskRestorePointProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the timeCreated property: The timestamp of restorePoint creation. + * + * @return the timeCreated value. + */ + public OffsetDateTime timeCreated() { + return this.innerProperties() == null ? null : this.innerProperties().timeCreated(); + } + + /** + * Get the sourceResourceId property: arm id of source disk or source disk restore point. + * + * @return the sourceResourceId value. + */ + public String sourceResourceId() { + return this.innerProperties() == null ? null : this.innerProperties().sourceResourceId(); + } + + /** + * Get the osType property: The Operating System type. + * + * @return the osType value. + */ + public OperatingSystemTypes osType() { + return this.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new DiskRestorePointProperties(); + } + this.innerProperties().withHyperVGeneration(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new DiskRestorePointProperties(); + } + this.innerProperties().withPurchasePlan(purchasePlan); + return this; + } + + /** + * Get the supportedCapabilities property: List of supported capabilities for the image from which the OS disk was + * created. + * + * @return the supportedCapabilities value. + */ + public SupportedCapabilities supportedCapabilities() { + return this.innerProperties() == null ? null : this.innerProperties().supportedCapabilities(); + } + + /** + * Set the supportedCapabilities property: List of supported capabilities for the image from which the OS disk was + * created. + * + * @param supportedCapabilities the supportedCapabilities value to set. + * @return the DiskRestorePointInner object itself. + */ + public DiskRestorePointInner withSupportedCapabilities(SupportedCapabilities supportedCapabilities) { + if (this.innerProperties() == null) { + this.innerProperties = new DiskRestorePointProperties(); + } + this.innerProperties().withSupportedCapabilities(supportedCapabilities); + return this; + } + + /** + * Get the familyId property: id of the backing snapshot's MIS family. + * + * @return the familyId value. + */ + public String familyId() { + return this.innerProperties() == null ? null : this.innerProperties().familyId(); + } + + /** + * Get the sourceUniqueId property: unique incarnation id of the source disk. + * + * @return the sourceUniqueId value. + */ + public String sourceUniqueId() { + return this.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().encryption(); + } + + /** + * Get the supportsHibernation property: Indicates the OS on a disk supports hibernation. + * + * @return the supportsHibernation value. + */ + public Boolean supportsHibernation() { + return this.innerProperties() == null ? null : this.innerProperties().supportsHibernation(); + } + + /** + * Set the supportsHibernation property: Indicates the OS on a disk supports hibernation. + * + * @param supportsHibernation the supportsHibernation value to set. + * @return the DiskRestorePointInner object itself. + */ + public DiskRestorePointInner withSupportsHibernation(Boolean supportsHibernation) { + if (this.innerProperties() == null) { + this.innerProperties = new DiskRestorePointProperties(); + } + this.innerProperties().withSupportsHibernation(supportsHibernation); + return this; + } + + /** + * Get the networkAccessPolicy property: Policy for accessing the disk via network. + * + * @return the networkAccessPolicy value. + */ + public NetworkAccessPolicy networkAccessPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().networkAccessPolicy(); + } + + /** + * Set the networkAccessPolicy property: Policy for accessing the disk via network. + * + * @param networkAccessPolicy the networkAccessPolicy value to set. + * @return the DiskRestorePointInner object itself. + */ + public DiskRestorePointInner withNetworkAccessPolicy(NetworkAccessPolicy networkAccessPolicy) { + if (this.innerProperties() == null) { + this.innerProperties = new DiskRestorePointProperties(); + } + this.innerProperties().withNetworkAccessPolicy(networkAccessPolicy); + return this; + } + + /** + * Get the publicNetworkAccess property: Policy for controlling export on the disk. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.innerProperties() == null ? null : this.innerProperties().publicNetworkAccess(); + } + + /** + * Set the publicNetworkAccess property: Policy for controlling export on the disk. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the DiskRestorePointInner object itself. + */ + public DiskRestorePointInner withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + if (this.innerProperties() == null) { + this.innerProperties = new DiskRestorePointProperties(); + } + this.innerProperties().withPublicNetworkAccess(publicNetworkAccess); + 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.innerProperties() == null ? null : this.innerProperties().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 DiskRestorePointInner object itself. + */ + public DiskRestorePointInner withDiskAccessId(String diskAccessId) { + if (this.innerProperties() == null) { + this.innerProperties = new DiskRestorePointProperties(); + } + this.innerProperties().withDiskAccessId(diskAccessId); + return this; + } + + /** + * Get the completionPercent property: Percentage complete for the background copy of disk restore point when source + * resource is from a different region. + * + * @return the completionPercent value. + */ + public Float completionPercent() { + return this.innerProperties() == null ? null : this.innerProperties().completionPercent(); + } + + /** + * Set the completionPercent property: Percentage complete for the background copy of disk restore point when source + * resource is from a different region. + * + * @param completionPercent the completionPercent value to set. + * @return the DiskRestorePointInner object itself. + */ + public DiskRestorePointInner withCompletionPercent(Float completionPercent) { + if (this.innerProperties() == null) { + this.innerProperties = new DiskRestorePointProperties(); + } + this.innerProperties().withCompletionPercent(completionPercent); + return this; + } + + /** + * Get the replicationState property: Replication state of disk restore point when source resource is from a + * different region. + * + * @return the replicationState value. + */ + public String replicationState() { + return this.innerProperties() == null ? null : this.innerProperties().replicationState(); + } + + /** + * Get the sourceResourceLocation property: Location of source disk or source disk restore point when source + * resource is from a different region. + * + * @return the sourceResourceLocation value. + */ + public String sourceResourceLocation() { + return this.innerProperties() == null ? null : this.innerProperties().sourceResourceLocation(); + } + + /** + * Get the securityProfile property: Contains the security related information for the resource. + * + * @return the securityProfile value. + */ + public DiskSecurityProfile securityProfile() { + return this.innerProperties() == null ? null : this.innerProperties().securityProfile(); + } + + /** + * Set the securityProfile property: Contains the security related information for the resource. + * + * @param securityProfile the securityProfile value to set. + * @return the DiskRestorePointInner object itself. + */ + public DiskRestorePointInner withSecurityProfile(DiskSecurityProfile securityProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new DiskRestorePointProperties(); + } + this.innerProperties().withSecurityProfile(securityProfile); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/DiskRestorePointProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/DiskRestorePointProperties.java new file mode 100644 index 0000000000000..e2ac30ae4bf29 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/DiskRestorePointProperties.java @@ -0,0 +1,407 @@ +// Copyright (c) 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.resourcemanager.compute.generated.models.DiskSecurityProfile; +import com.azure.resourcemanager.compute.generated.models.Encryption; +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.PublicNetworkAccess; +import com.azure.resourcemanager.compute.generated.models.PurchasePlanAutoGenerated; +import com.azure.resourcemanager.compute.generated.models.SupportedCapabilities; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Properties of an incremental disk restore point. */ +@Fluent +public final class DiskRestorePointProperties { + /* + * The timestamp of restorePoint creation + */ + @JsonProperty(value = "timeCreated", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime timeCreated; + + /* + * arm id of source disk or source disk restore point. + */ + @JsonProperty(value = "sourceResourceId", access = JsonProperty.Access.WRITE_ONLY) + private String sourceResourceId; + + /* + * The Operating System type. + */ + @JsonProperty(value = "osType", access = JsonProperty.Access.WRITE_ONLY) + private OperatingSystemTypes osType; + + /* + * The hypervisor generation of the Virtual Machine. Applicable to OS disks only. + */ + @JsonProperty(value = "hyperVGeneration") + private HyperVGeneration hyperVGeneration; + + /* + * Purchase plan information for the the image from which the OS disk was created. + */ + @JsonProperty(value = "purchasePlan") + private PurchasePlanAutoGenerated purchasePlan; + + /* + * List of supported capabilities for the image from which the OS disk was created. + */ + @JsonProperty(value = "supportedCapabilities") + private SupportedCapabilities supportedCapabilities; + + /* + * id of the backing snapshot's MIS family + */ + @JsonProperty(value = "familyId", access = JsonProperty.Access.WRITE_ONLY) + private String familyId; + + /* + * unique incarnation id of the source disk + */ + @JsonProperty(value = "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 = "encryption", access = JsonProperty.Access.WRITE_ONLY) + private Encryption encryption; + + /* + * Indicates the OS on a disk supports hibernation. + */ + @JsonProperty(value = "supportsHibernation") + private Boolean supportsHibernation; + + /* + * Policy for accessing the disk via network. + */ + @JsonProperty(value = "networkAccessPolicy") + private NetworkAccessPolicy networkAccessPolicy; + + /* + * Policy for controlling export on the disk. + */ + @JsonProperty(value = "publicNetworkAccess") + private PublicNetworkAccess publicNetworkAccess; + + /* + * ARM id of the DiskAccess resource for using private endpoints on disks. + */ + @JsonProperty(value = "diskAccessId") + private String diskAccessId; + + /* + * Percentage complete for the background copy of disk restore point when source resource is from a different + * region. + */ + @JsonProperty(value = "completionPercent") + private Float completionPercent; + + /* + * Replication state of disk restore point when source resource is from a different region. + */ + @JsonProperty(value = "replicationState", access = JsonProperty.Access.WRITE_ONLY) + private String replicationState; + + /* + * Location of source disk or source disk restore point when source resource is from a different region. + */ + @JsonProperty(value = "sourceResourceLocation", access = JsonProperty.Access.WRITE_ONLY) + private String sourceResourceLocation; + + /* + * Contains the security related information for the resource. + */ + @JsonProperty(value = "securityProfile") + private DiskSecurityProfile securityProfile; + + /** Creates an instance of DiskRestorePointProperties class. */ + public DiskRestorePointProperties() { + } + + /** + * 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 or source disk restore point. + * + * @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 DiskRestorePointProperties object itself. + */ + public DiskRestorePointProperties 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 DiskRestorePointProperties object itself. + */ + public DiskRestorePointProperties withPurchasePlan(PurchasePlanAutoGenerated purchasePlan) { + this.purchasePlan = purchasePlan; + return this; + } + + /** + * Get the supportedCapabilities property: List of supported capabilities for the image from which the OS disk was + * created. + * + * @return the supportedCapabilities value. + */ + public SupportedCapabilities supportedCapabilities() { + return this.supportedCapabilities; + } + + /** + * Set the supportedCapabilities property: List of supported capabilities for the image from which the OS disk was + * created. + * + * @param supportedCapabilities the supportedCapabilities value to set. + * @return the DiskRestorePointProperties object itself. + */ + public DiskRestorePointProperties withSupportedCapabilities(SupportedCapabilities supportedCapabilities) { + this.supportedCapabilities = supportedCapabilities; + return this; + } + + /** + * Get the familyId property: id of the backing snapshot's MIS family. + * + * @return the familyId value. + */ + public String familyId() { + return this.familyId; + } + + /** + * Get the sourceUniqueId property: unique incarnation id of the source disk. + * + * @return the sourceUniqueId value. + */ + public String sourceUniqueId() { + return this.sourceUniqueId; + } + + /** + * Get the encryption property: Encryption property can be used to encrypt data at rest with customer managed keys + * or platform managed keys. + * + * @return the encryption value. + */ + public Encryption encryption() { + return this.encryption; + } + + /** + * Get the supportsHibernation property: Indicates the OS on a disk supports hibernation. + * + * @return the supportsHibernation value. + */ + public Boolean supportsHibernation() { + return this.supportsHibernation; + } + + /** + * Set the supportsHibernation property: Indicates the OS on a disk supports hibernation. + * + * @param supportsHibernation the supportsHibernation value to set. + * @return the DiskRestorePointProperties object itself. + */ + public DiskRestorePointProperties withSupportsHibernation(Boolean supportsHibernation) { + this.supportsHibernation = supportsHibernation; + 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 DiskRestorePointProperties object itself. + */ + public DiskRestorePointProperties withNetworkAccessPolicy(NetworkAccessPolicy networkAccessPolicy) { + this.networkAccessPolicy = networkAccessPolicy; + return this; + } + + /** + * Get the publicNetworkAccess property: Policy for controlling export on the disk. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.publicNetworkAccess; + } + + /** + * Set the publicNetworkAccess property: Policy for controlling export on the disk. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the DiskRestorePointProperties object itself. + */ + public DiskRestorePointProperties withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + 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 DiskRestorePointProperties object itself. + */ + public DiskRestorePointProperties withDiskAccessId(String diskAccessId) { + this.diskAccessId = diskAccessId; + return this; + } + + /** + * Get the completionPercent property: Percentage complete for the background copy of disk restore point when source + * resource is from a different region. + * + * @return the completionPercent value. + */ + public Float completionPercent() { + return this.completionPercent; + } + + /** + * Set the completionPercent property: Percentage complete for the background copy of disk restore point when source + * resource is from a different region. + * + * @param completionPercent the completionPercent value to set. + * @return the DiskRestorePointProperties object itself. + */ + public DiskRestorePointProperties withCompletionPercent(Float completionPercent) { + this.completionPercent = completionPercent; + return this; + } + + /** + * Get the replicationState property: Replication state of disk restore point when source resource is from a + * different region. + * + * @return the replicationState value. + */ + public String replicationState() { + return this.replicationState; + } + + /** + * Get the sourceResourceLocation property: Location of source disk or source disk restore point when source + * resource is from a different region. + * + * @return the sourceResourceLocation value. + */ + public String sourceResourceLocation() { + return this.sourceResourceLocation; + } + + /** + * Get the securityProfile property: Contains the security related information for the resource. + * + * @return the securityProfile value. + */ + public DiskSecurityProfile securityProfile() { + return this.securityProfile; + } + + /** + * Set the securityProfile property: Contains the security related information for the resource. + * + * @param securityProfile the securityProfile value to set. + * @return the DiskRestorePointProperties object itself. + */ + public DiskRestorePointProperties withSecurityProfile(DiskSecurityProfile securityProfile) { + this.securityProfile = securityProfile; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (purchasePlan() != null) { + purchasePlan().validate(); + } + if (supportedCapabilities() != null) { + supportedCapabilities().validate(); + } + if (encryption() != null) { + encryption().validate(); + } + if (securityProfile() != null) { + securityProfile().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/DiskUpdateProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/DiskUpdateProperties.java new file mode 100644 index 0000000000000..f851fcf5037ba --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/DiskUpdateProperties.java @@ -0,0 +1,605 @@ +// Copyright (c) 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.resourcemanager.compute.generated.models.DataAccessAuthMode; +import com.azure.resourcemanager.compute.generated.models.Encryption; +import com.azure.resourcemanager.compute.generated.models.EncryptionSettingsCollection; +import com.azure.resourcemanager.compute.generated.models.NetworkAccessPolicy; +import com.azure.resourcemanager.compute.generated.models.OperatingSystemTypes; +import com.azure.resourcemanager.compute.generated.models.PropertyUpdatesInProgress; +import com.azure.resourcemanager.compute.generated.models.PublicNetworkAccess; +import com.azure.resourcemanager.compute.generated.models.PurchasePlanAutoGenerated; +import com.azure.resourcemanager.compute.generated.models.SupportedCapabilities; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Disk resource update properties. */ +@Fluent +public final class DiskUpdateProperties { + /* + * the Operating System type. + */ + @JsonProperty(value = "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 = "diskSizeGB") + private Integer diskSizeGB; + + /* + * Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk + * or snapshot. + */ + @JsonProperty(value = "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 = "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 = "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 = "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 = "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 = "maxShares") + private Integer maxShares; + + /* + * Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. + */ + @JsonProperty(value = "encryption") + private Encryption encryption; + + /* + * Policy for accessing the disk via network. + */ + @JsonProperty(value = "networkAccessPolicy") + private NetworkAccessPolicy networkAccessPolicy; + + /* + * ARM id of the DiskAccess resource for using private endpoints on disks. + */ + @JsonProperty(value = "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 = "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 = "burstingEnabled") + private Boolean burstingEnabled; + + /* + * Purchase plan information to be added on the OS disk + */ + @JsonProperty(value = "purchasePlan") + private PurchasePlanAutoGenerated purchasePlan; + + /* + * List of supported capabilities to be added on the OS disk. + */ + @JsonProperty(value = "supportedCapabilities") + private SupportedCapabilities supportedCapabilities; + + /* + * Properties of the disk for which update is pending. + */ + @JsonProperty(value = "propertyUpdatesInProgress", access = JsonProperty.Access.WRITE_ONLY) + private PropertyUpdatesInProgress propertyUpdatesInProgress; + + /* + * Indicates the OS on a disk supports hibernation. + */ + @JsonProperty(value = "supportsHibernation") + private Boolean supportsHibernation; + + /* + * Policy for controlling export on the disk. + */ + @JsonProperty(value = "publicNetworkAccess") + private PublicNetworkAccess publicNetworkAccess; + + /* + * Additional authentication requirements when exporting or uploading to a disk or snapshot. + */ + @JsonProperty(value = "dataAccessAuthMode") + private DataAccessAuthMode dataAccessAuthMode; + + /* + * Setting this property to true improves reliability and performance of data disks that are frequently (more than + * 5 times a day) by detached from one virtual machine and attached to another. This property should not be set for + * disks that are not detached and attached frequently as it causes the disks to not align with the fault domain of + * the virtual machine. + */ + @JsonProperty(value = "optimizedForFrequentAttach") + private Boolean optimizedForFrequentAttach; + + /** Creates an instance of DiskUpdateProperties class. */ + public DiskUpdateProperties() { + } + + /** + * 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 DiskUpdateProperties object itself. + */ + public DiskUpdateProperties 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 DiskUpdateProperties object itself. + */ + public DiskUpdateProperties 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 DiskUpdateProperties object itself. + */ + public DiskUpdateProperties 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 DiskUpdateProperties object itself. + */ + public DiskUpdateProperties 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 DiskUpdateProperties object itself. + */ + public DiskUpdateProperties 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 DiskUpdateProperties object itself. + */ + public DiskUpdateProperties 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 DiskUpdateProperties object itself. + */ + public DiskUpdateProperties 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 DiskUpdateProperties object itself. + */ + public DiskUpdateProperties 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 DiskUpdateProperties object itself. + */ + public DiskUpdateProperties 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 DiskUpdateProperties object itself. + */ + public DiskUpdateProperties 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 DiskUpdateProperties object itself. + */ + public DiskUpdateProperties 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 DiskUpdateProperties object itself. + */ + public DiskUpdateProperties 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 DiskUpdateProperties object itself. + */ + public DiskUpdateProperties 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 DiskUpdateProperties object itself. + */ + public DiskUpdateProperties withPurchasePlan(PurchasePlanAutoGenerated purchasePlan) { + this.purchasePlan = purchasePlan; + return this; + } + + /** + * Get the supportedCapabilities property: List of supported capabilities to be added on the OS disk. + * + * @return the supportedCapabilities value. + */ + public SupportedCapabilities supportedCapabilities() { + return this.supportedCapabilities; + } + + /** + * Set the supportedCapabilities property: List of supported capabilities to be added on the OS disk. + * + * @param supportedCapabilities the supportedCapabilities value to set. + * @return the DiskUpdateProperties object itself. + */ + public DiskUpdateProperties withSupportedCapabilities(SupportedCapabilities supportedCapabilities) { + this.supportedCapabilities = supportedCapabilities; + return this; + } + + /** + * Get the propertyUpdatesInProgress property: Properties of the disk for which update is pending. + * + * @return the propertyUpdatesInProgress value. + */ + public PropertyUpdatesInProgress propertyUpdatesInProgress() { + return this.propertyUpdatesInProgress; + } + + /** + * Get the supportsHibernation property: Indicates the OS on a disk supports hibernation. + * + * @return the supportsHibernation value. + */ + public Boolean supportsHibernation() { + return this.supportsHibernation; + } + + /** + * Set the supportsHibernation property: Indicates the OS on a disk supports hibernation. + * + * @param supportsHibernation the supportsHibernation value to set. + * @return the DiskUpdateProperties object itself. + */ + public DiskUpdateProperties withSupportsHibernation(Boolean supportsHibernation) { + this.supportsHibernation = supportsHibernation; + return this; + } + + /** + * Get the publicNetworkAccess property: Policy for controlling export on the disk. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.publicNetworkAccess; + } + + /** + * Set the publicNetworkAccess property: Policy for controlling export on the disk. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the DiskUpdateProperties object itself. + */ + public DiskUpdateProperties withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + return this; + } + + /** + * Get the dataAccessAuthMode property: Additional authentication requirements when exporting or uploading to a disk + * or snapshot. + * + * @return the dataAccessAuthMode value. + */ + public DataAccessAuthMode dataAccessAuthMode() { + return this.dataAccessAuthMode; + } + + /** + * Set the dataAccessAuthMode property: Additional authentication requirements when exporting or uploading to a disk + * or snapshot. + * + * @param dataAccessAuthMode the dataAccessAuthMode value to set. + * @return the DiskUpdateProperties object itself. + */ + public DiskUpdateProperties withDataAccessAuthMode(DataAccessAuthMode dataAccessAuthMode) { + this.dataAccessAuthMode = dataAccessAuthMode; + return this; + } + + /** + * Get the optimizedForFrequentAttach property: Setting this property to true improves reliability and performance + * of data disks that are frequently (more than 5 times a day) by detached from one virtual machine and attached to + * another. This property should not be set for disks that are not detached and attached frequently as it causes the + * disks to not align with the fault domain of the virtual machine. + * + * @return the optimizedForFrequentAttach value. + */ + public Boolean optimizedForFrequentAttach() { + return this.optimizedForFrequentAttach; + } + + /** + * Set the optimizedForFrequentAttach property: Setting this property to true improves reliability and performance + * of data disks that are frequently (more than 5 times a day) by detached from one virtual machine and attached to + * another. This property should not be set for disks that are not detached and attached frequently as it causes the + * disks to not align with the fault domain of the virtual machine. + * + * @param optimizedForFrequentAttach the optimizedForFrequentAttach value to set. + * @return the DiskUpdateProperties object itself. + */ + public DiskUpdateProperties withOptimizedForFrequentAttach(Boolean optimizedForFrequentAttach) { + this.optimizedForFrequentAttach = optimizedForFrequentAttach; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (encryptionSettingsCollection() != null) { + encryptionSettingsCollection().validate(); + } + if (encryption() != null) { + encryption().validate(); + } + if (purchasePlan() != null) { + purchasePlan().validate(); + } + if (supportedCapabilities() != null) { + supportedCapabilities().validate(); + } + if (propertyUpdatesInProgress() != null) { + propertyUpdatesInProgress().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/EncryptionSetProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/EncryptionSetProperties.java new file mode 100644 index 0000000000000..f38055756f7b7 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/EncryptionSetProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.compute.generated.models.ApiError; +import com.azure.resourcemanager.compute.generated.models.DiskEncryptionSetType; +import com.azure.resourcemanager.compute.generated.models.KeyForDiskEncryptionSet; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** The EncryptionSetProperties model. */ +@Fluent +public final class EncryptionSetProperties { + /* + * The type of key used to encrypt the data of the disk. + */ + @JsonProperty(value = "encryptionType") + private DiskEncryptionSetType encryptionType; + + /* + * The key vault key which is currently used by this disk encryption set. + */ + @JsonProperty(value = "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 = "previousKeys", access = JsonProperty.Access.WRITE_ONLY) + private List previousKeys; + + /* + * The disk encryption set provisioning state. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * Set this flag to true to enable auto-updating of this disk encryption set to the latest key version. + */ + @JsonProperty(value = "rotationToLatestKeyVersionEnabled") + private Boolean rotationToLatestKeyVersionEnabled; + + /* + * The time when the active key of this disk encryption set was updated. + */ + @JsonProperty(value = "lastKeyRotationTimestamp", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastKeyRotationTimestamp; + + /* + * The error that was encountered during auto-key rotation. If an error is present, then auto-key rotation will not + * be attempted until the error on this disk encryption set is fixed. + */ + @JsonProperty(value = "autoKeyRotationError", access = JsonProperty.Access.WRITE_ONLY) + private ApiError autoKeyRotationError; + + /* + * Multi-tenant application client id to access key vault in a different tenant. Setting the value to 'None' will + * clear the property. + */ + @JsonProperty(value = "federatedClientId") + private String federatedClientId; + + /** Creates an instance of EncryptionSetProperties class. */ + public EncryptionSetProperties() { + } + + /** + * 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 EncryptionSetProperties object itself. + */ + public EncryptionSetProperties 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 EncryptionSetProperties object itself. + */ + public EncryptionSetProperties withActiveKey(KeyForDiskEncryptionSet activeKey) { + this.activeKey = activeKey; + return this; + } + + /** + * Get the previousKeys property: A readonly collection of key vault keys previously used by this disk encryption + * set while a key rotation is in progress. It will be empty if there is no ongoing key rotation. + * + * @return the previousKeys value. + */ + public List previousKeys() { + return this.previousKeys; + } + + /** + * Get the provisioningState property: The disk encryption set provisioning state. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the rotationToLatestKeyVersionEnabled property: Set this flag to true to enable auto-updating of this disk + * encryption set to the latest key version. + * + * @return the rotationToLatestKeyVersionEnabled value. + */ + public Boolean rotationToLatestKeyVersionEnabled() { + return this.rotationToLatestKeyVersionEnabled; + } + + /** + * Set the rotationToLatestKeyVersionEnabled property: Set this flag to true to enable auto-updating of this disk + * encryption set to the latest key version. + * + * @param rotationToLatestKeyVersionEnabled the rotationToLatestKeyVersionEnabled value to set. + * @return the EncryptionSetProperties object itself. + */ + public EncryptionSetProperties withRotationToLatestKeyVersionEnabled(Boolean rotationToLatestKeyVersionEnabled) { + this.rotationToLatestKeyVersionEnabled = rotationToLatestKeyVersionEnabled; + return this; + } + + /** + * Get the lastKeyRotationTimestamp property: The time when the active key of this disk encryption set was updated. + * + * @return the lastKeyRotationTimestamp value. + */ + public OffsetDateTime lastKeyRotationTimestamp() { + return this.lastKeyRotationTimestamp; + } + + /** + * Get the autoKeyRotationError property: The error that was encountered during auto-key rotation. If an error is + * present, then auto-key rotation will not be attempted until the error on this disk encryption set is fixed. + * + * @return the autoKeyRotationError value. + */ + public ApiError autoKeyRotationError() { + return this.autoKeyRotationError; + } + + /** + * Get the federatedClientId property: Multi-tenant application client id to access key vault in a different tenant. + * Setting the value to 'None' will clear the property. + * + * @return the federatedClientId value. + */ + public String federatedClientId() { + return this.federatedClientId; + } + + /** + * Set the federatedClientId property: Multi-tenant application client id to access key vault in a different tenant. + * Setting the value to 'None' will clear the property. + * + * @param federatedClientId the federatedClientId value to set. + * @return the EncryptionSetProperties object itself. + */ + public EncryptionSetProperties withFederatedClientId(String federatedClientId) { + this.federatedClientId = federatedClientId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (activeKey() != null) { + activeKey().validate(); + } + if (previousKeys() != null) { + previousKeys().forEach(e -> e.validate()); + } + if (autoKeyRotationError() != null) { + autoKeyRotationError().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..8cd797bb5e9f2 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/GalleryApplicationInner.java @@ -0,0 +1,233 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.resourcemanager.compute.generated.models.GalleryApplicationCustomAction; +import com.azure.resourcemanager.compute.generated.models.OperatingSystemTypes; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** Specifies information about the gallery Application Definition that you want to create or update. */ +@Fluent +public final class GalleryApplicationInner extends Resource { + /* + * Describes the properties of a gallery Application Definition. + */ + @JsonProperty(value = "properties") + private GalleryApplicationProperties innerProperties; + + /** Creates an instance of GalleryApplicationInner class. */ + public GalleryApplicationInner() { + } + + /** + * Get the innerProperties property: Describes the properties of a gallery Application Definition. + * + * @return the innerProperties value. + */ + private GalleryApplicationProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public GalleryApplicationInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public GalleryApplicationInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryApplicationProperties(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the eula property: The Eula agreement for the gallery Application Definition. + * + * @return the eula value. + */ + public String eula() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryApplicationProperties(); + } + this.innerProperties().withEula(eula); + return this; + } + + /** + * Get the privacyStatementUri property: The privacy statement uri. + * + * @return the privacyStatementUri value. + */ + public String privacyStatementUri() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryApplicationProperties(); + } + this.innerProperties().withPrivacyStatementUri(privacyStatementUri); + return this; + } + + /** + * Get the releaseNoteUri property: The release note uri. + * + * @return the releaseNoteUri value. + */ + public String releaseNoteUri() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryApplicationProperties(); + } + this.innerProperties().withReleaseNoteUri(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryApplicationProperties(); + } + this.innerProperties().withEndOfLifeDate(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryApplicationProperties(); + } + this.innerProperties().withSupportedOSType(supportedOSType); + return this; + } + + /** + * Get the customActions property: A list of custom actions that can be performed with all of the Gallery + * Application Versions within this Gallery Application. + * + * @return the customActions value. + */ + public List customActions() { + return this.innerProperties() == null ? null : this.innerProperties().customActions(); + } + + /** + * Set the customActions property: A list of custom actions that can be performed with all of the Gallery + * Application Versions within this Gallery Application. + * + * @param customActions the customActions value to set. + * @return the GalleryApplicationInner object itself. + */ + public GalleryApplicationInner withCustomActions(List customActions) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryApplicationProperties(); + } + this.innerProperties().withCustomActions(customActions); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/GalleryApplicationProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/GalleryApplicationProperties.java new file mode 100644 index 0000000000000..54d4a7dc93270 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/GalleryApplicationProperties.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.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.models.GalleryApplicationCustomAction; +import com.azure.resourcemanager.compute.generated.models.OperatingSystemTypes; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Describes the properties of a gallery Application Definition. */ +@Fluent +public final class GalleryApplicationProperties { + /* + * The description of this gallery Application Definition resource. This property is updatable. + */ + @JsonProperty(value = "description") + private String description; + + /* + * The Eula agreement for the gallery Application Definition. + */ + @JsonProperty(value = "eula") + private String eula; + + /* + * The privacy statement uri. + */ + @JsonProperty(value = "privacyStatementUri") + private String privacyStatementUri; + + /* + * The release note uri. + */ + @JsonProperty(value = "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 = "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 = "supportedOSType", required = true) + private OperatingSystemTypes supportedOSType; + + /* + * A list of custom actions that can be performed with all of the Gallery Application Versions within this Gallery + * Application. + */ + @JsonProperty(value = "customActions") + private List customActions; + + /** Creates an instance of GalleryApplicationProperties class. */ + public GalleryApplicationProperties() { + } + + /** + * 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 GalleryApplicationProperties object itself. + */ + public GalleryApplicationProperties 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 GalleryApplicationProperties object itself. + */ + public GalleryApplicationProperties 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 GalleryApplicationProperties object itself. + */ + public GalleryApplicationProperties 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 GalleryApplicationProperties object itself. + */ + public GalleryApplicationProperties 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 GalleryApplicationProperties object itself. + */ + public GalleryApplicationProperties 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 GalleryApplicationProperties object itself. + */ + public GalleryApplicationProperties withSupportedOSType(OperatingSystemTypes supportedOSType) { + this.supportedOSType = supportedOSType; + return this; + } + + /** + * Get the customActions property: A list of custom actions that can be performed with all of the Gallery + * Application Versions within this Gallery Application. + * + * @return the customActions value. + */ + public List customActions() { + return this.customActions; + } + + /** + * Set the customActions property: A list of custom actions that can be performed with all of the Gallery + * Application Versions within this Gallery Application. + * + * @param customActions the customActions value to set. + * @return the GalleryApplicationProperties object itself. + */ + public GalleryApplicationProperties withCustomActions(List customActions) { + this.customActions = customActions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (supportedOSType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property supportedOSType in model GalleryApplicationProperties")); + } + if (customActions() != null) { + customActions().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GalleryApplicationProperties.class); +} 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..3352b13035ef3 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/GalleryApplicationVersionInner.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.resourcemanager.compute.generated.models.GalleryApplicationVersionPublishingProfile; +import com.azure.resourcemanager.compute.generated.models.GalleryApplicationVersionSafetyProfile; +import com.azure.resourcemanager.compute.generated.models.GalleryProvisioningState; +import com.azure.resourcemanager.compute.generated.models.ReplicationStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Specifies information about the gallery Application Version that you want to create or update. */ +@Fluent +public final class GalleryApplicationVersionInner extends Resource { + /* + * Describes the properties of a gallery image version. + */ + @JsonProperty(value = "properties") + private GalleryApplicationVersionProperties innerProperties; + + /** Creates an instance of GalleryApplicationVersionInner class. */ + public GalleryApplicationVersionInner() { + } + + /** + * Get the innerProperties property: Describes the properties of a gallery image version. + * + * @return the innerProperties value. + */ + private GalleryApplicationVersionProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public GalleryApplicationVersionInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public GalleryApplicationVersionInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the publishingProfile property: The publishing profile of a gallery image version. + * + * @return the publishingProfile value. + */ + public GalleryApplicationVersionPublishingProfile publishingProfile() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryApplicationVersionProperties(); + } + this.innerProperties().withPublishingProfile(publishingProfile); + return this; + } + + /** + * Get the safetyProfile property: The safety profile of the Gallery Application Version. + * + * @return the safetyProfile value. + */ + public GalleryApplicationVersionSafetyProfile safetyProfile() { + return this.innerProperties() == null ? null : this.innerProperties().safetyProfile(); + } + + /** + * Set the safetyProfile property: The safety profile of the Gallery Application Version. + * + * @param safetyProfile the safetyProfile value to set. + * @return the GalleryApplicationVersionInner object itself. + */ + public GalleryApplicationVersionInner withSafetyProfile(GalleryApplicationVersionSafetyProfile safetyProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryApplicationVersionProperties(); + } + this.innerProperties().withSafetyProfile(safetyProfile); + return this; + } + + /** + * Get the provisioningState property: The current state of the gallery or gallery artifact. + * + *

The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + public GalleryProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the replicationStatus property: This is the replication status of the gallery image version. + * + * @return the replicationStatus value. + */ + public ReplicationStatus replicationStatus() { + return this.innerProperties() == null ? null : this.innerProperties().replicationStatus(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/GalleryApplicationVersionProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/GalleryApplicationVersionProperties.java new file mode 100644 index 0000000000000..259eaf14f19db --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/GalleryApplicationVersionProperties.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.models.GalleryApplicationVersionPublishingProfile; +import com.azure.resourcemanager.compute.generated.models.GalleryApplicationVersionSafetyProfile; +import com.azure.resourcemanager.compute.generated.models.GalleryProvisioningState; +import com.azure.resourcemanager.compute.generated.models.ReplicationStatus; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the properties of a gallery image version. */ +@Fluent +public final class GalleryApplicationVersionProperties { + /* + * The publishing profile of a gallery image version. + */ + @JsonProperty(value = "publishingProfile", required = true) + private GalleryApplicationVersionPublishingProfile publishingProfile; + + /* + * The safety profile of the Gallery Application Version. + */ + @JsonProperty(value = "safetyProfile") + private GalleryApplicationVersionSafetyProfile safetyProfile; + + /* + * The current state of the gallery or gallery artifact. + * + * The provisioning state, which only appears in the response. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private GalleryProvisioningState provisioningState; + + /* + * This is the replication status of the gallery image version. + */ + @JsonProperty(value = "replicationStatus", access = JsonProperty.Access.WRITE_ONLY) + private ReplicationStatus replicationStatus; + + /** Creates an instance of GalleryApplicationVersionProperties class. */ + public GalleryApplicationVersionProperties() { + } + + /** + * 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 GalleryApplicationVersionProperties object itself. + */ + public GalleryApplicationVersionProperties withPublishingProfile( + GalleryApplicationVersionPublishingProfile publishingProfile) { + this.publishingProfile = publishingProfile; + return this; + } + + /** + * Get the safetyProfile property: The safety profile of the Gallery Application Version. + * + * @return the safetyProfile value. + */ + public GalleryApplicationVersionSafetyProfile safetyProfile() { + return this.safetyProfile; + } + + /** + * Set the safetyProfile property: The safety profile of the Gallery Application Version. + * + * @param safetyProfile the safetyProfile value to set. + * @return the GalleryApplicationVersionProperties object itself. + */ + public GalleryApplicationVersionProperties withSafetyProfile(GalleryApplicationVersionSafetyProfile safetyProfile) { + this.safetyProfile = safetyProfile; + return this; + } + + /** + * Get the provisioningState property: The current state of the gallery or gallery artifact. + * + *

The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + public GalleryProvisioningState 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (publishingProfile() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property publishingProfile in model GalleryApplicationVersionProperties")); + } else { + publishingProfile().validate(); + } + if (safetyProfile() != null) { + safetyProfile().validate(); + } + if (replicationStatus() != null) { + replicationStatus().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GalleryApplicationVersionProperties.class); +} 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..44c51cb801673 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/GalleryImageInner.java @@ -0,0 +1,417 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.resourcemanager.compute.generated.models.Architecture; +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.GalleryProvisioningState; +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.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. */ +@Fluent +public final class GalleryImageInner extends Resource { + /* + * Describes the properties of a gallery image definition. + */ + @JsonProperty(value = "properties") + private GalleryImageProperties innerProperties; + + /** Creates an instance of GalleryImageInner class. */ + public GalleryImageInner() { + } + + /** + * Get the innerProperties property: Describes the properties of a gallery image definition. + * + * @return the innerProperties value. + */ + private GalleryImageProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public GalleryImageInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public GalleryImageInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryImageProperties(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the eula property: The Eula agreement for the gallery image definition. + * + * @return the eula value. + */ + public String eula() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryImageProperties(); + } + this.innerProperties().withEula(eula); + return this; + } + + /** + * Get the privacyStatementUri property: The privacy statement uri. + * + * @return the privacyStatementUri value. + */ + public String privacyStatementUri() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryImageProperties(); + } + this.innerProperties().withPrivacyStatementUri(privacyStatementUri); + return this; + } + + /** + * Get the releaseNoteUri property: The release note uri. + * + * @return the releaseNoteUri value. + */ + public String releaseNoteUri() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryImageProperties(); + } + this.innerProperties().withReleaseNoteUri(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryImageProperties(); + } + this.innerProperties().withOsType(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryImageProperties(); + } + this.innerProperties().withOsState(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryImageProperties(); + } + this.innerProperties().withHyperVGeneration(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryImageProperties(); + } + this.innerProperties().withEndOfLifeDate(endOfLifeDate); + return this; + } + + /** + * Get the identifier property: This is the gallery image definition identifier. + * + * @return the identifier value. + */ + public GalleryImageIdentifier identifier() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryImageProperties(); + } + this.innerProperties().withIdentifier(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryImageProperties(); + } + this.innerProperties().withRecommended(recommended); + return this; + } + + /** + * Get the disallowed property: Describes the disallowed disk types. + * + * @return the disallowed value. + */ + public Disallowed disallowed() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryImageProperties(); + } + this.innerProperties().withDisallowed(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryImageProperties(); + } + this.innerProperties().withPurchasePlan(purchasePlan); + return this; + } + + /** + * Get the provisioningState property: The current state of the gallery or gallery artifact. + * + *

The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + public GalleryProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the features property: A list of gallery image features. + * + * @return the features value. + */ + public List features() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryImageProperties(); + } + this.innerProperties().withFeatures(features); + return this; + } + + /** + * Get the architecture property: The architecture of the image. Applicable to OS disks only. + * + * @return the architecture value. + */ + public Architecture architecture() { + return this.innerProperties() == null ? null : this.innerProperties().architecture(); + } + + /** + * Set the architecture property: The architecture of the image. Applicable to OS disks only. + * + * @param architecture the architecture value to set. + * @return the GalleryImageInner object itself. + */ + public GalleryImageInner withArchitecture(Architecture architecture) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryImageProperties(); + } + this.innerProperties().withArchitecture(architecture); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/GalleryImageProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/GalleryImageProperties.java new file mode 100644 index 0000000000000..3bf2a3c2b148e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/GalleryImageProperties.java @@ -0,0 +1,470 @@ +// Copyright (c) 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.Architecture; +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.GalleryProvisioningState; +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.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Describes the properties of a gallery image definition. */ +@Fluent +public final class GalleryImageProperties { + /* + * The description of this gallery image definition resource. This property is updatable. + */ + @JsonProperty(value = "description") + private String description; + + /* + * The Eula agreement for the gallery image definition. + */ + @JsonProperty(value = "eula") + private String eula; + + /* + * The privacy statement uri. + */ + @JsonProperty(value = "privacyStatementUri") + private String privacyStatementUri; + + /* + * The release note uri. + */ + @JsonProperty(value = "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 = "osType", required = true) + private OperatingSystemTypes osType; + + /* + * This property allows the user to specify whether the virtual machines created under this image are 'Generalized' + * or 'Specialized'. + */ + @JsonProperty(value = "osState", required = true) + private OperatingSystemStateTypes osState; + + /* + * The hypervisor generation of the Virtual Machine. Applicable to OS disks only. + */ + @JsonProperty(value = "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 = "endOfLifeDate") + private OffsetDateTime endOfLifeDate; + + /* + * This is the gallery image definition identifier. + */ + @JsonProperty(value = "identifier", required = true) + private GalleryImageIdentifier identifier; + + /* + * The properties describe the recommended machine configuration for this Image Definition. These properties are + * updatable. + */ + @JsonProperty(value = "recommended") + private RecommendedMachineConfiguration recommended; + + /* + * Describes the disallowed disk types. + */ + @JsonProperty(value = "disallowed") + private Disallowed disallowed; + + /* + * Describes the gallery image definition purchase plan. This is used by marketplace images. + */ + @JsonProperty(value = "purchasePlan") + private ImagePurchasePlan purchasePlan; + + /* + * The current state of the gallery or gallery artifact. + * + * The provisioning state, which only appears in the response. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private GalleryProvisioningState provisioningState; + + /* + * A list of gallery image features. + */ + @JsonProperty(value = "features") + private List features; + + /* + * The architecture of the image. Applicable to OS disks only. + */ + @JsonProperty(value = "architecture") + private Architecture architecture; + + /** Creates an instance of GalleryImageProperties class. */ + public GalleryImageProperties() { + } + + /** + * 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 GalleryImageProperties object itself. + */ + public GalleryImageProperties 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 GalleryImageProperties object itself. + */ + public GalleryImageProperties 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 GalleryImageProperties object itself. + */ + public GalleryImageProperties 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 GalleryImageProperties object itself. + */ + public GalleryImageProperties 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 GalleryImageProperties object itself. + */ + public GalleryImageProperties 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 GalleryImageProperties object itself. + */ + public GalleryImageProperties 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 GalleryImageProperties object itself. + */ + public GalleryImageProperties 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 GalleryImageProperties object itself. + */ + public GalleryImageProperties 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 GalleryImageProperties object itself. + */ + public GalleryImageProperties 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 GalleryImageProperties object itself. + */ + public GalleryImageProperties 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 GalleryImageProperties object itself. + */ + public GalleryImageProperties 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 GalleryImageProperties object itself. + */ + public GalleryImageProperties withPurchasePlan(ImagePurchasePlan purchasePlan) { + this.purchasePlan = purchasePlan; + return this; + } + + /** + * Get the provisioningState property: The current state of the gallery or gallery artifact. + * + *

The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + public GalleryProvisioningState 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 GalleryImageProperties object itself. + */ + public GalleryImageProperties withFeatures(List features) { + this.features = features; + return this; + } + + /** + * Get the architecture property: The architecture of the image. Applicable to OS disks only. + * + * @return the architecture value. + */ + public Architecture architecture() { + return this.architecture; + } + + /** + * Set the architecture property: The architecture of the image. Applicable to OS disks only. + * + * @param architecture the architecture value to set. + * @return the GalleryImageProperties object itself. + */ + public GalleryImageProperties withArchitecture(Architecture architecture) { + this.architecture = architecture; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (osType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property osType in model GalleryImageProperties")); + } + if (osState() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property osState in model GalleryImageProperties")); + } + if (identifier() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property identifier in model GalleryImageProperties")); + } else { + 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()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GalleryImageProperties.class); +} 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..b7bc44436ef71 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/GalleryImageVersionInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.resourcemanager.compute.generated.models.GalleryImageVersionPublishingProfile; +import com.azure.resourcemanager.compute.generated.models.GalleryImageVersionSafetyProfile; +import com.azure.resourcemanager.compute.generated.models.GalleryImageVersionStorageProfile; +import com.azure.resourcemanager.compute.generated.models.GalleryProvisioningState; +import com.azure.resourcemanager.compute.generated.models.ReplicationStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Specifies information about the gallery image version that you want to create or update. */ +@Fluent +public final class GalleryImageVersionInner extends Resource { + /* + * Describes the properties of a gallery image version. + */ + @JsonProperty(value = "properties") + private GalleryImageVersionProperties innerProperties; + + /** Creates an instance of GalleryImageVersionInner class. */ + public GalleryImageVersionInner() { + } + + /** + * Get the innerProperties property: Describes the properties of a gallery image version. + * + * @return the innerProperties value. + */ + private GalleryImageVersionProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public GalleryImageVersionInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public GalleryImageVersionInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the publishingProfile property: The publishing profile of a gallery image Version. + * + * @return the publishingProfile value. + */ + public GalleryImageVersionPublishingProfile publishingProfile() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryImageVersionProperties(); + } + this.innerProperties().withPublishingProfile(publishingProfile); + return this; + } + + /** + * Get the provisioningState property: The current state of the gallery or gallery artifact. + * + *

The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + public GalleryProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the storageProfile property: This is the storage profile of a Gallery Image Version. + * + * @return the storageProfile value. + */ + public GalleryImageVersionStorageProfile storageProfile() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryImageVersionProperties(); + } + this.innerProperties().withStorageProfile(storageProfile); + return this; + } + + /** + * Get the safetyProfile property: This is the safety profile of the Gallery Image Version. + * + * @return the safetyProfile value. + */ + public GalleryImageVersionSafetyProfile safetyProfile() { + return this.innerProperties() == null ? null : this.innerProperties().safetyProfile(); + } + + /** + * Set the safetyProfile property: This is the safety profile of the Gallery Image Version. + * + * @param safetyProfile the safetyProfile value to set. + * @return the GalleryImageVersionInner object itself. + */ + public GalleryImageVersionInner withSafetyProfile(GalleryImageVersionSafetyProfile safetyProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryImageVersionProperties(); + } + this.innerProperties().withSafetyProfile(safetyProfile); + 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.innerProperties() == null ? null : this.innerProperties().replicationStatus(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/GalleryImageVersionProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/GalleryImageVersionProperties.java new file mode 100644 index 0000000000000..1593760995d6b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/GalleryImageVersionProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.models.GalleryImageVersionPublishingProfile; +import com.azure.resourcemanager.compute.generated.models.GalleryImageVersionSafetyProfile; +import com.azure.resourcemanager.compute.generated.models.GalleryImageVersionStorageProfile; +import com.azure.resourcemanager.compute.generated.models.GalleryProvisioningState; +import com.azure.resourcemanager.compute.generated.models.ReplicationStatus; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the properties of a gallery image version. */ +@Fluent +public final class GalleryImageVersionProperties { + /* + * The publishing profile of a gallery image Version. + */ + @JsonProperty(value = "publishingProfile") + private GalleryImageVersionPublishingProfile publishingProfile; + + /* + * The current state of the gallery or gallery artifact. + * + * The provisioning state, which only appears in the response. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private GalleryProvisioningState provisioningState; + + /* + * This is the storage profile of a Gallery Image Version. + */ + @JsonProperty(value = "storageProfile", required = true) + private GalleryImageVersionStorageProfile storageProfile; + + /* + * This is the safety profile of the Gallery Image Version. + */ + @JsonProperty(value = "safetyProfile") + private GalleryImageVersionSafetyProfile safetyProfile; + + /* + * This is the replication status of the gallery image version. + */ + @JsonProperty(value = "replicationStatus", access = JsonProperty.Access.WRITE_ONLY) + private ReplicationStatus replicationStatus; + + /** Creates an instance of GalleryImageVersionProperties class. */ + public GalleryImageVersionProperties() { + } + + /** + * 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 GalleryImageVersionProperties object itself. + */ + public GalleryImageVersionProperties withPublishingProfile(GalleryImageVersionPublishingProfile publishingProfile) { + this.publishingProfile = publishingProfile; + return this; + } + + /** + * Get the provisioningState property: The current state of the gallery or gallery artifact. + * + *

The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + public GalleryProvisioningState 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 GalleryImageVersionProperties object itself. + */ + public GalleryImageVersionProperties withStorageProfile(GalleryImageVersionStorageProfile storageProfile) { + this.storageProfile = storageProfile; + return this; + } + + /** + * Get the safetyProfile property: This is the safety profile of the Gallery Image Version. + * + * @return the safetyProfile value. + */ + public GalleryImageVersionSafetyProfile safetyProfile() { + return this.safetyProfile; + } + + /** + * Set the safetyProfile property: This is the safety profile of the Gallery Image Version. + * + * @param safetyProfile the safetyProfile value to set. + * @return the GalleryImageVersionProperties object itself. + */ + public GalleryImageVersionProperties withSafetyProfile(GalleryImageVersionSafetyProfile safetyProfile) { + this.safetyProfile = safetyProfile; + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (publishingProfile() != null) { + publishingProfile().validate(); + } + if (storageProfile() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property storageProfile in model GalleryImageVersionProperties")); + } else { + storageProfile().validate(); + } + if (safetyProfile() != null) { + safetyProfile().validate(); + } + if (replicationStatus() != null) { + replicationStatus().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GalleryImageVersionProperties.class); +} 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..7b1d882207772 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/GalleryInner.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.management.Resource; +import com.azure.resourcemanager.compute.generated.models.GalleryIdentifier; +import com.azure.resourcemanager.compute.generated.models.GalleryProvisioningState; +import com.azure.resourcemanager.compute.generated.models.SharingProfile; +import com.azure.resourcemanager.compute.generated.models.SharingStatus; +import com.azure.resourcemanager.compute.generated.models.SoftDeletePolicy; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Specifies information about the Shared Image Gallery that you want to create or update. */ +@Fluent +public final class GalleryInner extends Resource { + /* + * Describes the properties of a Shared Image Gallery. + */ + @JsonProperty(value = "properties") + private GalleryProperties innerProperties; + + /** Creates an instance of GalleryInner class. */ + public GalleryInner() { + } + + /** + * Get the innerProperties property: Describes the properties of a Shared Image Gallery. + * + * @return the innerProperties value. + */ + private GalleryProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public GalleryInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public GalleryInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryProperties(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the identifier property: Describes the gallery unique name. + * + * @return the identifier value. + */ + public GalleryIdentifier identifier() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryProperties(); + } + this.innerProperties().withIdentifier(identifier); + return this; + } + + /** + * Get the provisioningState property: The current state of the gallery or gallery artifact. + * + *

The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + public GalleryProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the sharingProfile property: Profile for gallery sharing to subscription or tenant. + * + * @return the sharingProfile value. + */ + public SharingProfile sharingProfile() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryProperties(); + } + this.innerProperties().withSharingProfile(sharingProfile); + return this; + } + + /** + * Get the softDeletePolicy property: Contains information about the soft deletion policy of the gallery. + * + * @return the softDeletePolicy value. + */ + public SoftDeletePolicy softDeletePolicy() { + return this.innerProperties() == null ? null : this.innerProperties().softDeletePolicy(); + } + + /** + * Set the softDeletePolicy property: Contains information about the soft deletion policy of the gallery. + * + * @param softDeletePolicy the softDeletePolicy value to set. + * @return the GalleryInner object itself. + */ + public GalleryInner withSoftDeletePolicy(SoftDeletePolicy softDeletePolicy) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryProperties(); + } + this.innerProperties().withSoftDeletePolicy(softDeletePolicy); + return this; + } + + /** + * Get the sharingStatus property: Sharing status of current gallery. + * + * @return the sharingStatus value. + */ + public SharingStatus sharingStatus() { + return this.innerProperties() == null ? null : this.innerProperties().sharingStatus(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/GalleryProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/GalleryProperties.java new file mode 100644 index 0000000000000..b71ff6c8dac2f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/GalleryProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.compute.generated.models.GalleryIdentifier; +import com.azure.resourcemanager.compute.generated.models.GalleryProvisioningState; +import com.azure.resourcemanager.compute.generated.models.SharingProfile; +import com.azure.resourcemanager.compute.generated.models.SharingStatus; +import com.azure.resourcemanager.compute.generated.models.SoftDeletePolicy; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the properties of a Shared Image Gallery. */ +@Fluent +public final class GalleryProperties { + /* + * The description of this Shared Image Gallery resource. This property is updatable. + */ + @JsonProperty(value = "description") + private String description; + + /* + * Describes the gallery unique name. + */ + @JsonProperty(value = "identifier") + private GalleryIdentifier identifier; + + /* + * The current state of the gallery or gallery artifact. + * + * The provisioning state, which only appears in the response. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private GalleryProvisioningState provisioningState; + + /* + * Profile for gallery sharing to subscription or tenant + */ + @JsonProperty(value = "sharingProfile") + private SharingProfile sharingProfile; + + /* + * Contains information about the soft deletion policy of the gallery. + */ + @JsonProperty(value = "softDeletePolicy") + private SoftDeletePolicy softDeletePolicy; + + /* + * Sharing status of current gallery. + */ + @JsonProperty(value = "sharingStatus", access = JsonProperty.Access.WRITE_ONLY) + private SharingStatus sharingStatus; + + /** Creates an instance of GalleryProperties class. */ + public GalleryProperties() { + } + + /** + * 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 GalleryProperties object itself. + */ + public GalleryProperties 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 GalleryProperties object itself. + */ + public GalleryProperties withIdentifier(GalleryIdentifier identifier) { + this.identifier = identifier; + return this; + } + + /** + * Get the provisioningState property: The current state of the gallery or gallery artifact. + * + *

The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + public GalleryProvisioningState 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 GalleryProperties object itself. + */ + public GalleryProperties withSharingProfile(SharingProfile sharingProfile) { + this.sharingProfile = sharingProfile; + return this; + } + + /** + * Get the softDeletePolicy property: Contains information about the soft deletion policy of the gallery. + * + * @return the softDeletePolicy value. + */ + public SoftDeletePolicy softDeletePolicy() { + return this.softDeletePolicy; + } + + /** + * Set the softDeletePolicy property: Contains information about the soft deletion policy of the gallery. + * + * @param softDeletePolicy the softDeletePolicy value to set. + * @return the GalleryProperties object itself. + */ + public GalleryProperties withSoftDeletePolicy(SoftDeletePolicy softDeletePolicy) { + this.softDeletePolicy = softDeletePolicy; + return this; + } + + /** + * Get the sharingStatus property: Sharing status of current gallery. + * + * @return the sharingStatus value. + */ + public SharingStatus sharingStatus() { + return this.sharingStatus; + } + + /** + * 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(); + } + if (softDeletePolicy() != null) { + softDeletePolicy().validate(); + } + if (sharingStatus() != null) { + sharingStatus().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..84a004a3ec87d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/ImageInner.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SubResource; +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.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. + */ +@Fluent +public final class ImageInner extends Resource { + /* + * Describes the properties of an Image. + */ + @JsonProperty(value = "properties") + private ImageProperties innerProperties; + + /* + * The extended location of the Image. + */ + @JsonProperty(value = "extendedLocation") + private ExtendedLocation extendedLocation; + + /** Creates an instance of ImageInner class. */ + public ImageInner() { + } + + /** + * Get the innerProperties property: Describes the properties of an Image. + * + * @return the innerProperties value. + */ + private ImageProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** {@inheritDoc} */ + @Override + public ImageInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ImageInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the sourceVirtualMachine property: The source virtual machine from which Image is created. + * + * @return the sourceVirtualMachine value. + */ + public SubResource sourceVirtualMachine() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ImageProperties(); + } + this.innerProperties().withSourceVirtualMachine(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ImageProperties(); + } + this.innerProperties().withStorageProfile(storageProfile); + return this; + } + + /** + * Get the provisioningState property: The provisioning state. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the hyperVGeneration property: Specifies the HyperVGenerationType of the VirtualMachine created from the + * image. From API Version 2019-03-01 if the image source is a blob, then we need the user to specify the value, if + * the source is managed resource like disk or snapshot, we may require the user to specify the property if we + * cannot deduce it from the source managed resource. + * + * @return the hyperVGeneration value. + */ + public HyperVGenerationTypes hyperVGeneration() { + return this.innerProperties() == null ? null : this.innerProperties().hyperVGeneration(); + } + + /** + * Set the hyperVGeneration property: Specifies the HyperVGenerationType of the VirtualMachine created from the + * image. From API Version 2019-03-01 if the image source is a blob, then we need the user to specify the value, if + * the source is managed resource like disk or snapshot, we may require the user to specify the property if we + * cannot deduce it from the source managed resource. + * + * @param hyperVGeneration the hyperVGeneration value to set. + * @return the ImageInner object itself. + */ + public ImageInner withHyperVGeneration(HyperVGenerationTypes hyperVGeneration) { + if (this.innerProperties() == null) { + this.innerProperties = new ImageProperties(); + } + this.innerProperties().withHyperVGeneration(hyperVGeneration); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + if (extendedLocation() != null) { + extendedLocation().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/ImageProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/ImageProperties.java new file mode 100644 index 0000000000000..1bb77edd77b90 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/ImageProperties.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.compute.generated.models.HyperVGenerationTypes; +import com.azure.resourcemanager.compute.generated.models.ImageStorageProfile; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the properties of an Image. */ +@Fluent +public final class ImageProperties { + /* + * The source virtual machine from which Image is created. + */ + @JsonProperty(value = "sourceVirtualMachine") + private SubResource sourceVirtualMachine; + + /* + * Specifies the storage settings for the virtual machine disks. + */ + @JsonProperty(value = "storageProfile") + private ImageStorageProfile storageProfile; + + /* + * The provisioning state. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * Specifies the HyperVGenerationType of the VirtualMachine created from the image. From API Version 2019-03-01 if + * the image source is a blob, then we need the user to specify the value, if the source is managed resource like + * disk or snapshot, we may require the user to specify the property if we cannot deduce it from the source managed + * resource. + */ + @JsonProperty(value = "hyperVGeneration") + private HyperVGenerationTypes hyperVGeneration; + + /** Creates an instance of ImageProperties class. */ + public ImageProperties() { + } + + /** + * 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 ImageProperties object itself. + */ + public ImageProperties 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 ImageProperties object itself. + */ + public ImageProperties withStorageProfile(ImageStorageProfile storageProfile) { + this.storageProfile = storageProfile; + return this; + } + + /** + * Get the provisioningState property: The provisioning state. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the hyperVGeneration property: Specifies the HyperVGenerationType of the VirtualMachine created from the + * image. From API Version 2019-03-01 if the image source is a blob, then we need the user to specify the value, if + * the source is managed resource like disk or snapshot, we may require the user to specify the property if we + * cannot deduce it from the source managed resource. + * + * @return the hyperVGeneration value. + */ + public HyperVGenerationTypes hyperVGeneration() { + return this.hyperVGeneration; + } + + /** + * Set the hyperVGeneration property: Specifies the HyperVGenerationType of the VirtualMachine created from the + * image. From API Version 2019-03-01 if the image source is a blob, then we need the user to specify the value, if + * the source is managed resource like disk or snapshot, we may require the user to specify the property if we + * cannot deduce it from the source managed resource. + * + * @param hyperVGeneration the hyperVGeneration value to set. + * @return the ImageProperties object itself. + */ + public ImageProperties withHyperVGeneration(HyperVGenerationTypes hyperVGeneration) { + this.hyperVGeneration = hyperVGeneration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void 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..e3f168b9843ae --- /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.resourcemanager.compute.generated.models.LogAnalyticsOutput; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** LogAnalytics operation status response. */ +@Immutable +public final class LogAnalyticsOperationResultInner { + /* + * LogAnalyticsOutput + */ + @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) + private LogAnalyticsOutput properties; + + /** Creates an instance of LogAnalyticsOperationResultInner class. */ + public LogAnalyticsOperationResultInner() { + } + + /** + * 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/NetworkInterfaceReferenceProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/NetworkInterfaceReferenceProperties.java new file mode 100644 index 0000000000000..6e6bf219eab1d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/NetworkInterfaceReferenceProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.compute.generated.models.DeleteOptions; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a network interface reference properties. */ +@Fluent +public final class NetworkInterfaceReferenceProperties { + /* + * Specifies the primary network interface in case the virtual machine has more than 1 network interface. + */ + @JsonProperty(value = "primary") + private Boolean primary; + + /* + * Specify what happens to the network interface when the VM is deleted + */ + @JsonProperty(value = "deleteOption") + private DeleteOptions deleteOption; + + /** Creates an instance of NetworkInterfaceReferenceProperties class. */ + public NetworkInterfaceReferenceProperties() { + } + + /** + * 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 NetworkInterfaceReferenceProperties object itself. + */ + public NetworkInterfaceReferenceProperties withPrimary(Boolean primary) { + this.primary = primary; + return this; + } + + /** + * Get the deleteOption property: Specify what happens to the network interface when the VM is deleted. + * + * @return the deleteOption value. + */ + public DeleteOptions deleteOption() { + return this.deleteOption; + } + + /** + * Set the deleteOption property: Specify what happens to the network interface when the VM is deleted. + * + * @param deleteOption the deleteOption value to set. + * @return the NetworkInterfaceReferenceProperties object itself. + */ + public NetworkInterfaceReferenceProperties withDeleteOption(DeleteOptions deleteOption) { + this.deleteOption = deleteOption; + 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/OSFamilyInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/OSFamilyInner.java new file mode 100644 index 0000000000000..2785a3190a496 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/OSFamilyInner.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.compute.generated.models.OSFamilyProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a cloud service OS family. */ +@Fluent +public final class OSFamilyInner { + /* + * Resource Id. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * Resource name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * Resource location. + */ + @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) + private String location; + + /* + * OS family properties. + */ + @JsonProperty(value = "properties") + private OSFamilyProperties properties; + + /** Creates an instance of OSFamilyInner class. */ + public OSFamilyInner() { + } + + /** + * Get the id property: Resource Id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: Resource name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the type property: Resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the location property: Resource location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the properties property: OS family properties. + * + * @return the properties value. + */ + public OSFamilyProperties properties() { + return this.properties; + } + + /** + * Set the properties property: OS family properties. + * + * @param properties the properties value to set. + * @return the OSFamilyInner object itself. + */ + public OSFamilyInner withProperties(OSFamilyProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/OSVersionInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/OSVersionInner.java new file mode 100644 index 0000000000000..a1820f9d891ce --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/OSVersionInner.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.compute.generated.models.OSVersionProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a cloud service OS version. */ +@Fluent +public final class OSVersionInner { + /* + * Resource Id. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * Resource name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * Resource location. + */ + @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) + private String location; + + /* + * OS version properties. + */ + @JsonProperty(value = "properties") + private OSVersionProperties properties; + + /** Creates an instance of OSVersionInner class. */ + public OSVersionInner() { + } + + /** + * Get the id property: Resource Id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: Resource name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the type property: Resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the location property: Resource location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the properties property: OS version properties. + * + * @return the properties value. + */ + public OSVersionProperties properties() { + return this.properties; + } + + /** + * Set the properties property: OS version properties. + * + * @param properties the properties value to set. + * @return the OSVersionInner object itself. + */ + public OSVersionInner withProperties(OSVersionProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/PrivateEndpointConnectionInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/PrivateEndpointConnectionInner.java new file mode 100644 index 0000000000000..261fd819b45a9 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/PrivateEndpointConnectionInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +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.JsonProperty; + +/** The Private Endpoint Connection resource. */ +@Fluent +public final class PrivateEndpointConnectionInner extends ProxyResource { + /* + * Resource properties. + */ + @JsonProperty(value = "properties") + private PrivateEndpointConnectionProperties innerProperties; + + /** Creates an instance of PrivateEndpointConnectionInner class. */ + public PrivateEndpointConnectionInner() { + } + + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. + */ + private PrivateEndpointConnectionProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the privateEndpoint property: The resource of private end point. + * + * @return the privateEndpoint value. + */ + public PrivateEndpoint privateEndpoint() { + return this.innerProperties() == null ? null : this.innerProperties().privateEndpoint(); + } + + /** + * Get the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between DiskAccess and Virtual Network. + * + * @return the privateLinkServiceConnectionState value. + */ + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateEndpointConnectionProperties(); + } + this.innerProperties().withPrivateLinkServiceConnectionState(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.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/PrivateEndpointConnectionProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/PrivateEndpointConnectionProperties.java new file mode 100644 index 0000000000000..d2f43e6580420 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/PrivateEndpointConnectionProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +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.JsonProperty; + +/** Properties of the PrivateEndpointConnectProperties. */ +@Fluent +public final class PrivateEndpointConnectionProperties { + /* + * The resource of private end point. + */ + @JsonProperty(value = "privateEndpoint", access = JsonProperty.Access.WRITE_ONLY) + private PrivateEndpoint privateEndpoint; + + /* + * A collection of information about the state of the connection between DiskAccess and Virtual Network. + */ + @JsonProperty(value = "privateLinkServiceConnectionState", required = true) + private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; + + /* + * The provisioning state of the private endpoint connection resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private PrivateEndpointConnectionProvisioningState provisioningState; + + /** Creates an instance of PrivateEndpointConnectionProperties class. */ + public PrivateEndpointConnectionProperties() { + } + + /** + * Get the privateEndpoint property: The resource of private end point. + * + * @return the privateEndpoint value. + */ + public PrivateEndpoint privateEndpoint() { + return this.privateEndpoint; + } + + /** + * Get the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between DiskAccess and Virtual Network. + * + * @return the privateLinkServiceConnectionState value. + */ + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.privateLinkServiceConnectionState; + } + + /** + * Set the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between DiskAccess and Virtual Network. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. + * @return the PrivateEndpointConnectionProperties object itself. + */ + public PrivateEndpointConnectionProperties 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) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property privateLinkServiceConnectionState in model" + + " PrivateEndpointConnectionProperties")); + } else { + privateLinkServiceConnectionState().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PrivateEndpointConnectionProperties.class); +} 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..154d9fadd254a --- /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.resourcemanager.compute.generated.models.PrivateLinkResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of private link resources. */ +@Fluent +public final class PrivateLinkResourceListResultInner { + /* + * Array of private link resources + */ + @JsonProperty(value = "value") + private List value; + + /** Creates an instance of PrivateLinkResourceListResultInner class. */ + public PrivateLinkResourceListResultInner() { + } + + /** + * 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/PrivateLinkResourceProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/PrivateLinkResourceProperties.java new file mode 100644 index 0000000000000..3964c1dfa5d94 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/PrivateLinkResourceProperties.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.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of a private link resource. */ +@Fluent +public final class PrivateLinkResourceProperties { + /* + * The private link resource group id. + */ + @JsonProperty(value = "groupId", access = JsonProperty.Access.WRITE_ONLY) + private String groupId; + + /* + * The private link resource required member names. + */ + @JsonProperty(value = "requiredMembers", access = JsonProperty.Access.WRITE_ONLY) + private List requiredMembers; + + /* + * The private link resource DNS zone name. + */ + @JsonProperty(value = "requiredZoneNames") + private List requiredZoneNames; + + /** Creates an instance of PrivateLinkResourceProperties class. */ + public PrivateLinkResourceProperties() { + } + + /** + * 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 PrivateLinkResourceProperties object itself. + */ + public PrivateLinkResourceProperties 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/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..ab9bc73752bb8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/ProximityPlacementGroupInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.resourcemanager.compute.generated.models.InstanceViewStatus; +import com.azure.resourcemanager.compute.generated.models.ProximityPlacementGroupPropertiesIntent; +import com.azure.resourcemanager.compute.generated.models.ProximityPlacementGroupType; +import com.azure.resourcemanager.compute.generated.models.SubResourceWithColocationStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Specifies information about the proximity placement group. */ +@Fluent +public final class ProximityPlacementGroupInner extends Resource { + /* + * Describes the properties of a Proximity Placement Group. + */ + @JsonProperty(value = "properties") + private ProximityPlacementGroupProperties innerProperties; + + /* + * Specifies the Availability Zone where virtual machine, virtual machine scale set or availability set associated + * with the proximity placement group can be created. + */ + @JsonProperty(value = "zones") + private List zones; + + /** Creates an instance of ProximityPlacementGroupInner class. */ + public ProximityPlacementGroupInner() { + } + + /** + * Get the innerProperties property: Describes the properties of a Proximity Placement Group. + * + * @return the innerProperties value. + */ + private ProximityPlacementGroupProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the zones property: Specifies the Availability Zone where virtual machine, virtual machine scale set or + * availability set associated with the proximity placement group can be created. + * + * @return the zones value. + */ + public List zones() { + return this.zones; + } + + /** + * Set the zones property: Specifies the Availability Zone where virtual machine, virtual machine scale set or + * availability set associated with the proximity placement group can be created. + * + * @param zones the zones value to set. + * @return the ProximityPlacementGroupInner object itself. + */ + public ProximityPlacementGroupInner withZones(List zones) { + this.zones = zones; + 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; + } + + /** + * Get the proximityPlacementGroupType property: 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. + * + * @return the proximityPlacementGroupType value. + */ + public ProximityPlacementGroupType proximityPlacementGroupType() { + return this.innerProperties() == null ? null : this.innerProperties().proximityPlacementGroupType(); + } + + /** + * Set the proximityPlacementGroupType property: 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. + * + * @param proximityPlacementGroupType the proximityPlacementGroupType value to set. + * @return the ProximityPlacementGroupInner object itself. + */ + public ProximityPlacementGroupInner withProximityPlacementGroupType( + ProximityPlacementGroupType proximityPlacementGroupType) { + if (this.innerProperties() == null) { + this.innerProperties = new ProximityPlacementGroupProperties(); + } + this.innerProperties().withProximityPlacementGroupType(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.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().availabilitySets(); + } + + /** + * Get the colocationStatus property: Describes colocation status of the Proximity Placement Group. + * + * @return the colocationStatus value. + */ + public InstanceViewStatus colocationStatus() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ProximityPlacementGroupProperties(); + } + this.innerProperties().withColocationStatus(colocationStatus); + return this; + } + + /** + * Get the intent property: Specifies the user intent of the proximity placement group. + * + * @return the intent value. + */ + public ProximityPlacementGroupPropertiesIntent intent() { + return this.innerProperties() == null ? null : this.innerProperties().intent(); + } + + /** + * Set the intent property: Specifies the user intent of the proximity placement group. + * + * @param intent the intent value to set. + * @return the ProximityPlacementGroupInner object itself. + */ + public ProximityPlacementGroupInner withIntent(ProximityPlacementGroupPropertiesIntent intent) { + if (this.innerProperties() == null) { + this.innerProperties = new ProximityPlacementGroupProperties(); + } + this.innerProperties().withIntent(intent); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/ProximityPlacementGroupProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/ProximityPlacementGroupProperties.java new file mode 100644 index 0000000000000..1b14dc2f5d5c1 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/ProximityPlacementGroupProperties.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.resourcemanager.compute.generated.models.InstanceViewStatus; +import com.azure.resourcemanager.compute.generated.models.ProximityPlacementGroupPropertiesIntent; +import com.azure.resourcemanager.compute.generated.models.ProximityPlacementGroupType; +import com.azure.resourcemanager.compute.generated.models.SubResourceWithColocationStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes the properties of a Proximity Placement Group. */ +@Fluent +public final class ProximityPlacementGroupProperties { + /* + * 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 = "proximityPlacementGroupType") + private ProximityPlacementGroupType proximityPlacementGroupType; + + /* + * A list of references to all virtual machines in the proximity placement group. + */ + @JsonProperty(value = "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 = "virtualMachineScaleSets", access = JsonProperty.Access.WRITE_ONLY) + private List virtualMachineScaleSets; + + /* + * A list of references to all availability sets in the proximity placement group. + */ + @JsonProperty(value = "availabilitySets", access = JsonProperty.Access.WRITE_ONLY) + private List availabilitySets; + + /* + * Describes colocation status of the Proximity Placement Group. + */ + @JsonProperty(value = "colocationStatus") + private InstanceViewStatus colocationStatus; + + /* + * Specifies the user intent of the proximity placement group. + */ + @JsonProperty(value = "intent") + private ProximityPlacementGroupPropertiesIntent intent; + + /** Creates an instance of ProximityPlacementGroupProperties class. */ + public ProximityPlacementGroupProperties() { + } + + /** + * Get the proximityPlacementGroupType property: 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. + * + * @return the proximityPlacementGroupType value. + */ + public ProximityPlacementGroupType proximityPlacementGroupType() { + return this.proximityPlacementGroupType; + } + + /** + * Set the proximityPlacementGroupType property: 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. + * + * @param proximityPlacementGroupType the proximityPlacementGroupType value to set. + * @return the ProximityPlacementGroupProperties object itself. + */ + public ProximityPlacementGroupProperties 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 ProximityPlacementGroupProperties object itself. + */ + public ProximityPlacementGroupProperties withColocationStatus(InstanceViewStatus colocationStatus) { + this.colocationStatus = colocationStatus; + return this; + } + + /** + * Get the intent property: Specifies the user intent of the proximity placement group. + * + * @return the intent value. + */ + public ProximityPlacementGroupPropertiesIntent intent() { + return this.intent; + } + + /** + * Set the intent property: Specifies the user intent of the proximity placement group. + * + * @param intent the intent value to set. + * @return the ProximityPlacementGroupProperties object itself. + */ + public ProximityPlacementGroupProperties withIntent(ProximityPlacementGroupPropertiesIntent intent) { + this.intent = intent; + 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(); + } + if (intent() != null) { + intent().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..a5f64ed57a429 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RecoveryWalkResponseInner.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.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Response after calling a manual recovery walk. */ +@Immutable +public final class RecoveryWalkResponseInner { + /* + * 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; + + /** Creates an instance of RecoveryWalkResponseInner class. */ + public RecoveryWalkResponseInner() { + } + + /** + * 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..c5910f200dbce --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/ResourceSkuInner.java @@ -0,0 +1,244 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +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.JsonProperty; +import java.util.List; + +/** Describes an available Compute SKU. */ +@Immutable +public final class ResourceSkuInner { + /* + * 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; + + /** Creates an instance of ResourceSkuInner class. */ + public ResourceSkuInner() { + } + + /** + * Get the resourceType property: The type of resource the SKU applies to. + * + * @return the resourceType value. + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Get the name property: The name of SKU. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the tier property: Specifies the tier of virtual machines in a scale set.<br /><br /> Possible + * Values:<br /><br /> **Standard**<br /><br /> **Basic**. + * + * @return the tier value. + */ + public String tier() { + return this.tier; + } + + /** + * Get the size property: The Size of the SKU. + * + * @return the size value. + */ + public String size() { + return this.size; + } + + /** + * Get the family property: The Family of this particular SKU. + * + * @return the family value. + */ + public String family() { + return this.family; + } + + /** + * Get the kind property: The Kind of resources that are supported in this SKU. + * + * @return the kind value. + */ + public String kind() { + return this.kind; + } + + /** + * Get the capacity property: Specifies the number of virtual machines in the scale set. + * + * @return the capacity value. + */ + public ResourceSkuCapacity capacity() { + return this.capacity; + } + + /** + * Get the locations property: The set of locations that the SKU is available. + * + * @return the locations value. + */ + public List locations() { + return this.locations; + } + + /** + * Get the locationInfo property: A list of locations and availability zones in those locations where the SKU is + * available. + * + * @return the locationInfo value. + */ + public List locationInfo() { + return this.locationInfo; + } + + /** + * Get the apiVersions property: The api versions that support this SKU. + * + * @return the apiVersions value. + */ + public List apiVersions() { + return this.apiVersions; + } + + /** + * Get the costs property: Metadata for retrieving price info. + * + * @return the costs value. + */ + public List costs() { + return this.costs; + } + + /** + * Get the capabilities property: A name value pair to describe the capability. + * + * @return the capabilities value. + */ + public List capabilities() { + return this.capabilities; + } + + /** + * Get the restrictions property: The restrictions because of which SKU cannot be used. This is empty if there are + * no restrictions. + * + * @return the restrictions value. + */ + public List restrictions() { + return this.restrictions; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (capacity() != null) { + capacity().validate(); + } + if (locationInfo() != null) { + locationInfo().forEach(e -> e.validate()); + } + if (costs() != null) { + costs().forEach(e -> e.validate()); + } + if (capabilities() != null) { + capabilities().forEach(e -> e.validate()); + } + if (restrictions() != null) { + restrictions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RestorePointCollectionInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RestorePointCollectionInner.java new file mode 100644 index 0000000000000..3e43d1271241d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RestorePointCollectionInner.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.management.Resource; +import com.azure.resourcemanager.compute.generated.models.RestorePointCollectionSourceProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Create or update Restore Point collection parameters. */ +@Fluent +public final class RestorePointCollectionInner extends Resource { + /* + * The restore point collection properties. + */ + @JsonProperty(value = "properties") + private RestorePointCollectionProperties innerProperties; + + /** Creates an instance of RestorePointCollectionInner class. */ + public RestorePointCollectionInner() { + } + + /** + * Get the innerProperties property: The restore point collection properties. + * + * @return the innerProperties value. + */ + private RestorePointCollectionProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public RestorePointCollectionInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public RestorePointCollectionInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the source property: The properties of the source resource that this restore point collection is created + * from. + * + * @return the source value. + */ + public RestorePointCollectionSourceProperties source() { + return this.innerProperties() == null ? null : this.innerProperties().source(); + } + + /** + * Set the source property: The properties of the source resource that this restore point collection is created + * from. + * + * @param source the source value to set. + * @return the RestorePointCollectionInner object itself. + */ + public RestorePointCollectionInner withSource(RestorePointCollectionSourceProperties source) { + if (this.innerProperties() == null) { + this.innerProperties = new RestorePointCollectionProperties(); + } + this.innerProperties().withSource(source); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the restore point collection. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the restorePointCollectionId property: The unique id of the restore point collection. + * + * @return the restorePointCollectionId value. + */ + public String restorePointCollectionId() { + return this.innerProperties() == null ? null : this.innerProperties().restorePointCollectionId(); + } + + /** + * Get the restorePoints property: A list containing all restore points created under this restore point collection. + * + * @return the restorePoints value. + */ + public List restorePoints() { + return this.innerProperties() == null ? null : this.innerProperties().restorePoints(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RestorePointCollectionProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RestorePointCollectionProperties.java new file mode 100644 index 0000000000000..8a6f03f91c3c0 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RestorePointCollectionProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.compute.generated.models.RestorePointCollectionSourceProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The restore point collection properties. */ +@Fluent +public final class RestorePointCollectionProperties { + /* + * The properties of the source resource that this restore point collection is created from. + */ + @JsonProperty(value = "source") + private RestorePointCollectionSourceProperties source; + + /* + * The provisioning state of the restore point collection. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The unique id of the restore point collection. + */ + @JsonProperty(value = "restorePointCollectionId", access = JsonProperty.Access.WRITE_ONLY) + private String restorePointCollectionId; + + /* + * A list containing all restore points created under this restore point collection. + */ + @JsonProperty(value = "restorePoints", access = JsonProperty.Access.WRITE_ONLY) + private List restorePoints; + + /** Creates an instance of RestorePointCollectionProperties class. */ + public RestorePointCollectionProperties() { + } + + /** + * Get the source property: The properties of the source resource that this restore point collection is created + * from. + * + * @return the source value. + */ + public RestorePointCollectionSourceProperties source() { + return this.source; + } + + /** + * Set the source property: The properties of the source resource that this restore point collection is created + * from. + * + * @param source the source value to set. + * @return the RestorePointCollectionProperties object itself. + */ + public RestorePointCollectionProperties withSource(RestorePointCollectionSourceProperties source) { + this.source = source; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the restore point collection. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the restorePointCollectionId property: The unique id of the restore point collection. + * + * @return the restorePointCollectionId value. + */ + public String restorePointCollectionId() { + return this.restorePointCollectionId; + } + + /** + * Get the restorePoints property: A list containing all restore points created under this restore point collection. + * + * @return the restorePoints value. + */ + public List restorePoints() { + return this.restorePoints; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (source() != null) { + source().validate(); + } + if (restorePoints() != null) { + restorePoints().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RestorePointInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RestorePointInner.java new file mode 100644 index 0000000000000..9b8e0aadd43ac --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RestorePointInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.resourcemanager.compute.generated.models.ApiEntityReference; +import com.azure.resourcemanager.compute.generated.models.ConsistencyModeTypes; +import com.azure.resourcemanager.compute.generated.models.RestorePointInstanceView; +import com.azure.resourcemanager.compute.generated.models.RestorePointSourceMetadata; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Restore Point details. */ +@Fluent +public final class RestorePointInner extends ProxyResource { + /* + * The restore point properties. + */ + @JsonProperty(value = "properties") + private RestorePointProperties innerProperties; + + /** Creates an instance of RestorePointInner class. */ + public RestorePointInner() { + } + + /** + * Get the innerProperties property: The restore point properties. + * + * @return the innerProperties value. + */ + private RestorePointProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the excludeDisks property: List of disk resource ids that the customer wishes to exclude from the restore + * point. If no disks are specified, all disks will be included. + * + * @return the excludeDisks value. + */ + public List excludeDisks() { + return this.innerProperties() == null ? null : this.innerProperties().excludeDisks(); + } + + /** + * Set the excludeDisks property: List of disk resource ids that the customer wishes to exclude from the restore + * point. If no disks are specified, all disks will be included. + * + * @param excludeDisks the excludeDisks value to set. + * @return the RestorePointInner object itself. + */ + public RestorePointInner withExcludeDisks(List excludeDisks) { + if (this.innerProperties() == null) { + this.innerProperties = new RestorePointProperties(); + } + this.innerProperties().withExcludeDisks(excludeDisks); + return this; + } + + /** + * Get the sourceMetadata property: Gets the details of the VM captured at the time of the restore point creation. + * + * @return the sourceMetadata value. + */ + public RestorePointSourceMetadata sourceMetadata() { + return this.innerProperties() == null ? null : this.innerProperties().sourceMetadata(); + } + + /** + * Set the sourceMetadata property: Gets the details of the VM captured at the time of the restore point creation. + * + * @param sourceMetadata the sourceMetadata value to set. + * @return the RestorePointInner object itself. + */ + public RestorePointInner withSourceMetadata(RestorePointSourceMetadata sourceMetadata) { + if (this.innerProperties() == null) { + this.innerProperties = new RestorePointProperties(); + } + this.innerProperties().withSourceMetadata(sourceMetadata); + return this; + } + + /** + * Get the provisioningState property: Gets the provisioning state of the restore point. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the consistencyMode property: ConsistencyMode of the RestorePoint. Can be specified in the input while + * creating a restore point. For now, only CrashConsistent is accepted as a valid input. Please refer to + * https://aka.ms/RestorePoints for more details. + * + * @return the consistencyMode value. + */ + public ConsistencyModeTypes consistencyMode() { + return this.innerProperties() == null ? null : this.innerProperties().consistencyMode(); + } + + /** + * Set the consistencyMode property: ConsistencyMode of the RestorePoint. Can be specified in the input while + * creating a restore point. For now, only CrashConsistent is accepted as a valid input. Please refer to + * https://aka.ms/RestorePoints for more details. + * + * @param consistencyMode the consistencyMode value to set. + * @return the RestorePointInner object itself. + */ + public RestorePointInner withConsistencyMode(ConsistencyModeTypes consistencyMode) { + if (this.innerProperties() == null) { + this.innerProperties = new RestorePointProperties(); + } + this.innerProperties().withConsistencyMode(consistencyMode); + return this; + } + + /** + * Get the timeCreated property: Gets the creation time of the restore point. + * + * @return the timeCreated value. + */ + public OffsetDateTime timeCreated() { + return this.innerProperties() == null ? null : this.innerProperties().timeCreated(); + } + + /** + * Set the timeCreated property: Gets the creation time of the restore point. + * + * @param timeCreated the timeCreated value to set. + * @return the RestorePointInner object itself. + */ + public RestorePointInner withTimeCreated(OffsetDateTime timeCreated) { + if (this.innerProperties() == null) { + this.innerProperties = new RestorePointProperties(); + } + this.innerProperties().withTimeCreated(timeCreated); + return this; + } + + /** + * Get the sourceRestorePoint property: Resource Id of the source restore point from which a copy needs to be + * created. + * + * @return the sourceRestorePoint value. + */ + public ApiEntityReference sourceRestorePoint() { + return this.innerProperties() == null ? null : this.innerProperties().sourceRestorePoint(); + } + + /** + * Set the sourceRestorePoint property: Resource Id of the source restore point from which a copy needs to be + * created. + * + * @param sourceRestorePoint the sourceRestorePoint value to set. + * @return the RestorePointInner object itself. + */ + public RestorePointInner withSourceRestorePoint(ApiEntityReference sourceRestorePoint) { + if (this.innerProperties() == null) { + this.innerProperties = new RestorePointProperties(); + } + this.innerProperties().withSourceRestorePoint(sourceRestorePoint); + return this; + } + + /** + * Get the instanceView property: The restore point instance view. + * + * @return the instanceView value. + */ + public RestorePointInstanceView instanceView() { + return this.innerProperties() == null ? null : this.innerProperties().instanceView(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RestorePointProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RestorePointProperties.java new file mode 100644 index 0000000000000..ee60e97b8945a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RestorePointProperties.java @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.compute.generated.models.ApiEntityReference; +import com.azure.resourcemanager.compute.generated.models.ConsistencyModeTypes; +import com.azure.resourcemanager.compute.generated.models.RestorePointInstanceView; +import com.azure.resourcemanager.compute.generated.models.RestorePointSourceMetadata; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** The restore point properties. */ +@Fluent +public final class RestorePointProperties { + /* + * List of disk resource ids that the customer wishes to exclude from the restore point. If no disks are specified, + * all disks will be included. + */ + @JsonProperty(value = "excludeDisks") + private List excludeDisks; + + /* + * Gets the details of the VM captured at the time of the restore point creation. + */ + @JsonProperty(value = "sourceMetadata") + private RestorePointSourceMetadata sourceMetadata; + + /* + * Gets the provisioning state of the restore point. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * ConsistencyMode of the RestorePoint. Can be specified in the input while creating a restore point. For now, only + * CrashConsistent is accepted as a valid input. Please refer to https://aka.ms/RestorePoints for more details. + */ + @JsonProperty(value = "consistencyMode") + private ConsistencyModeTypes consistencyMode; + + /* + * Gets the creation time of the restore point. + */ + @JsonProperty(value = "timeCreated") + private OffsetDateTime timeCreated; + + /* + * Resource Id of the source restore point from which a copy needs to be created. + */ + @JsonProperty(value = "sourceRestorePoint") + private ApiEntityReference sourceRestorePoint; + + /* + * The restore point instance view. + */ + @JsonProperty(value = "instanceView", access = JsonProperty.Access.WRITE_ONLY) + private RestorePointInstanceView instanceView; + + /** Creates an instance of RestorePointProperties class. */ + public RestorePointProperties() { + } + + /** + * Get the excludeDisks property: List of disk resource ids that the customer wishes to exclude from the restore + * point. If no disks are specified, all disks will be included. + * + * @return the excludeDisks value. + */ + public List excludeDisks() { + return this.excludeDisks; + } + + /** + * Set the excludeDisks property: List of disk resource ids that the customer wishes to exclude from the restore + * point. If no disks are specified, all disks will be included. + * + * @param excludeDisks the excludeDisks value to set. + * @return the RestorePointProperties object itself. + */ + public RestorePointProperties withExcludeDisks(List excludeDisks) { + this.excludeDisks = excludeDisks; + return this; + } + + /** + * Get the sourceMetadata property: Gets the details of the VM captured at the time of the restore point creation. + * + * @return the sourceMetadata value. + */ + public RestorePointSourceMetadata sourceMetadata() { + return this.sourceMetadata; + } + + /** + * Set the sourceMetadata property: Gets the details of the VM captured at the time of the restore point creation. + * + * @param sourceMetadata the sourceMetadata value to set. + * @return the RestorePointProperties object itself. + */ + public RestorePointProperties withSourceMetadata(RestorePointSourceMetadata sourceMetadata) { + this.sourceMetadata = sourceMetadata; + return this; + } + + /** + * Get the provisioningState property: Gets the provisioning state of the restore point. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the consistencyMode property: ConsistencyMode of the RestorePoint. Can be specified in the input while + * creating a restore point. For now, only CrashConsistent is accepted as a valid input. Please refer to + * https://aka.ms/RestorePoints for more details. + * + * @return the consistencyMode value. + */ + public ConsistencyModeTypes consistencyMode() { + return this.consistencyMode; + } + + /** + * Set the consistencyMode property: ConsistencyMode of the RestorePoint. Can be specified in the input while + * creating a restore point. For now, only CrashConsistent is accepted as a valid input. Please refer to + * https://aka.ms/RestorePoints for more details. + * + * @param consistencyMode the consistencyMode value to set. + * @return the RestorePointProperties object itself. + */ + public RestorePointProperties withConsistencyMode(ConsistencyModeTypes consistencyMode) { + this.consistencyMode = consistencyMode; + return this; + } + + /** + * Get the timeCreated property: Gets the creation time of the restore point. + * + * @return the timeCreated value. + */ + public OffsetDateTime timeCreated() { + return this.timeCreated; + } + + /** + * Set the timeCreated property: Gets the creation time of the restore point. + * + * @param timeCreated the timeCreated value to set. + * @return the RestorePointProperties object itself. + */ + public RestorePointProperties withTimeCreated(OffsetDateTime timeCreated) { + this.timeCreated = timeCreated; + return this; + } + + /** + * Get the sourceRestorePoint property: Resource Id of the source restore point from which a copy needs to be + * created. + * + * @return the sourceRestorePoint value. + */ + public ApiEntityReference sourceRestorePoint() { + return this.sourceRestorePoint; + } + + /** + * Set the sourceRestorePoint property: Resource Id of the source restore point from which a copy needs to be + * created. + * + * @param sourceRestorePoint the sourceRestorePoint value to set. + * @return the RestorePointProperties object itself. + */ + public RestorePointProperties withSourceRestorePoint(ApiEntityReference sourceRestorePoint) { + this.sourceRestorePoint = sourceRestorePoint; + return this; + } + + /** + * Get the instanceView property: The restore point instance view. + * + * @return the instanceView value. + */ + public RestorePointInstanceView instanceView() { + return this.instanceView; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (excludeDisks() != null) { + excludeDisks().forEach(e -> e.validate()); + } + if (sourceMetadata() != null) { + sourceMetadata().validate(); + } + if (sourceRestorePoint() != null) { + sourceRestorePoint().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/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..18e82c9c90226 --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** The SAS URIs of the console screenshot and serial log blobs. */ +@Immutable +public final class RetrieveBootDiagnosticsDataResultInner { + /* + * 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; + + /** Creates an instance of RetrieveBootDiagnosticsDataResultInner class. */ + public RetrieveBootDiagnosticsDataResultInner() { + } + + /** + * Get the consoleScreenshotBlobUri property: The console screenshot blob URI. + * + * @return the consoleScreenshotBlobUri value. + */ + public String consoleScreenshotBlobUri() { + return this.consoleScreenshotBlobUri; + } + + /** + * Get the serialConsoleLogBlobUri property: The serial console log blob URI. + * + * @return the serialConsoleLogBlobUri value. + */ + public String serialConsoleLogBlobUri() { + return this.serialConsoleLogBlobUri; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RoleInstanceInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RoleInstanceInner.java new file mode 100644 index 0000000000000..dc8a3b01ecdb8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RoleInstanceInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.compute.generated.models.InstanceSku; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Describes the cloud service role instance. */ +@Fluent +public final class RoleInstanceInner { + /* + * Resource Id + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * Resource Name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Resource Type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * Resource Location. + */ + @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) + private String location; + + /* + * Resource tags. + */ + @JsonProperty(value = "tags", access = JsonProperty.Access.WRITE_ONLY) + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /* + * The role instance SKU. + */ + @JsonProperty(value = "sku") + private InstanceSku sku; + + /* + * Role instance properties. + */ + @JsonProperty(value = "properties") + private RoleInstancePropertiesInner properties; + + /** Creates an instance of RoleInstanceInner class. */ + public RoleInstanceInner() { + } + + /** + * Get the id property: Resource Id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: Resource Name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the type property: Resource Type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the location property: Resource Location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Get the sku property: The role instance SKU. + * + * @return the sku value. + */ + public InstanceSku sku() { + return this.sku; + } + + /** + * Set the sku property: The role instance SKU. + * + * @param sku the sku value to set. + * @return the RoleInstanceInner object itself. + */ + public RoleInstanceInner withSku(InstanceSku sku) { + this.sku = sku; + return this; + } + + /** + * Get the properties property: Role instance properties. + * + * @return the properties value. + */ + public RoleInstancePropertiesInner properties() { + return this.properties; + } + + /** + * Set the properties property: Role instance properties. + * + * @param properties the properties value to set. + * @return the RoleInstanceInner object itself. + */ + public RoleInstanceInner withProperties(RoleInstancePropertiesInner properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() != null) { + sku().validate(); + } + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RoleInstancePropertiesInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RoleInstancePropertiesInner.java new file mode 100644 index 0000000000000..dad11560a62e5 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RoleInstancePropertiesInner.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.compute.generated.models.RoleInstanceNetworkProfile; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Role instance properties. */ +@Fluent +public final class RoleInstancePropertiesInner { + /* + * Describes the network profile for the role instance. + */ + @JsonProperty(value = "networkProfile") + private RoleInstanceNetworkProfile networkProfile; + + /* + * The instance view of the role instance. + */ + @JsonProperty(value = "instanceView") + private RoleInstanceViewInner instanceView; + + /** Creates an instance of RoleInstancePropertiesInner class. */ + public RoleInstancePropertiesInner() { + } + + /** + * Get the networkProfile property: Describes the network profile for the role instance. + * + * @return the networkProfile value. + */ + public RoleInstanceNetworkProfile networkProfile() { + return this.networkProfile; + } + + /** + * Set the networkProfile property: Describes the network profile for the role instance. + * + * @param networkProfile the networkProfile value to set. + * @return the RoleInstancePropertiesInner object itself. + */ + public RoleInstancePropertiesInner withNetworkProfile(RoleInstanceNetworkProfile networkProfile) { + this.networkProfile = networkProfile; + return this; + } + + /** + * Get the instanceView property: The instance view of the role instance. + * + * @return the instanceView value. + */ + public RoleInstanceViewInner instanceView() { + return this.instanceView; + } + + /** + * Set the instanceView property: The instance view of the role instance. + * + * @param instanceView the instanceView value to set. + * @return the RoleInstancePropertiesInner object itself. + */ + public RoleInstancePropertiesInner withInstanceView(RoleInstanceViewInner instanceView) { + this.instanceView = instanceView; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (networkProfile() != null) { + networkProfile().validate(); + } + if (instanceView() != null) { + instanceView().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RoleInstanceViewInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RoleInstanceViewInner.java new file mode 100644 index 0000000000000..535d69ac9c045 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RoleInstanceViewInner.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.resourcemanager.compute.generated.models.ResourceInstanceViewStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The instance view of the role instance. */ +@Immutable +public final class RoleInstanceViewInner { + /* + * The Update Domain. + */ + @JsonProperty(value = "platformUpdateDomain", access = JsonProperty.Access.WRITE_ONLY) + private Integer platformUpdateDomain; + + /* + * The Fault Domain. + */ + @JsonProperty(value = "platformFaultDomain", access = JsonProperty.Access.WRITE_ONLY) + private Integer platformFaultDomain; + + /* + * Specifies a unique identifier generated internally for the cloud service associated with this role instance.

NOTE: If you are using Azure Diagnostics extension, this property can be used as 'DeploymentId' for + * querying details. + */ + @JsonProperty(value = "privateId", access = JsonProperty.Access.WRITE_ONLY) + private String privateId; + + /* + * The statuses property. + */ + @JsonProperty(value = "statuses", access = JsonProperty.Access.WRITE_ONLY) + private List statuses; + + /** Creates an instance of RoleInstanceViewInner class. */ + public RoleInstanceViewInner() { + } + + /** + * Get the platformUpdateDomain property: The Update Domain. + * + * @return the platformUpdateDomain value. + */ + public Integer platformUpdateDomain() { + return this.platformUpdateDomain; + } + + /** + * Get the platformFaultDomain property: The Fault Domain. + * + * @return the platformFaultDomain value. + */ + public Integer platformFaultDomain() { + return this.platformFaultDomain; + } + + /** + * Get the privateId property: Specifies a unique identifier generated internally for the cloud service associated + * with this role instance. <br /><br /> NOTE: If you are using Azure Diagnostics extension, this + * property can be used as 'DeploymentId' for querying details. + * + * @return the privateId value. + */ + public String privateId() { + return this.privateId; + } + + /** + * Get the statuses property: The statuses property. + * + * @return the statuses value. + */ + public List statuses() { + return this.statuses; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (statuses() != null) { + statuses().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RollingUpgradeStatusInfoInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RollingUpgradeStatusInfoInner.java new file mode 100644 index 0000000000000..0af67b061d181 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RollingUpgradeStatusInfoInner.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +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.JsonProperty; +import java.util.Map; + +/** The status of the latest virtual machine scale set rolling upgrade. */ +@Fluent +public final class RollingUpgradeStatusInfoInner extends Resource { + /* + * The status of the latest virtual machine scale set rolling upgrade. + */ + @JsonProperty(value = "properties") + private RollingUpgradeStatusInfoProperties innerProperties; + + /** Creates an instance of RollingUpgradeStatusInfoInner class. */ + public RollingUpgradeStatusInfoInner() { + } + + /** + * Get the innerProperties property: The status of the latest virtual machine scale set rolling upgrade. + * + * @return the innerProperties value. + */ + private RollingUpgradeStatusInfoProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public RollingUpgradeStatusInfoInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public RollingUpgradeStatusInfoInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the policy property: The rolling upgrade policies applied for this upgrade. + * + * @return the policy value. + */ + public RollingUpgradePolicy policy() { + return this.innerProperties() == null ? null : this.innerProperties().policy(); + } + + /** + * Get the runningStatus property: Information about the current running state of the overall upgrade. + * + * @return the runningStatus value. + */ + public RollingUpgradeRunningStatus runningStatus() { + return this.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().progress(); + } + + /** + * Get the error property: Error details for this upgrade, if there are any. + * + * @return the error value. + */ + public ApiError error() { + return this.innerProperties() == null ? null : this.innerProperties().error(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RollingUpgradeStatusInfoProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RollingUpgradeStatusInfoProperties.java new file mode 100644 index 0000000000000..a7066f380cff9 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RollingUpgradeStatusInfoProperties.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.models; + +import com.azure.core.annotation.Immutable; +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.JsonProperty; + +/** The status of the latest virtual machine scale set rolling upgrade. */ +@Immutable +public final class RollingUpgradeStatusInfoProperties { + /* + * The rolling upgrade policies applied for this upgrade. + */ + @JsonProperty(value = "policy", access = JsonProperty.Access.WRITE_ONLY) + private RollingUpgradePolicy policy; + + /* + * Information about the current running state of the overall upgrade. + */ + @JsonProperty(value = "runningStatus", access = JsonProperty.Access.WRITE_ONLY) + private RollingUpgradeRunningStatus runningStatus; + + /* + * Information about the number of virtual machine instances in each upgrade 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; + + /** Creates an instance of RollingUpgradeStatusInfoProperties class. */ + public RollingUpgradeStatusInfoProperties() { + } + + /** + * 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; + } + + /** + * 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..c71840204ab27 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RunCommandDocumentBaseInner.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.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.JsonProperty; + +/** Describes the properties of a Run Command metadata. */ +@Fluent +public class RunCommandDocumentBaseInner { + /* + * 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; + + /** Creates an instance of RunCommandDocumentBaseInner class. */ + public RunCommandDocumentBaseInner() { + } + + /** + * 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")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RunCommandDocumentBaseInner.class); +} 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..c57217f765735 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RunCommandDocumentInner.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.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.JsonProperty; +import java.util.List; + +/** Describes the properties of a Run Command. */ +@Fluent +public final class RunCommandDocumentInner extends RunCommandDocumentBaseInner { + /* + * 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; + + /** Creates an instance of RunCommandDocumentInner class. */ + public RunCommandDocumentInner() { + } + + /** + * 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()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RunCommandDocumentInner.class); +} 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..3b5e98cec5909 --- /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.resourcemanager.compute.generated.models.InstanceViewStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The RunCommandResult model. */ +@Fluent +public final class RunCommandResultInner { + /* + * Run command operation response. + */ + @JsonProperty(value = "value") + private List value; + + /** Creates an instance of RunCommandResultInner class. */ + public RunCommandResultInner() { + } + + /** + * 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/SharedGalleryIdentifier.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/SharedGalleryIdentifier.java new file mode 100644 index 0000000000000..ef8f4894da7b0 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/SharedGalleryIdentifier.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The identifier information of shared gallery. */ +@Fluent +public final class SharedGalleryIdentifier { + /* + * The unique id of this shared gallery. + */ + @JsonProperty(value = "uniqueId") + private String uniqueId; + + /** Creates an instance of SharedGalleryIdentifier class. */ + public SharedGalleryIdentifier() { + } + + /** + * 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 SharedGalleryIdentifier object itself. + */ + public SharedGalleryIdentifier withUniqueId(String uniqueId) { + this.uniqueId = uniqueId; + 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/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..e36a5f22e25c4 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/SharedGalleryImageInner.java @@ -0,0 +1,351 @@ +// Copyright (c) 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.resourcemanager.compute.generated.models.Architecture; +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.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Specifies information about the gallery image definition that you want to create or update. */ +@Fluent +public final class SharedGalleryImageInner extends PirSharedGalleryResource { + /* + * Describes the properties of a gallery image definition. + */ + @JsonProperty(value = "properties") + private SharedGalleryImageProperties innerProperties; + + /** Creates an instance of SharedGalleryImageInner class. */ + public SharedGalleryImageInner() { + } + + /** + * Get the innerProperties property: Describes the properties of a gallery image definition. + * + * @return the innerProperties value. + */ + private SharedGalleryImageProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public SharedGalleryImageInner withUniqueId(String uniqueId) { + super.withUniqueId(uniqueId); + 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new SharedGalleryImageProperties(); + } + this.innerProperties().withOsType(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new SharedGalleryImageProperties(); + } + this.innerProperties().withOsState(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new SharedGalleryImageProperties(); + } + this.innerProperties().withEndOfLifeDate(endOfLifeDate); + return this; + } + + /** + * Get the identifier property: This is the gallery image definition identifier. + * + * @return the identifier value. + */ + public GalleryImageIdentifier identifier() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new SharedGalleryImageProperties(); + } + this.innerProperties().withIdentifier(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new SharedGalleryImageProperties(); + } + this.innerProperties().withRecommended(recommended); + return this; + } + + /** + * Get the disallowed property: Describes the disallowed disk types. + * + * @return the disallowed value. + */ + public Disallowed disallowed() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new SharedGalleryImageProperties(); + } + this.innerProperties().withDisallowed(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new SharedGalleryImageProperties(); + } + this.innerProperties().withHyperVGeneration(hyperVGeneration); + return this; + } + + /** + * Get the features property: A list of gallery image features. + * + * @return the features value. + */ + public List features() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new SharedGalleryImageProperties(); + } + this.innerProperties().withFeatures(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new SharedGalleryImageProperties(); + } + this.innerProperties().withPurchasePlan(purchasePlan); + return this; + } + + /** + * Get the architecture property: The architecture of the image. Applicable to OS disks only. + * + * @return the architecture value. + */ + public Architecture architecture() { + return this.innerProperties() == null ? null : this.innerProperties().architecture(); + } + + /** + * Set the architecture property: The architecture of the image. Applicable to OS disks only. + * + * @param architecture the architecture value to set. + * @return the SharedGalleryImageInner object itself. + */ + public SharedGalleryImageInner withArchitecture(Architecture architecture) { + if (this.innerProperties() == null) { + this.innerProperties = new SharedGalleryImageProperties(); + } + this.innerProperties().withArchitecture(architecture); + return this; + } + + /** + * Get the privacyStatementUri property: Privacy statement uri for the current community gallery image. + * + * @return the privacyStatementUri value. + */ + public String privacyStatementUri() { + return this.innerProperties() == null ? null : this.innerProperties().privacyStatementUri(); + } + + /** + * Set the privacyStatementUri property: Privacy statement uri for the current community gallery image. + * + * @param privacyStatementUri the privacyStatementUri value to set. + * @return the SharedGalleryImageInner object itself. + */ + public SharedGalleryImageInner withPrivacyStatementUri(String privacyStatementUri) { + if (this.innerProperties() == null) { + this.innerProperties = new SharedGalleryImageProperties(); + } + this.innerProperties().withPrivacyStatementUri(privacyStatementUri); + return this; + } + + /** + * Get the eula property: End-user license agreement for the current community gallery image. + * + * @return the eula value. + */ + public String eula() { + return this.innerProperties() == null ? null : this.innerProperties().eula(); + } + + /** + * Set the eula property: End-user license agreement for the current community gallery image. + * + * @param eula the eula value to set. + * @return the SharedGalleryImageInner object itself. + */ + public SharedGalleryImageInner withEula(String eula) { + if (this.innerProperties() == null) { + this.innerProperties = new SharedGalleryImageProperties(); + } + this.innerProperties().withEula(eula); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/SharedGalleryImageProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/SharedGalleryImageProperties.java new file mode 100644 index 0000000000000..3d28b491edaeb --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/SharedGalleryImageProperties.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.models.Architecture; +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.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Describes the properties of a gallery image definition. */ +@Fluent +public final class SharedGalleryImageProperties { + /* + * 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 = "osType", required = true) + private OperatingSystemTypes osType; + + /* + * This property allows the user to specify whether the virtual machines created under this image are 'Generalized' + * or 'Specialized'. + */ + @JsonProperty(value = "osState", required = true) + 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 = "endOfLifeDate") + private OffsetDateTime endOfLifeDate; + + /* + * This is the gallery image definition identifier. + */ + @JsonProperty(value = "identifier", required = true) + private GalleryImageIdentifier identifier; + + /* + * The properties describe the recommended machine configuration for this Image Definition. These properties are + * updatable. + */ + @JsonProperty(value = "recommended") + private RecommendedMachineConfiguration recommended; + + /* + * Describes the disallowed disk types. + */ + @JsonProperty(value = "disallowed") + private Disallowed disallowed; + + /* + * The hypervisor generation of the Virtual Machine. Applicable to OS disks only. + */ + @JsonProperty(value = "hyperVGeneration") + private HyperVGeneration hyperVGeneration; + + /* + * A list of gallery image features. + */ + @JsonProperty(value = "features") + private List features; + + /* + * Describes the gallery image definition purchase plan. This is used by marketplace images. + */ + @JsonProperty(value = "purchasePlan") + private ImagePurchasePlan purchasePlan; + + /* + * The architecture of the image. Applicable to OS disks only. + */ + @JsonProperty(value = "architecture") + private Architecture architecture; + + /* + * Privacy statement uri for the current community gallery image. + */ + @JsonProperty(value = "privacyStatementUri") + private String privacyStatementUri; + + /* + * End-user license agreement for the current community gallery image. + */ + @JsonProperty(value = "eula") + private String eula; + + /** Creates an instance of SharedGalleryImageProperties class. */ + public SharedGalleryImageProperties() { + } + + /** + * 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 SharedGalleryImageProperties object itself. + */ + public SharedGalleryImageProperties 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 SharedGalleryImageProperties object itself. + */ + public SharedGalleryImageProperties 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 SharedGalleryImageProperties object itself. + */ + public SharedGalleryImageProperties 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 SharedGalleryImageProperties object itself. + */ + public SharedGalleryImageProperties 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 SharedGalleryImageProperties object itself. + */ + public SharedGalleryImageProperties 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 SharedGalleryImageProperties object itself. + */ + public SharedGalleryImageProperties 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 SharedGalleryImageProperties object itself. + */ + public SharedGalleryImageProperties 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 SharedGalleryImageProperties object itself. + */ + public SharedGalleryImageProperties 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 SharedGalleryImageProperties object itself. + */ + public SharedGalleryImageProperties withPurchasePlan(ImagePurchasePlan purchasePlan) { + this.purchasePlan = purchasePlan; + return this; + } + + /** + * Get the architecture property: The architecture of the image. Applicable to OS disks only. + * + * @return the architecture value. + */ + public Architecture architecture() { + return this.architecture; + } + + /** + * Set the architecture property: The architecture of the image. Applicable to OS disks only. + * + * @param architecture the architecture value to set. + * @return the SharedGalleryImageProperties object itself. + */ + public SharedGalleryImageProperties withArchitecture(Architecture architecture) { + this.architecture = architecture; + return this; + } + + /** + * Get the privacyStatementUri property: Privacy statement uri for the current community gallery image. + * + * @return the privacyStatementUri value. + */ + public String privacyStatementUri() { + return this.privacyStatementUri; + } + + /** + * Set the privacyStatementUri property: Privacy statement uri for the current community gallery image. + * + * @param privacyStatementUri the privacyStatementUri value to set. + * @return the SharedGalleryImageProperties object itself. + */ + public SharedGalleryImageProperties withPrivacyStatementUri(String privacyStatementUri) { + this.privacyStatementUri = privacyStatementUri; + return this; + } + + /** + * Get the eula property: End-user license agreement for the current community gallery image. + * + * @return the eula value. + */ + public String eula() { + return this.eula; + } + + /** + * Set the eula property: End-user license agreement for the current community gallery image. + * + * @param eula the eula value to set. + * @return the SharedGalleryImageProperties object itself. + */ + public SharedGalleryImageProperties withEula(String eula) { + this.eula = eula; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (osType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property osType in model SharedGalleryImageProperties")); + } + if (osState() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property osState in model SharedGalleryImageProperties")); + } + if (identifier() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property identifier in model SharedGalleryImageProperties")); + } else { + 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(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SharedGalleryImageProperties.class); +} 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..65f42bc0dd366 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/SharedGalleryImageVersionInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.compute.generated.models.PirSharedGalleryResource; +import com.azure.resourcemanager.compute.generated.models.SharedGalleryImageVersionStorageProfile; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Specifies information about the gallery image version that you want to create or update. */ +@Fluent +public final class SharedGalleryImageVersionInner extends PirSharedGalleryResource { + /* + * Describes the properties of a gallery image version. + */ + @JsonProperty(value = "properties") + private SharedGalleryImageVersionProperties innerProperties; + + /** Creates an instance of SharedGalleryImageVersionInner class. */ + public SharedGalleryImageVersionInner() { + } + + /** + * Get the innerProperties property: Describes the properties of a gallery image version. + * + * @return the innerProperties value. + */ + private SharedGalleryImageVersionProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public SharedGalleryImageVersionInner withUniqueId(String uniqueId) { + super.withUniqueId(uniqueId); + return this; + } + + /** + * 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new SharedGalleryImageVersionProperties(); + } + this.innerProperties().withPublishedDate(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new SharedGalleryImageVersionProperties(); + } + this.innerProperties().withEndOfLifeDate(endOfLifeDate); + 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.innerProperties() == null ? null : this.innerProperties().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 SharedGalleryImageVersionInner object itself. + */ + public SharedGalleryImageVersionInner withExcludeFromLatest(Boolean excludeFromLatest) { + if (this.innerProperties() == null) { + this.innerProperties = new SharedGalleryImageVersionProperties(); + } + this.innerProperties().withExcludeFromLatest(excludeFromLatest); + return this; + } + + /** + * Get the storageProfile property: Describes the storage profile of the image version. + * + * @return the storageProfile value. + */ + public SharedGalleryImageVersionStorageProfile storageProfile() { + return this.innerProperties() == null ? null : this.innerProperties().storageProfile(); + } + + /** + * Set the storageProfile property: Describes the storage profile of the image version. + * + * @param storageProfile the storageProfile value to set. + * @return the SharedGalleryImageVersionInner object itself. + */ + public SharedGalleryImageVersionInner withStorageProfile(SharedGalleryImageVersionStorageProfile storageProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new SharedGalleryImageVersionProperties(); + } + this.innerProperties().withStorageProfile(storageProfile); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/SharedGalleryImageVersionProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/SharedGalleryImageVersionProperties.java new file mode 100644 index 0000000000000..d903ef928f6e5 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/SharedGalleryImageVersionProperties.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.compute.generated.models.SharedGalleryImageVersionStorageProfile; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Describes the properties of a gallery image version. */ +@Fluent +public final class SharedGalleryImageVersionProperties { + /* + * The published date of the gallery image version Definition. This property can be used for decommissioning + * purposes. This property is updatable. + */ + @JsonProperty(value = "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 = "endOfLifeDate") + private OffsetDateTime endOfLifeDate; + + /* + * 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; + + /* + * Describes the storage profile of the image version. + */ + @JsonProperty(value = "storageProfile") + private SharedGalleryImageVersionStorageProfile storageProfile; + + /** Creates an instance of SharedGalleryImageVersionProperties class. */ + public SharedGalleryImageVersionProperties() { + } + + /** + * 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 SharedGalleryImageVersionProperties object itself. + */ + public SharedGalleryImageVersionProperties 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 SharedGalleryImageVersionProperties object itself. + */ + public SharedGalleryImageVersionProperties withEndOfLifeDate(OffsetDateTime endOfLifeDate) { + this.endOfLifeDate = endOfLifeDate; + 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 SharedGalleryImageVersionProperties object itself. + */ + public SharedGalleryImageVersionProperties withExcludeFromLatest(Boolean excludeFromLatest) { + this.excludeFromLatest = excludeFromLatest; + return this; + } + + /** + * Get the storageProfile property: Describes the storage profile of the image version. + * + * @return the storageProfile value. + */ + public SharedGalleryImageVersionStorageProfile storageProfile() { + return this.storageProfile; + } + + /** + * Set the storageProfile property: Describes the storage profile of the image version. + * + * @param storageProfile the storageProfile value to set. + * @return the SharedGalleryImageVersionProperties object itself. + */ + public SharedGalleryImageVersionProperties withStorageProfile( + SharedGalleryImageVersionStorageProfile storageProfile) { + this.storageProfile = storageProfile; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void 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/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..c7e34ee466b40 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/SharedGalleryInner.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.compute.generated.models.PirSharedGalleryResource; + +/** Specifies information about the Shared Gallery that you want to create or update. */ +@Fluent +public final class SharedGalleryInner extends PirSharedGalleryResource { + /** Creates an instance of SharedGalleryInner class. */ + public SharedGalleryInner() { + } + + /** {@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..a51871b94429a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/SharingUpdateInner.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.models.SharingProfileGroup; +import com.azure.resourcemanager.compute.generated.models.SharingUpdateOperationTypes; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Specifies information about the gallery sharing profile update. */ +@Fluent +public final class SharingUpdateInner { + /* + * 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; + + /** Creates an instance of SharingUpdateInner class. */ + public SharingUpdateInner() { + } + + /** + * 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()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SharingUpdateInner.class); +} 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..8afbb4f3021a3 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/SnapshotInner.java @@ -0,0 +1,624 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.resourcemanager.compute.generated.models.CopyCompletionError; +import com.azure.resourcemanager.compute.generated.models.CreationData; +import com.azure.resourcemanager.compute.generated.models.DataAccessAuthMode; +import com.azure.resourcemanager.compute.generated.models.DiskSecurityProfile; +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.PublicNetworkAccess; +import com.azure.resourcemanager.compute.generated.models.PurchasePlanAutoGenerated; +import com.azure.resourcemanager.compute.generated.models.SnapshotSku; +import com.azure.resourcemanager.compute.generated.models.SupportedCapabilities; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.Map; + +/** Snapshot resource. */ +@Fluent +public final class SnapshotInner extends Resource { + /* + * 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; + + /* + * Snapshot resource properties. + */ + @JsonProperty(value = "properties") + private SnapshotProperties innerProperties; + + /** Creates an instance of SnapshotInner class. */ + public SnapshotInner() { + } + + /** + * 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 innerProperties property: Snapshot resource properties. + * + * @return the innerProperties value. + */ + private SnapshotProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public SnapshotInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public SnapshotInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the timeCreated property: The time when the snapshot was created. + * + * @return the timeCreated value. + */ + public OffsetDateTime timeCreated() { + return this.innerProperties() == null ? null : this.innerProperties().timeCreated(); + } + + /** + * Get the osType property: The Operating System type. + * + * @return the osType value. + */ + public OperatingSystemTypes osType() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new SnapshotProperties(); + } + this.innerProperties().withOsType(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new SnapshotProperties(); + } + this.innerProperties().withHyperVGeneration(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new SnapshotProperties(); + } + this.innerProperties().withPurchasePlan(purchasePlan); + return this; + } + + /** + * Get the supportedCapabilities property: List of supported capabilities for the image from which the source disk + * from the snapshot was originally created. + * + * @return the supportedCapabilities value. + */ + public SupportedCapabilities supportedCapabilities() { + return this.innerProperties() == null ? null : this.innerProperties().supportedCapabilities(); + } + + /** + * Set the supportedCapabilities property: List of supported capabilities for the image from which the source disk + * from the snapshot was originally created. + * + * @param supportedCapabilities the supportedCapabilities value to set. + * @return the SnapshotInner object itself. + */ + public SnapshotInner withSupportedCapabilities(SupportedCapabilities supportedCapabilities) { + if (this.innerProperties() == null) { + this.innerProperties = new SnapshotProperties(); + } + this.innerProperties().withSupportedCapabilities(supportedCapabilities); + 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new SnapshotProperties(); + } + this.innerProperties().withCreationData(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new SnapshotProperties(); + } + this.innerProperties().withDiskSizeGB(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.innerProperties() == null ? null : this.innerProperties().diskSizeBytes(); + } + + /** + * Get the diskState property: The state of the snapshot. + * + * @return the diskState value. + */ + public DiskState diskState() { + return this.innerProperties() == null ? null : this.innerProperties().diskState(); + } + + /** + * Get the uniqueId property: Unique Guid identifying the resource. + * + * @return the uniqueId value. + */ + public String uniqueId() { + return this.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new SnapshotProperties(); + } + this.innerProperties().withEncryptionSettingsCollection(encryptionSettingsCollection); + return this; + } + + /** + * Get the provisioningState property: The disk provisioning state. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new SnapshotProperties(); + } + this.innerProperties().withIncremental(incremental); + return this; + } + + /** + * Get the incrementalSnapshotFamilyId property: Incremental snapshots for a disk share an incremental snapshot + * family id. The Get Page Range Diff API can only be called on incremental snapshots with the same family id. + * + * @return the incrementalSnapshotFamilyId value. + */ + public String incrementalSnapshotFamilyId() { + return this.innerProperties() == null ? null : this.innerProperties().incrementalSnapshotFamilyId(); + } + + /** + * 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new SnapshotProperties(); + } + this.innerProperties().withEncryption(encryption); + return this; + } + + /** + * Get the networkAccessPolicy property: Policy for accessing the disk via network. + * + * @return the networkAccessPolicy value. + */ + public NetworkAccessPolicy networkAccessPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new SnapshotProperties(); + } + this.innerProperties().withNetworkAccessPolicy(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new SnapshotProperties(); + } + this.innerProperties().withDiskAccessId(diskAccessId); + return this; + } + + /** + * Get the securityProfile property: Contains the security related information for the resource. + * + * @return the securityProfile value. + */ + public DiskSecurityProfile securityProfile() { + return this.innerProperties() == null ? null : this.innerProperties().securityProfile(); + } + + /** + * Set the securityProfile property: Contains the security related information for the resource. + * + * @param securityProfile the securityProfile value to set. + * @return the SnapshotInner object itself. + */ + public SnapshotInner withSecurityProfile(DiskSecurityProfile securityProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new SnapshotProperties(); + } + this.innerProperties().withSecurityProfile(securityProfile); + return this; + } + + /** + * Get the supportsHibernation property: Indicates the OS on a snapshot supports hibernation. + * + * @return the supportsHibernation value. + */ + public Boolean supportsHibernation() { + return this.innerProperties() == null ? null : this.innerProperties().supportsHibernation(); + } + + /** + * Set the supportsHibernation property: Indicates the OS on a snapshot supports hibernation. + * + * @param supportsHibernation the supportsHibernation value to set. + * @return the SnapshotInner object itself. + */ + public SnapshotInner withSupportsHibernation(Boolean supportsHibernation) { + if (this.innerProperties() == null) { + this.innerProperties = new SnapshotProperties(); + } + this.innerProperties().withSupportsHibernation(supportsHibernation); + return this; + } + + /** + * Get the publicNetworkAccess property: Policy for controlling export on the disk. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.innerProperties() == null ? null : this.innerProperties().publicNetworkAccess(); + } + + /** + * Set the publicNetworkAccess property: Policy for controlling export on the disk. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the SnapshotInner object itself. + */ + public SnapshotInner withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + if (this.innerProperties() == null) { + this.innerProperties = new SnapshotProperties(); + } + this.innerProperties().withPublicNetworkAccess(publicNetworkAccess); + return this; + } + + /** + * Get the completionPercent property: Percentage complete for the background copy when a resource is created via + * the CopyStart operation. + * + * @return the completionPercent value. + */ + public Float completionPercent() { + return this.innerProperties() == null ? null : this.innerProperties().completionPercent(); + } + + /** + * Set the completionPercent property: Percentage complete for the background copy when a resource is created via + * the CopyStart operation. + * + * @param completionPercent the completionPercent value to set. + * @return the SnapshotInner object itself. + */ + public SnapshotInner withCompletionPercent(Float completionPercent) { + if (this.innerProperties() == null) { + this.innerProperties = new SnapshotProperties(); + } + this.innerProperties().withCompletionPercent(completionPercent); + return this; + } + + /** + * Get the copyCompletionError property: Indicates the error details if the background copy of a resource created + * via the CopyStart operation fails. + * + * @return the copyCompletionError value. + */ + public CopyCompletionError copyCompletionError() { + return this.innerProperties() == null ? null : this.innerProperties().copyCompletionError(); + } + + /** + * Set the copyCompletionError property: Indicates the error details if the background copy of a resource created + * via the CopyStart operation fails. + * + * @param copyCompletionError the copyCompletionError value to set. + * @return the SnapshotInner object itself. + */ + public SnapshotInner withCopyCompletionError(CopyCompletionError copyCompletionError) { + if (this.innerProperties() == null) { + this.innerProperties = new SnapshotProperties(); + } + this.innerProperties().withCopyCompletionError(copyCompletionError); + return this; + } + + /** + * Get the dataAccessAuthMode property: Additional authentication requirements when exporting or uploading to a disk + * or snapshot. + * + * @return the dataAccessAuthMode value. + */ + public DataAccessAuthMode dataAccessAuthMode() { + return this.innerProperties() == null ? null : this.innerProperties().dataAccessAuthMode(); + } + + /** + * Set the dataAccessAuthMode property: Additional authentication requirements when exporting or uploading to a disk + * or snapshot. + * + * @param dataAccessAuthMode the dataAccessAuthMode value to set. + * @return the SnapshotInner object itself. + */ + public SnapshotInner withDataAccessAuthMode(DataAccessAuthMode dataAccessAuthMode) { + if (this.innerProperties() == null) { + this.innerProperties = new SnapshotProperties(); + } + this.innerProperties().withDataAccessAuthMode(dataAccessAuthMode); + 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 (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/SnapshotProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/SnapshotProperties.java new file mode 100644 index 0000000000000..2290713f5abaf --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/SnapshotProperties.java @@ -0,0 +1,630 @@ +// Copyright (c) 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.CopyCompletionError; +import com.azure.resourcemanager.compute.generated.models.CreationData; +import com.azure.resourcemanager.compute.generated.models.DataAccessAuthMode; +import com.azure.resourcemanager.compute.generated.models.DiskSecurityProfile; +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.HyperVGeneration; +import com.azure.resourcemanager.compute.generated.models.NetworkAccessPolicy; +import com.azure.resourcemanager.compute.generated.models.OperatingSystemTypes; +import com.azure.resourcemanager.compute.generated.models.PublicNetworkAccess; +import com.azure.resourcemanager.compute.generated.models.PurchasePlanAutoGenerated; +import com.azure.resourcemanager.compute.generated.models.SupportedCapabilities; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Snapshot resource properties. */ +@Fluent +public final class SnapshotProperties { + /* + * The time when the snapshot was created. + */ + @JsonProperty(value = "timeCreated", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime timeCreated; + + /* + * The Operating System type. + */ + @JsonProperty(value = "osType") + private OperatingSystemTypes osType; + + /* + * The hypervisor generation of the Virtual Machine. Applicable to OS disks only. + */ + @JsonProperty(value = "hyperVGeneration") + private HyperVGeneration hyperVGeneration; + + /* + * Purchase plan information for the image from which the source disk for the snapshot was originally created. + */ + @JsonProperty(value = "purchasePlan") + private PurchasePlanAutoGenerated purchasePlan; + + /* + * List of supported capabilities for the image from which the source disk from the snapshot was originally + * created. + */ + @JsonProperty(value = "supportedCapabilities") + private SupportedCapabilities supportedCapabilities; + + /* + * Disk source information. CreationData information cannot be changed after the disk has been created. + */ + @JsonProperty(value = "creationData", required = true) + 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 = "diskSizeGB") + private Integer diskSizeGB; + + /* + * The size of the disk in bytes. This field is read only. + */ + @JsonProperty(value = "diskSizeBytes", access = JsonProperty.Access.WRITE_ONLY) + private Long diskSizeBytes; + + /* + * The state of the snapshot. + */ + @JsonProperty(value = "diskState", access = JsonProperty.Access.WRITE_ONLY) + private DiskState diskState; + + /* + * Unique Guid identifying the resource. + */ + @JsonProperty(value = "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 = "encryptionSettingsCollection") + private EncryptionSettingsCollection encryptionSettingsCollection; + + /* + * The disk provisioning state. + */ + @JsonProperty(value = "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 = "incremental") + private Boolean incremental; + + /* + * Incremental snapshots for a disk share an incremental snapshot family id. The Get Page Range Diff API can only + * be called on incremental snapshots with the same family id. + */ + @JsonProperty(value = "incrementalSnapshotFamilyId", access = JsonProperty.Access.WRITE_ONLY) + private String incrementalSnapshotFamilyId; + + /* + * Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. + */ + @JsonProperty(value = "encryption") + private Encryption encryption; + + /* + * Policy for accessing the disk via network. + */ + @JsonProperty(value = "networkAccessPolicy") + private NetworkAccessPolicy networkAccessPolicy; + + /* + * ARM id of the DiskAccess resource for using private endpoints on disks. + */ + @JsonProperty(value = "diskAccessId") + private String diskAccessId; + + /* + * Contains the security related information for the resource. + */ + @JsonProperty(value = "securityProfile") + private DiskSecurityProfile securityProfile; + + /* + * Indicates the OS on a snapshot supports hibernation. + */ + @JsonProperty(value = "supportsHibernation") + private Boolean supportsHibernation; + + /* + * Policy for controlling export on the disk. + */ + @JsonProperty(value = "publicNetworkAccess") + private PublicNetworkAccess publicNetworkAccess; + + /* + * Percentage complete for the background copy when a resource is created via the CopyStart operation. + */ + @JsonProperty(value = "completionPercent") + private Float completionPercent; + + /* + * Indicates the error details if the background copy of a resource created via the CopyStart operation fails. + */ + @JsonProperty(value = "copyCompletionError") + private CopyCompletionError copyCompletionError; + + /* + * Additional authentication requirements when exporting or uploading to a disk or snapshot. + */ + @JsonProperty(value = "dataAccessAuthMode") + private DataAccessAuthMode dataAccessAuthMode; + + /** Creates an instance of SnapshotProperties class. */ + public SnapshotProperties() { + } + + /** + * 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 SnapshotProperties object itself. + */ + public SnapshotProperties 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 SnapshotProperties object itself. + */ + public SnapshotProperties 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 SnapshotProperties object itself. + */ + public SnapshotProperties withPurchasePlan(PurchasePlanAutoGenerated purchasePlan) { + this.purchasePlan = purchasePlan; + return this; + } + + /** + * Get the supportedCapabilities property: List of supported capabilities for the image from which the source disk + * from the snapshot was originally created. + * + * @return the supportedCapabilities value. + */ + public SupportedCapabilities supportedCapabilities() { + return this.supportedCapabilities; + } + + /** + * Set the supportedCapabilities property: List of supported capabilities for the image from which the source disk + * from the snapshot was originally created. + * + * @param supportedCapabilities the supportedCapabilities value to set. + * @return the SnapshotProperties object itself. + */ + public SnapshotProperties withSupportedCapabilities(SupportedCapabilities supportedCapabilities) { + this.supportedCapabilities = supportedCapabilities; + 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 SnapshotProperties object itself. + */ + public SnapshotProperties 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 SnapshotProperties object itself. + */ + public SnapshotProperties 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 SnapshotProperties object itself. + */ + public SnapshotProperties 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 SnapshotProperties object itself. + */ + public SnapshotProperties withIncremental(Boolean incremental) { + this.incremental = incremental; + return this; + } + + /** + * Get the incrementalSnapshotFamilyId property: Incremental snapshots for a disk share an incremental snapshot + * family id. The Get Page Range Diff API can only be called on incremental snapshots with the same family id. + * + * @return the incrementalSnapshotFamilyId value. + */ + public String incrementalSnapshotFamilyId() { + return this.incrementalSnapshotFamilyId; + } + + /** + * 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 SnapshotProperties object itself. + */ + public SnapshotProperties 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 SnapshotProperties object itself. + */ + public SnapshotProperties 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 SnapshotProperties object itself. + */ + public SnapshotProperties withDiskAccessId(String diskAccessId) { + this.diskAccessId = diskAccessId; + return this; + } + + /** + * Get the securityProfile property: Contains the security related information for the resource. + * + * @return the securityProfile value. + */ + public DiskSecurityProfile securityProfile() { + return this.securityProfile; + } + + /** + * Set the securityProfile property: Contains the security related information for the resource. + * + * @param securityProfile the securityProfile value to set. + * @return the SnapshotProperties object itself. + */ + public SnapshotProperties withSecurityProfile(DiskSecurityProfile securityProfile) { + this.securityProfile = securityProfile; + return this; + } + + /** + * Get the supportsHibernation property: Indicates the OS on a snapshot supports hibernation. + * + * @return the supportsHibernation value. + */ + public Boolean supportsHibernation() { + return this.supportsHibernation; + } + + /** + * Set the supportsHibernation property: Indicates the OS on a snapshot supports hibernation. + * + * @param supportsHibernation the supportsHibernation value to set. + * @return the SnapshotProperties object itself. + */ + public SnapshotProperties withSupportsHibernation(Boolean supportsHibernation) { + this.supportsHibernation = supportsHibernation; + return this; + } + + /** + * Get the publicNetworkAccess property: Policy for controlling export on the disk. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.publicNetworkAccess; + } + + /** + * Set the publicNetworkAccess property: Policy for controlling export on the disk. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the SnapshotProperties object itself. + */ + public SnapshotProperties withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + return this; + } + + /** + * Get the completionPercent property: Percentage complete for the background copy when a resource is created via + * the CopyStart operation. + * + * @return the completionPercent value. + */ + public Float completionPercent() { + return this.completionPercent; + } + + /** + * Set the completionPercent property: Percentage complete for the background copy when a resource is created via + * the CopyStart operation. + * + * @param completionPercent the completionPercent value to set. + * @return the SnapshotProperties object itself. + */ + public SnapshotProperties withCompletionPercent(Float completionPercent) { + this.completionPercent = completionPercent; + return this; + } + + /** + * Get the copyCompletionError property: Indicates the error details if the background copy of a resource created + * via the CopyStart operation fails. + * + * @return the copyCompletionError value. + */ + public CopyCompletionError copyCompletionError() { + return this.copyCompletionError; + } + + /** + * Set the copyCompletionError property: Indicates the error details if the background copy of a resource created + * via the CopyStart operation fails. + * + * @param copyCompletionError the copyCompletionError value to set. + * @return the SnapshotProperties object itself. + */ + public SnapshotProperties withCopyCompletionError(CopyCompletionError copyCompletionError) { + this.copyCompletionError = copyCompletionError; + return this; + } + + /** + * Get the dataAccessAuthMode property: Additional authentication requirements when exporting or uploading to a disk + * or snapshot. + * + * @return the dataAccessAuthMode value. + */ + public DataAccessAuthMode dataAccessAuthMode() { + return this.dataAccessAuthMode; + } + + /** + * Set the dataAccessAuthMode property: Additional authentication requirements when exporting or uploading to a disk + * or snapshot. + * + * @param dataAccessAuthMode the dataAccessAuthMode value to set. + * @return the SnapshotProperties object itself. + */ + public SnapshotProperties withDataAccessAuthMode(DataAccessAuthMode dataAccessAuthMode) { + this.dataAccessAuthMode = dataAccessAuthMode; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (purchasePlan() != null) { + purchasePlan().validate(); + } + if (supportedCapabilities() != null) { + supportedCapabilities().validate(); + } + if (creationData() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property creationData in model SnapshotProperties")); + } else { + creationData().validate(); + } + if (encryptionSettingsCollection() != null) { + encryptionSettingsCollection().validate(); + } + if (encryption() != null) { + encryption().validate(); + } + if (securityProfile() != null) { + securityProfile().validate(); + } + if (copyCompletionError() != null) { + copyCompletionError().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SnapshotProperties.class); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/SnapshotUpdateProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/SnapshotUpdateProperties.java new file mode 100644 index 0000000000000..d88a50808e7f2 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/SnapshotUpdateProperties.java @@ -0,0 +1,318 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.compute.generated.models.DataAccessAuthMode; +import com.azure.resourcemanager.compute.generated.models.Encryption; +import com.azure.resourcemanager.compute.generated.models.EncryptionSettingsCollection; +import com.azure.resourcemanager.compute.generated.models.NetworkAccessPolicy; +import com.azure.resourcemanager.compute.generated.models.OperatingSystemTypes; +import com.azure.resourcemanager.compute.generated.models.PublicNetworkAccess; +import com.azure.resourcemanager.compute.generated.models.SupportedCapabilities; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Snapshot resource update properties. */ +@Fluent +public final class SnapshotUpdateProperties { + /* + * the Operating System type. + */ + @JsonProperty(value = "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 = "diskSizeGB") + private Integer diskSizeGB; + + /* + * Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk + * or snapshot. + */ + @JsonProperty(value = "encryptionSettingsCollection") + private EncryptionSettingsCollection encryptionSettingsCollection; + + /* + * Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. + */ + @JsonProperty(value = "encryption") + private Encryption encryption; + + /* + * Policy for accessing the disk via network. + */ + @JsonProperty(value = "networkAccessPolicy") + private NetworkAccessPolicy networkAccessPolicy; + + /* + * ARM id of the DiskAccess resource for using private endpoints on disks. + */ + @JsonProperty(value = "diskAccessId") + private String diskAccessId; + + /* + * Indicates the OS on a snapshot supports hibernation. + */ + @JsonProperty(value = "supportsHibernation") + private Boolean supportsHibernation; + + /* + * Policy for controlling export on the disk. + */ + @JsonProperty(value = "publicNetworkAccess") + private PublicNetworkAccess publicNetworkAccess; + + /* + * Additional authentication requirements when exporting or uploading to a disk or snapshot. + */ + @JsonProperty(value = "dataAccessAuthMode") + private DataAccessAuthMode dataAccessAuthMode; + + /* + * List of supported capabilities for the image from which the OS disk was created. + */ + @JsonProperty(value = "supportedCapabilities") + private SupportedCapabilities supportedCapabilities; + + /** Creates an instance of SnapshotUpdateProperties class. */ + public SnapshotUpdateProperties() { + } + + /** + * 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 SnapshotUpdateProperties object itself. + */ + public SnapshotUpdateProperties 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 SnapshotUpdateProperties object itself. + */ + public SnapshotUpdateProperties 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 SnapshotUpdateProperties object itself. + */ + public SnapshotUpdateProperties 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 SnapshotUpdateProperties object itself. + */ + public SnapshotUpdateProperties 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 SnapshotUpdateProperties object itself. + */ + public SnapshotUpdateProperties 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 SnapshotUpdateProperties object itself. + */ + public SnapshotUpdateProperties withDiskAccessId(String diskAccessId) { + this.diskAccessId = diskAccessId; + return this; + } + + /** + * Get the supportsHibernation property: Indicates the OS on a snapshot supports hibernation. + * + * @return the supportsHibernation value. + */ + public Boolean supportsHibernation() { + return this.supportsHibernation; + } + + /** + * Set the supportsHibernation property: Indicates the OS on a snapshot supports hibernation. + * + * @param supportsHibernation the supportsHibernation value to set. + * @return the SnapshotUpdateProperties object itself. + */ + public SnapshotUpdateProperties withSupportsHibernation(Boolean supportsHibernation) { + this.supportsHibernation = supportsHibernation; + return this; + } + + /** + * Get the publicNetworkAccess property: Policy for controlling export on the disk. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.publicNetworkAccess; + } + + /** + * Set the publicNetworkAccess property: Policy for controlling export on the disk. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the SnapshotUpdateProperties object itself. + */ + public SnapshotUpdateProperties withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + return this; + } + + /** + * Get the dataAccessAuthMode property: Additional authentication requirements when exporting or uploading to a disk + * or snapshot. + * + * @return the dataAccessAuthMode value. + */ + public DataAccessAuthMode dataAccessAuthMode() { + return this.dataAccessAuthMode; + } + + /** + * Set the dataAccessAuthMode property: Additional authentication requirements when exporting or uploading to a disk + * or snapshot. + * + * @param dataAccessAuthMode the dataAccessAuthMode value to set. + * @return the SnapshotUpdateProperties object itself. + */ + public SnapshotUpdateProperties withDataAccessAuthMode(DataAccessAuthMode dataAccessAuthMode) { + this.dataAccessAuthMode = dataAccessAuthMode; + return this; + } + + /** + * Get the supportedCapabilities property: List of supported capabilities for the image from which the OS disk was + * created. + * + * @return the supportedCapabilities value. + */ + public SupportedCapabilities supportedCapabilities() { + return this.supportedCapabilities; + } + + /** + * Set the supportedCapabilities property: List of supported capabilities for the image from which the OS disk was + * created. + * + * @param supportedCapabilities the supportedCapabilities value to set. + * @return the SnapshotUpdateProperties object itself. + */ + public SnapshotUpdateProperties withSupportedCapabilities(SupportedCapabilities supportedCapabilities) { + this.supportedCapabilities = supportedCapabilities; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (encryptionSettingsCollection() != null) { + encryptionSettingsCollection().validate(); + } + if (encryption() != null) { + encryption().validate(); + } + if (supportedCapabilities() != null) { + supportedCapabilities().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..a11c4a7932c5e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/SshPublicKeyGenerateKeyPairResultInner.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Response from generation of an SSH key pair. */ +@Fluent +public final class SshPublicKeyGenerateKeyPairResultInner { + /* + * 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; + + /** Creates an instance of SshPublicKeyGenerateKeyPairResultInner class. */ + public SshPublicKeyGenerateKeyPairResultInner() { + } + + /** + * 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")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SshPublicKeyGenerateKeyPairResultInner.class); +} 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..8506931f3f5c0 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/SshPublicKeyResourceInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Specifies information about the SSH public key. */ +@Fluent +public final class SshPublicKeyResourceInner extends Resource { + /* + * Properties of the SSH public key. + */ + @JsonProperty(value = "properties") + private SshPublicKeyResourceProperties innerProperties; + + /** Creates an instance of SshPublicKeyResourceInner class. */ + public SshPublicKeyResourceInner() { + } + + /** + * Get the innerProperties property: Properties of the SSH public key. + * + * @return the innerProperties value. + */ + private SshPublicKeyResourceProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public SshPublicKeyResourceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public SshPublicKeyResourceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new SshPublicKeyResourceProperties(); + } + this.innerProperties().withPublicKey(publicKey); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/SshPublicKeyResourceProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/SshPublicKeyResourceProperties.java new file mode 100644 index 0000000000000..68f4c928e1b10 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/SshPublicKeyResourceProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the SSH public key. */ +@Fluent +public final class SshPublicKeyResourceProperties { + /* + * 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 = "publicKey") + private String publicKey; + + /** Creates an instance of SshPublicKeyResourceProperties class. */ + public SshPublicKeyResourceProperties() { + } + + /** + * 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 SshPublicKeyResourceProperties object itself. + */ + public SshPublicKeyResourceProperties withPublicKey(String publicKey) { + this.publicKey = publicKey; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/UpdateDomainInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/UpdateDomainInner.java new file mode 100644 index 0000000000000..8aafa18f7db7e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/UpdateDomainInner.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines an update domain for the cloud service. */ +@Immutable +public final class UpdateDomainInner { + /* + * 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; + + /** Creates an instance of UpdateDomainInner class. */ + public UpdateDomainInner() { + } + + /** + * Get the id property: Resource Id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: Resource Name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/UpgradeOperationHistoricalStatusInfoInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/UpgradeOperationHistoricalStatusInfoInner.java new file mode 100644 index 0000000000000..b6ef7134b582d --- /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.resourcemanager.compute.generated.models.UpgradeOperationHistoricalStatusInfoProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Virtual Machine Scale Set OS Upgrade History operation response. */ +@Immutable +public final class UpgradeOperationHistoricalStatusInfoInner { + /* + * 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; + + /** Creates an instance of UpgradeOperationHistoricalStatusInfoInner class. */ + public UpgradeOperationHistoricalStatusInfoInner() { + } + + /** + * 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..7f453b15d65a0 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/UsageInner.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.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.JsonProperty; + +/** Describes Compute Resource Usage. */ +@Fluent +public final class UsageInner { + /* + * An enum describing the unit of usage measurement. + */ + @JsonProperty(value = "unit", required = true) + private String unit = "Count"; + + /* + * 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(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(UsageInner.class); +} 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..3a87db2f9e209 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineAssessPatchesResultInner.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.fluent.models; + +import com.azure.core.annotation.Immutable; +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.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Describes the properties of an AssessPatches result. */ +@Immutable +public final class VirtualMachineAssessPatchesResultInner { + /* + * 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; + + /** Creates an instance of VirtualMachineAssessPatchesResultInner class. */ + public VirtualMachineAssessPatchesResultInner() { + } + + /** + * 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..43c39a1a3842e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineCaptureResultInner.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Output of virtual machine capture operation. */ +@Fluent +public final class VirtualMachineCaptureResultInner extends SubResource { + /* + * 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; + + /** Creates an instance of VirtualMachineCaptureResultInner class. */ + public VirtualMachineCaptureResultInner() { + } + + /** + * 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..2d1bbdfc92f2e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineExtensionImageInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Describes a Virtual Machine Extension Image. */ +@Fluent +public final class VirtualMachineExtensionImageInner extends Resource { + /* + * Describes the properties of a Virtual Machine Extension Image. + */ + @JsonProperty(value = "properties") + private VirtualMachineExtensionImageProperties innerProperties; + + /** Creates an instance of VirtualMachineExtensionImageInner class. */ + public VirtualMachineExtensionImageInner() { + } + + /** + * Get the innerProperties property: Describes the properties of a Virtual Machine Extension Image. + * + * @return the innerProperties value. + */ + private VirtualMachineExtensionImageProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public VirtualMachineExtensionImageInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public VirtualMachineExtensionImageInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the operatingSystem property: The operating system this extension supports. + * + * @return the operatingSystem value. + */ + public String operatingSystem() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineExtensionImageProperties(); + } + this.innerProperties().withOperatingSystem(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineExtensionImageProperties(); + } + this.innerProperties().withComputeRole(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineExtensionImageProperties(); + } + this.innerProperties().withHandlerSchema(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineExtensionImageProperties(); + } + this.innerProperties().withVmScaleSetEnabled(vmScaleSetEnabled); + return this; + } + + /** + * Get the supportsMultipleExtensions property: Whether the handler can support multiple extensions. + * + * @return the supportsMultipleExtensions value. + */ + public Boolean supportsMultipleExtensions() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineExtensionImageProperties(); + } + this.innerProperties().withSupportsMultipleExtensions(supportsMultipleExtensions); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineExtensionImageProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineExtensionImageProperties.java new file mode 100644 index 0000000000000..04dfad5d5c41d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineExtensionImageProperties.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.JsonProperty; + +/** Describes the properties of a Virtual Machine Extension Image. */ +@Fluent +public final class VirtualMachineExtensionImageProperties { + /* + * The operating system this extension supports. + */ + @JsonProperty(value = "operatingSystem", required = true) + private String operatingSystem; + + /* + * The type of role (IaaS or PaaS) this extension supports. + */ + @JsonProperty(value = "computeRole", required = true) + private String computeRole; + + /* + * The schema defined by publisher, where extension consumers should provide settings in a matching schema. + */ + @JsonProperty(value = "handlerSchema", required = true) + 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 = "vmScaleSetEnabled") + private Boolean vmScaleSetEnabled; + + /* + * Whether the handler can support multiple extensions. + */ + @JsonProperty(value = "supportsMultipleExtensions") + private Boolean supportsMultipleExtensions; + + /** Creates an instance of VirtualMachineExtensionImageProperties class. */ + public VirtualMachineExtensionImageProperties() { + } + + /** + * 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 VirtualMachineExtensionImageProperties object itself. + */ + public VirtualMachineExtensionImageProperties 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 VirtualMachineExtensionImageProperties object itself. + */ + public VirtualMachineExtensionImageProperties 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 VirtualMachineExtensionImageProperties object itself. + */ + public VirtualMachineExtensionImageProperties 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 VirtualMachineExtensionImageProperties object itself. + */ + public VirtualMachineExtensionImageProperties 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 VirtualMachineExtensionImageProperties object itself. + */ + public VirtualMachineExtensionImageProperties withSupportsMultipleExtensions(Boolean supportsMultipleExtensions) { + this.supportsMultipleExtensions = supportsMultipleExtensions; + 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 VirtualMachineExtensionImageProperties")); + } + if (computeRole() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property computeRole in model VirtualMachineExtensionImageProperties")); + } + if (handlerSchema() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property handlerSchema in model VirtualMachineExtensionImageProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VirtualMachineExtensionImageProperties.class); +} 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..e21212328e808 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineExtensionInner.java @@ -0,0 +1,367 @@ +// Copyright (c) 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.resourcemanager.compute.generated.models.KeyVaultSecretReference; +import com.azure.resourcemanager.compute.generated.models.ResourceWithOptionalLocation; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineExtensionInstanceView; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Describes a Virtual Machine Extension. */ +@Fluent +public final class VirtualMachineExtensionInner extends ResourceWithOptionalLocation { + /* + * Describes the properties of a Virtual Machine Extension. + */ + @JsonProperty(value = "properties") + private VirtualMachineExtensionProperties innerProperties; + + /** Creates an instance of VirtualMachineExtensionInner class. */ + public VirtualMachineExtensionInner() { + } + + /** + * Get the innerProperties property: Describes the properties of a Virtual Machine Extension. + * + * @return the innerProperties value. + */ + private VirtualMachineExtensionProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public VirtualMachineExtensionInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public VirtualMachineExtensionInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineExtensionProperties(); + } + this.innerProperties().withForceUpdateTag(forceUpdateTag); + return this; + } + + /** + * Get the publisher property: The name of the extension handler publisher. + * + * @return the publisher value. + */ + public String publisher() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineExtensionProperties(); + } + this.innerProperties().withPublisher(publisher); + return this; + } + + /** + * Get the type property: Specifies the type of the extension; an example is "CustomScriptExtension". + * + * @return the type value. + */ + public String typePropertiesType() { + return this.innerProperties() == null ? null : this.innerProperties().type(); + } + + /** + * Set the type property: Specifies the type of the extension; an example is "CustomScriptExtension". + * + * @param type the type value to set. + * @return the VirtualMachineExtensionInner object itself. + */ + public VirtualMachineExtensionInner withTypePropertiesType(String type) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineExtensionProperties(); + } + this.innerProperties().withType(type); + return this; + } + + /** + * Get the typeHandlerVersion property: Specifies the version of the script handler. + * + * @return the typeHandlerVersion value. + */ + public String typeHandlerVersion() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineExtensionProperties(); + } + this.innerProperties().withTypeHandlerVersion(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineExtensionProperties(); + } + this.innerProperties().withAutoUpgradeMinorVersion(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineExtensionProperties(); + } + this.innerProperties().withEnableAutomaticUpgrade(enableAutomaticUpgrade); + return this; + } + + /** + * Get the settings property: Json formatted public settings for the extension. + * + * @return the settings value. + */ + public Object settings() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineExtensionProperties(); + } + this.innerProperties().withSettings(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineExtensionProperties(); + } + this.innerProperties().withProtectedSettings(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.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the instanceView property: The virtual machine extension instance view. + * + * @return the instanceView value. + */ + public VirtualMachineExtensionInstanceView instanceView() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineExtensionProperties(); + } + this.innerProperties().withInstanceView(instanceView); + return this; + } + + /** + * Get the suppressFailures property: Indicates whether failures stemming from the extension will be suppressed + * (Operational failures such as not connecting to the VM will not be suppressed regardless of this value). The + * default is false. + * + * @return the suppressFailures value. + */ + public Boolean suppressFailures() { + return this.innerProperties() == null ? null : this.innerProperties().suppressFailures(); + } + + /** + * Set the suppressFailures property: Indicates whether failures stemming from the extension will be suppressed + * (Operational failures such as not connecting to the VM will not be suppressed regardless of this value). The + * default is false. + * + * @param suppressFailures the suppressFailures value to set. + * @return the VirtualMachineExtensionInner object itself. + */ + public VirtualMachineExtensionInner withSuppressFailures(Boolean suppressFailures) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineExtensionProperties(); + } + this.innerProperties().withSuppressFailures(suppressFailures); + return this; + } + + /** + * Get the protectedSettingsFromKeyVault property: The extensions protected settings that are passed by reference, + * and consumed from key vault. + * + * @return the protectedSettingsFromKeyVault value. + */ + public KeyVaultSecretReference protectedSettingsFromKeyVault() { + return this.innerProperties() == null ? null : this.innerProperties().protectedSettingsFromKeyVault(); + } + + /** + * Set the protectedSettingsFromKeyVault property: The extensions protected settings that are passed by reference, + * and consumed from key vault. + * + * @param protectedSettingsFromKeyVault the protectedSettingsFromKeyVault value to set. + * @return the VirtualMachineExtensionInner object itself. + */ + public VirtualMachineExtensionInner withProtectedSettingsFromKeyVault( + KeyVaultSecretReference protectedSettingsFromKeyVault) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineExtensionProperties(); + } + this.innerProperties().withProtectedSettingsFromKeyVault(protectedSettingsFromKeyVault); + return this; + } + + /** + * 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.innerProperties() == null ? null : this.innerProperties().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 VirtualMachineExtensionInner object itself. + */ + public VirtualMachineExtensionInner withProvisionAfterExtensions(List provisionAfterExtensions) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineExtensionProperties(); + } + this.innerProperties().withProvisionAfterExtensions(provisionAfterExtensions); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineExtensionProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineExtensionProperties.java new file mode 100644 index 0000000000000..61380b30d9385 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineExtensionProperties.java @@ -0,0 +1,384 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.compute.generated.models.KeyVaultSecretReference; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineExtensionInstanceView; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes the properties of a Virtual Machine Extension. */ +@Fluent +public final class VirtualMachineExtensionProperties { + /* + * How the extension handler should be forced to update even if the extension configuration has not changed. + */ + @JsonProperty(value = "forceUpdateTag") + private String forceUpdateTag; + + /* + * The name of the extension handler publisher. + */ + @JsonProperty(value = "publisher") + private String publisher; + + /* + * 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; + + /* + * 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 = "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 = "enableAutomaticUpgrade") + private Boolean enableAutomaticUpgrade; + + /* + * Json formatted public settings for the extension. + */ + @JsonProperty(value = "settings") + private Object settings; + + /* + * The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at + * all. + */ + @JsonProperty(value = "protectedSettings") + private Object protectedSettings; + + /* + * The provisioning state, which only appears in the response. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The virtual machine extension instance view. + */ + @JsonProperty(value = "instanceView") + private VirtualMachineExtensionInstanceView instanceView; + + /* + * Indicates whether failures stemming from the extension will be suppressed (Operational failures such as not + * connecting to the VM will not be suppressed regardless of this value). The default is false. + */ + @JsonProperty(value = "suppressFailures") + private Boolean suppressFailures; + + /* + * The extensions protected settings that are passed by reference, and consumed from key vault + */ + @JsonProperty(value = "protectedSettingsFromKeyVault") + private KeyVaultSecretReference protectedSettingsFromKeyVault; + + /* + * Collection of extension names after which this extension needs to be provisioned. + */ + @JsonProperty(value = "provisionAfterExtensions") + private List provisionAfterExtensions; + + /** Creates an instance of VirtualMachineExtensionProperties class. */ + public VirtualMachineExtensionProperties() { + } + + /** + * 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 VirtualMachineExtensionProperties object itself. + */ + public VirtualMachineExtensionProperties 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 VirtualMachineExtensionProperties object itself. + */ + public VirtualMachineExtensionProperties 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 VirtualMachineExtensionProperties object itself. + */ + public VirtualMachineExtensionProperties 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 VirtualMachineExtensionProperties object itself. + */ + public VirtualMachineExtensionProperties 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 VirtualMachineExtensionProperties object itself. + */ + public VirtualMachineExtensionProperties 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 VirtualMachineExtensionProperties object itself. + */ + public VirtualMachineExtensionProperties 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 VirtualMachineExtensionProperties object itself. + */ + public VirtualMachineExtensionProperties 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 VirtualMachineExtensionProperties object itself. + */ + public VirtualMachineExtensionProperties 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 VirtualMachineExtensionProperties object itself. + */ + public VirtualMachineExtensionProperties withInstanceView(VirtualMachineExtensionInstanceView instanceView) { + this.instanceView = instanceView; + return this; + } + + /** + * Get the suppressFailures property: Indicates whether failures stemming from the extension will be suppressed + * (Operational failures such as not connecting to the VM will not be suppressed regardless of this value). The + * default is false. + * + * @return the suppressFailures value. + */ + public Boolean suppressFailures() { + return this.suppressFailures; + } + + /** + * Set the suppressFailures property: Indicates whether failures stemming from the extension will be suppressed + * (Operational failures such as not connecting to the VM will not be suppressed regardless of this value). The + * default is false. + * + * @param suppressFailures the suppressFailures value to set. + * @return the VirtualMachineExtensionProperties object itself. + */ + public VirtualMachineExtensionProperties withSuppressFailures(Boolean suppressFailures) { + this.suppressFailures = suppressFailures; + return this; + } + + /** + * Get the protectedSettingsFromKeyVault property: The extensions protected settings that are passed by reference, + * and consumed from key vault. + * + * @return the protectedSettingsFromKeyVault value. + */ + public KeyVaultSecretReference protectedSettingsFromKeyVault() { + return this.protectedSettingsFromKeyVault; + } + + /** + * Set the protectedSettingsFromKeyVault property: The extensions protected settings that are passed by reference, + * and consumed from key vault. + * + * @param protectedSettingsFromKeyVault the protectedSettingsFromKeyVault value to set. + * @return the VirtualMachineExtensionProperties object itself. + */ + public VirtualMachineExtensionProperties withProtectedSettingsFromKeyVault( + KeyVaultSecretReference protectedSettingsFromKeyVault) { + this.protectedSettingsFromKeyVault = protectedSettingsFromKeyVault; + return this; + } + + /** + * 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 VirtualMachineExtensionProperties object itself. + */ + public VirtualMachineExtensionProperties withProvisionAfterExtensions(List provisionAfterExtensions) { + this.provisionAfterExtensions = provisionAfterExtensions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (instanceView() != null) { + instanceView().validate(); + } + if (protectedSettingsFromKeyVault() != null) { + protectedSettingsFromKeyVault().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineExtensionUpdateProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineExtensionUpdateProperties.java new file mode 100644 index 0000000000000..e5b3e33f6e24a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineExtensionUpdateProperties.java @@ -0,0 +1,310 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.compute.generated.models.KeyVaultSecretReference; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the properties of a Virtual Machine Extension. */ +@Fluent +public final class VirtualMachineExtensionUpdateProperties { + /* + * How the extension handler should be forced to update even if the extension configuration has not changed. + */ + @JsonProperty(value = "forceUpdateTag") + private String forceUpdateTag; + + /* + * The name of the extension handler publisher. + */ + @JsonProperty(value = "publisher") + private String publisher; + + /* + * 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; + + /* + * 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 = "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 = "enableAutomaticUpgrade") + private Boolean enableAutomaticUpgrade; + + /* + * Json formatted public settings for the extension. + */ + @JsonProperty(value = "settings") + private Object settings; + + /* + * The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at + * all. + */ + @JsonProperty(value = "protectedSettings") + private Object protectedSettings; + + /* + * Indicates whether failures stemming from the extension will be suppressed (Operational failures such as not + * connecting to the VM will not be suppressed regardless of this value). The default is false. + */ + @JsonProperty(value = "suppressFailures") + private Boolean suppressFailures; + + /* + * The extensions protected settings that are passed by reference, and consumed from key vault + */ + @JsonProperty(value = "protectedSettingsFromKeyVault") + private KeyVaultSecretReference protectedSettingsFromKeyVault; + + /** Creates an instance of VirtualMachineExtensionUpdateProperties class. */ + public VirtualMachineExtensionUpdateProperties() { + } + + /** + * 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 VirtualMachineExtensionUpdateProperties object itself. + */ + public VirtualMachineExtensionUpdateProperties 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 VirtualMachineExtensionUpdateProperties object itself. + */ + public VirtualMachineExtensionUpdateProperties 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 VirtualMachineExtensionUpdateProperties object itself. + */ + public VirtualMachineExtensionUpdateProperties 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 VirtualMachineExtensionUpdateProperties object itself. + */ + public VirtualMachineExtensionUpdateProperties 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 VirtualMachineExtensionUpdateProperties object itself. + */ + public VirtualMachineExtensionUpdateProperties 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 VirtualMachineExtensionUpdateProperties object itself. + */ + public VirtualMachineExtensionUpdateProperties 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 VirtualMachineExtensionUpdateProperties object itself. + */ + public VirtualMachineExtensionUpdateProperties 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 VirtualMachineExtensionUpdateProperties object itself. + */ + public VirtualMachineExtensionUpdateProperties withProtectedSettings(Object protectedSettings) { + this.protectedSettings = protectedSettings; + return this; + } + + /** + * Get the suppressFailures property: Indicates whether failures stemming from the extension will be suppressed + * (Operational failures such as not connecting to the VM will not be suppressed regardless of this value). The + * default is false. + * + * @return the suppressFailures value. + */ + public Boolean suppressFailures() { + return this.suppressFailures; + } + + /** + * Set the suppressFailures property: Indicates whether failures stemming from the extension will be suppressed + * (Operational failures such as not connecting to the VM will not be suppressed regardless of this value). The + * default is false. + * + * @param suppressFailures the suppressFailures value to set. + * @return the VirtualMachineExtensionUpdateProperties object itself. + */ + public VirtualMachineExtensionUpdateProperties withSuppressFailures(Boolean suppressFailures) { + this.suppressFailures = suppressFailures; + return this; + } + + /** + * Get the protectedSettingsFromKeyVault property: The extensions protected settings that are passed by reference, + * and consumed from key vault. + * + * @return the protectedSettingsFromKeyVault value. + */ + public KeyVaultSecretReference protectedSettingsFromKeyVault() { + return this.protectedSettingsFromKeyVault; + } + + /** + * Set the protectedSettingsFromKeyVault property: The extensions protected settings that are passed by reference, + * and consumed from key vault. + * + * @param protectedSettingsFromKeyVault the protectedSettingsFromKeyVault value to set. + * @return the VirtualMachineExtensionUpdateProperties object itself. + */ + public VirtualMachineExtensionUpdateProperties withProtectedSettingsFromKeyVault( + KeyVaultSecretReference protectedSettingsFromKeyVault) { + this.protectedSettingsFromKeyVault = protectedSettingsFromKeyVault; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (protectedSettingsFromKeyVault() != null) { + protectedSettingsFromKeyVault().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/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..e2aaa3eaaf855 --- /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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List Extension operation response. */ +@Fluent +public final class VirtualMachineExtensionsListResultInner { + /* + * The list of extensions + */ + @JsonProperty(value = "value") + private List value; + + /** Creates an instance of VirtualMachineExtensionsListResultInner class. */ + public VirtualMachineExtensionsListResultInner() { + } + + /** + * 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..27658c06d2a6d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineImageInner.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.compute.generated.models.ArchitectureTypes; +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.ImageDeprecationStatus; +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.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Describes a Virtual Machine Image. */ +@Fluent +public final class VirtualMachineImageInner extends VirtualMachineImageResourceInner { + /* + * Describes the properties of a Virtual Machine Image. + */ + @JsonProperty(value = "properties") + private VirtualMachineImageProperties innerProperties; + + /** Creates an instance of VirtualMachineImageInner class. */ + public VirtualMachineImageInner() { + } + + /** + * Get the innerProperties property: Describes the properties of a Virtual Machine Image. + * + * @return the innerProperties value. + */ + private VirtualMachineImageProperties innerProperties() { + return this.innerProperties; + } + + /** {@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; + } + + /** + * 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineImageProperties(); + } + this.innerProperties().withPlan(plan); + return this; + } + + /** + * Get the osDiskImage property: Contains the os disk image information. + * + * @return the osDiskImage value. + */ + public OSDiskImage osDiskImage() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineImageProperties(); + } + this.innerProperties().withOsDiskImage(osDiskImage); + return this; + } + + /** + * Get the dataDiskImages property: The dataDiskImages property. + * + * @return the dataDiskImages value. + */ + public List dataDiskImages() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineImageProperties(); + } + this.innerProperties().withDataDiskImages(dataDiskImages); + return this; + } + + /** + * Get the automaticOSUpgradeProperties property: Describes automatic OS upgrade properties on the image. + * + * @return the automaticOSUpgradeProperties value. + */ + public AutomaticOSUpgradeProperties automaticOSUpgradeProperties() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineImageProperties(); + } + this.innerProperties().withAutomaticOSUpgradeProperties(automaticOSUpgradeProperties); + return this; + } + + /** + * Get the hyperVGeneration property: Specifies the HyperVGeneration Type. + * + * @return the hyperVGeneration value. + */ + public HyperVGenerationTypes hyperVGeneration() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineImageProperties(); + } + this.innerProperties().withHyperVGeneration(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineImageProperties(); + } + this.innerProperties().withDisallowed(disallowed); + return this; + } + + /** + * Get the features property: The features property. + * + * @return the features value. + */ + public List features() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineImageProperties(); + } + this.innerProperties().withFeatures(features); + return this; + } + + /** + * Get the architecture property: Specifies the Architecture Type. + * + * @return the architecture value. + */ + public ArchitectureTypes architecture() { + return this.innerProperties() == null ? null : this.innerProperties().architecture(); + } + + /** + * Set the architecture property: Specifies the Architecture Type. + * + * @param architecture the architecture value to set. + * @return the VirtualMachineImageInner object itself. + */ + public VirtualMachineImageInner withArchitecture(ArchitectureTypes architecture) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineImageProperties(); + } + this.innerProperties().withArchitecture(architecture); + return this; + } + + /** + * Get the imageDeprecationStatus property: Describes image deprecation status properties on the image. + * + * @return the imageDeprecationStatus value. + */ + public ImageDeprecationStatus imageDeprecationStatus() { + return this.innerProperties() == null ? null : this.innerProperties().imageDeprecationStatus(); + } + + /** + * Set the imageDeprecationStatus property: Describes image deprecation status properties on the image. + * + * @param imageDeprecationStatus the imageDeprecationStatus value to set. + * @return the VirtualMachineImageInner object itself. + */ + public VirtualMachineImageInner withImageDeprecationStatus(ImageDeprecationStatus imageDeprecationStatus) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineImageProperties(); + } + this.innerProperties().withImageDeprecationStatus(imageDeprecationStatus); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineImageProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineImageProperties.java new file mode 100644 index 0000000000000..18cae7e37e805 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineImageProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.compute.generated.models.ArchitectureTypes; +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.HyperVGenerationTypes; +import com.azure.resourcemanager.compute.generated.models.ImageDeprecationStatus; +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.JsonProperty; +import java.util.List; + +/** Describes the properties of a Virtual Machine Image. */ +@Fluent +public final class VirtualMachineImageProperties { + /* + * Used for establishing the purchase context of any 3rd Party artifact through MarketPlace. + */ + @JsonProperty(value = "plan") + private PurchasePlan plan; + + /* + * Contains the os disk image information. + */ + @JsonProperty(value = "osDiskImage") + private OSDiskImage osDiskImage; + + /* + * The dataDiskImages property. + */ + @JsonProperty(value = "dataDiskImages") + private List dataDiskImages; + + /* + * Describes automatic OS upgrade properties on the image. + */ + @JsonProperty(value = "automaticOSUpgradeProperties") + private AutomaticOSUpgradeProperties automaticOSUpgradeProperties; + + /* + * Specifies the HyperVGeneration Type + */ + @JsonProperty(value = "hyperVGeneration") + private HyperVGenerationTypes hyperVGeneration; + + /* + * Specifies disallowed configuration for the VirtualMachine created from the image + */ + @JsonProperty(value = "disallowed") + private DisallowedConfiguration disallowed; + + /* + * The features property. + */ + @JsonProperty(value = "features") + private List features; + + /* + * Specifies the Architecture Type + */ + @JsonProperty(value = "architecture") + private ArchitectureTypes architecture; + + /* + * Describes image deprecation status properties on the image. + */ + @JsonProperty(value = "imageDeprecationStatus") + private ImageDeprecationStatus imageDeprecationStatus; + + /** Creates an instance of VirtualMachineImageProperties class. */ + public VirtualMachineImageProperties() { + } + + /** + * 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 VirtualMachineImageProperties object itself. + */ + public VirtualMachineImageProperties 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 VirtualMachineImageProperties object itself. + */ + public VirtualMachineImageProperties 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 VirtualMachineImageProperties object itself. + */ + public VirtualMachineImageProperties 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 VirtualMachineImageProperties object itself. + */ + public VirtualMachineImageProperties 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 VirtualMachineImageProperties object itself. + */ + public VirtualMachineImageProperties 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 VirtualMachineImageProperties object itself. + */ + public VirtualMachineImageProperties 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 VirtualMachineImageProperties object itself. + */ + public VirtualMachineImageProperties withFeatures(List features) { + this.features = features; + return this; + } + + /** + * Get the architecture property: Specifies the Architecture Type. + * + * @return the architecture value. + */ + public ArchitectureTypes architecture() { + return this.architecture; + } + + /** + * Set the architecture property: Specifies the Architecture Type. + * + * @param architecture the architecture value to set. + * @return the VirtualMachineImageProperties object itself. + */ + public VirtualMachineImageProperties withArchitecture(ArchitectureTypes architecture) { + this.architecture = architecture; + return this; + } + + /** + * Get the imageDeprecationStatus property: Describes image deprecation status properties on the image. + * + * @return the imageDeprecationStatus value. + */ + public ImageDeprecationStatus imageDeprecationStatus() { + return this.imageDeprecationStatus; + } + + /** + * Set the imageDeprecationStatus property: Describes image deprecation status properties on the image. + * + * @param imageDeprecationStatus the imageDeprecationStatus value to set. + * @return the VirtualMachineImageProperties object itself. + */ + public VirtualMachineImageProperties withImageDeprecationStatus(ImageDeprecationStatus imageDeprecationStatus) { + this.imageDeprecationStatus = imageDeprecationStatus; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void 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()); + } + if (imageDeprecationStatus() != null) { + imageDeprecationStatus().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..65baab4e2ab1d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineImageResourceInner.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.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.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Virtual machine image resource information. */ +@Fluent +public class VirtualMachineImageResourceInner extends SubResource { + /* + * 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") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /* + * The extended location of the Virtual Machine. + */ + @JsonProperty(value = "extendedLocation") + private ExtendedLocation extendedLocation; + + /** Creates an instance of VirtualMachineImageResourceInner class. */ + public VirtualMachineImageResourceInner() { + } + + /** + * 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(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VirtualMachineImageResourceInner.class); +} 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..4581e1b2842d4 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineInner.java @@ -0,0 +1,843 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.compute.generated.models.AdditionalCapabilities; +import com.azure.resourcemanager.compute.generated.models.ApplicationProfile; +import com.azure.resourcemanager.compute.generated.models.BillingProfile; +import com.azure.resourcemanager.compute.generated.models.CapacityReservationProfile; +import com.azure.resourcemanager.compute.generated.models.DiagnosticsProfile; +import com.azure.resourcemanager.compute.generated.models.ExtendedLocation; +import com.azure.resourcemanager.compute.generated.models.HardwareProfile; +import com.azure.resourcemanager.compute.generated.models.NetworkProfile; +import com.azure.resourcemanager.compute.generated.models.OSProfile; +import com.azure.resourcemanager.compute.generated.models.Plan; +import com.azure.resourcemanager.compute.generated.models.ScheduledEventsProfile; +import com.azure.resourcemanager.compute.generated.models.SecurityProfile; +import com.azure.resourcemanager.compute.generated.models.StorageProfile; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineEvictionPolicyTypes; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineIdentity; +import com.azure.resourcemanager.compute.generated.models.VirtualMachinePriorityTypes; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** Describes a Virtual Machine. */ +@Fluent +public final class VirtualMachineInner extends Resource { + /* + * 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; + + /* + * Describes the properties of a Virtual Machine. + */ + @JsonProperty(value = "properties") + private VirtualMachinePropertiesInner innerProperties; + + /* + * 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; + + /** Creates an instance of VirtualMachineInner class. */ + public VirtualMachineInner() { + } + + /** + * 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 innerProperties property: Describes the properties of a Virtual Machine. + * + * @return the innerProperties value. + */ + private VirtualMachinePropertiesInner innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** {@inheritDoc} */ + @Override + public VirtualMachineInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public VirtualMachineInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the hardwareProfile property: Specifies the hardware settings for the virtual machine. + * + * @return the hardwareProfile value. + */ + public HardwareProfile hardwareProfile() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachinePropertiesInner(); + } + this.innerProperties().withHardwareProfile(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachinePropertiesInner(); + } + this.innerProperties().withStorageProfile(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachinePropertiesInner(); + } + this.innerProperties().withAdditionalCapabilities(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachinePropertiesInner(); + } + this.innerProperties().withOsProfile(osProfile); + return this; + } + + /** + * Get the networkProfile property: Specifies the network interfaces of the virtual machine. + * + * @return the networkProfile value. + */ + public NetworkProfile networkProfile() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachinePropertiesInner(); + } + this.innerProperties().withNetworkProfile(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachinePropertiesInner(); + } + this.innerProperties().withSecurityProfile(securityProfile); + return this; + } + + /** + * Get the diagnosticsProfile property: Specifies the boot diagnostic settings state. Minimum api-version: + * 2015-06-15. + * + * @return the diagnosticsProfile value. + */ + public DiagnosticsProfile diagnosticsProfile() { + return this.innerProperties() == null ? null : this.innerProperties().diagnosticsProfile(); + } + + /** + * Set the diagnosticsProfile property: Specifies the boot diagnostic settings state. Minimum api-version: + * 2015-06-15. + * + * @param diagnosticsProfile the diagnosticsProfile value to set. + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withDiagnosticsProfile(DiagnosticsProfile diagnosticsProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachinePropertiesInner(); + } + this.innerProperties().withDiagnosticsProfile(diagnosticsProfile); + return this; + } + + /** + * Get the availabilitySet property: Specifies information about the availability set that the virtual machine + * should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes + * to maximize availability. For more information about availability sets, see [Availability sets + * overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). For more information on + * Azure planned maintenance, see [Maintenance and updates for Virtual Machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates). Currently, a VM can only be + * added to availability set at creation time. The availability set to which the VM is being added should be under + * the same resource group as the availability set resource. An existing VM cannot be added to an availability set. + * This property cannot exist along with a non-null properties.virtualMachineScaleSet reference. + * + * @return the availabilitySet value. + */ + public SubResource availabilitySet() { + return this.innerProperties() == null ? null : this.innerProperties().availabilitySet(); + } + + /** + * Set the availabilitySet property: Specifies information about the availability set that the virtual machine + * should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes + * to maximize availability. For more information about availability sets, see [Availability sets + * overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). For more information on + * Azure planned maintenance, see [Maintenance and updates for Virtual Machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates). Currently, a VM can only be + * added to availability set at creation time. The availability set to which the VM is being added should be under + * the same resource group as the availability set resource. An existing VM cannot be added to an availability set. + * This property cannot exist along with a non-null properties.virtualMachineScaleSet reference. + * + * @param availabilitySet the availabilitySet value to set. + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withAvailabilitySet(SubResource availabilitySet) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachinePropertiesInner(); + } + this.innerProperties().withAvailabilitySet(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. This property cannot exist + * along with a non-null properties.availabilitySet reference. Minimum api‐version: 2019‐03‐01. + * + * @return the virtualMachineScaleSet value. + */ + public SubResource virtualMachineScaleSet() { + return this.innerProperties() == null ? null : this.innerProperties().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. This property cannot exist + * along with a non-null properties.availabilitySet reference. Minimum api‐version: 2019‐03‐01. + * + * @param virtualMachineScaleSet the virtualMachineScaleSet value to set. + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withVirtualMachineScaleSet(SubResource virtualMachineScaleSet) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachinePropertiesInner(); + } + this.innerProperties().withVirtualMachineScaleSet(virtualMachineScaleSet); + return this; + } + + /** + * Get the proximityPlacementGroup property: Specifies information about the proximity placement group that the + * virtual machine should be assigned to. Minimum api-version: 2018-04-01. + * + * @return the proximityPlacementGroup value. + */ + public SubResource proximityPlacementGroup() { + return this.innerProperties() == null ? null : this.innerProperties().proximityPlacementGroup(); + } + + /** + * Set the proximityPlacementGroup property: Specifies information about the proximity placement group that the + * virtual machine should be assigned to. Minimum api-version: 2018-04-01. + * + * @param proximityPlacementGroup the proximityPlacementGroup value to set. + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withProximityPlacementGroup(SubResource proximityPlacementGroup) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachinePropertiesInner(); + } + this.innerProperties().withProximityPlacementGroup(proximityPlacementGroup); + return this; + } + + /** + * Get the priority property: Specifies the priority for the virtual machine. Minimum api-version: 2019-03-01. + * + * @return the priority value. + */ + public VirtualMachinePriorityTypes priority() { + return this.innerProperties() == null ? null : this.innerProperties().priority(); + } + + /** + * Set the priority property: Specifies the priority for the virtual machine. Minimum api-version: 2019-03-01. + * + * @param priority the priority value to set. + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withPriority(VirtualMachinePriorityTypes priority) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachinePropertiesInner(); + } + this.innerProperties().withPriority(priority); + return this; + } + + /** + * Get the evictionPolicy property: 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. + * + * @return the evictionPolicy value. + */ + public VirtualMachineEvictionPolicyTypes evictionPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().evictionPolicy(); + } + + /** + * Set the evictionPolicy property: 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. + * + * @param evictionPolicy the evictionPolicy value to set. + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withEvictionPolicy(VirtualMachineEvictionPolicyTypes evictionPolicy) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachinePropertiesInner(); + } + this.innerProperties().withEvictionPolicy(evictionPolicy); + return this; + } + + /** + * Get the billingProfile property: Specifies the billing related details of a Azure Spot virtual machine. Minimum + * api-version: 2019-03-01. + * + * @return the billingProfile value. + */ + public BillingProfile billingProfile() { + return this.innerProperties() == null ? null : this.innerProperties().billingProfile(); + } + + /** + * Set the billingProfile property: Specifies the billing related details of a Azure Spot virtual machine. Minimum + * api-version: 2019-03-01. + * + * @param billingProfile the billingProfile value to set. + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withBillingProfile(BillingProfile billingProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachinePropertiesInner(); + } + this.innerProperties().withBillingProfile(billingProfile); + return this; + } + + /** + * Get the host property: Specifies information about the dedicated host that the virtual machine resides in. + * Minimum api-version: 2018-10-01. + * + * @return the host value. + */ + public SubResource host() { + return this.innerProperties() == null ? null : this.innerProperties().host(); + } + + /** + * Set the host property: Specifies information about the dedicated host that the virtual machine resides in. + * Minimum api-version: 2018-10-01. + * + * @param host the host value to set. + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withHost(SubResource host) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachinePropertiesInner(); + } + this.innerProperties().withHost(host); + return this; + } + + /** + * Get the hostGroup property: Specifies information about the dedicated host group that the virtual machine resides + * in. **Note:** User cannot specify both host and hostGroup properties. Minimum api-version: 2020-06-01. + * + * @return the hostGroup value. + */ + public SubResource hostGroup() { + return this.innerProperties() == null ? null : this.innerProperties().hostGroup(); + } + + /** + * Set the hostGroup property: Specifies information about the dedicated host group that the virtual machine resides + * in. **Note:** User cannot specify both host and hostGroup properties. Minimum api-version: 2020-06-01. + * + * @param hostGroup the hostGroup value to set. + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withHostGroup(SubResource hostGroup) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachinePropertiesInner(); + } + this.innerProperties().withHostGroup(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.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the instanceView property: The virtual machine instance view. + * + * @return the instanceView value. + */ + public VirtualMachineInstanceViewInner instanceView() { + return this.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachinePropertiesInner(); + } + this.innerProperties().withLicenseType(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.innerProperties() == null ? null : this.innerProperties().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). Minimum api-version: 2020-06-01. + * + * @return the extensionsTimeBudget value. + */ + public String extensionsTimeBudget() { + return this.innerProperties() == null ? null : this.innerProperties().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). Minimum api-version: 2020-06-01. + * + * @param extensionsTimeBudget the extensionsTimeBudget value to set. + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withExtensionsTimeBudget(String extensionsTimeBudget) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachinePropertiesInner(); + } + this.innerProperties().withExtensionsTimeBudget(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. 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' greater than 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. + * + * @return the platformFaultDomain value. + */ + public Integer platformFaultDomain() { + return this.innerProperties() == null ? null : this.innerProperties().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. 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' greater than 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. + * + * @param platformFaultDomain the platformFaultDomain value to set. + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withPlatformFaultDomain(Integer platformFaultDomain) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachinePropertiesInner(); + } + this.innerProperties().withPlatformFaultDomain(platformFaultDomain); + return this; + } + + /** + * Get the scheduledEventsProfile property: Specifies Scheduled Event related configurations. + * + * @return the scheduledEventsProfile value. + */ + public ScheduledEventsProfile scheduledEventsProfile() { + return this.innerProperties() == null ? null : this.innerProperties().scheduledEventsProfile(); + } + + /** + * Set the scheduledEventsProfile property: Specifies Scheduled Event related configurations. + * + * @param scheduledEventsProfile the scheduledEventsProfile value to set. + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withScheduledEventsProfile(ScheduledEventsProfile scheduledEventsProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachinePropertiesInner(); + } + this.innerProperties().withScheduledEventsProfile(scheduledEventsProfile); + return this; + } + + /** + * Get the userData property: UserData for the VM, which must be base-64 encoded. Customer should not pass any + * secrets in here. Minimum api-version: 2021-03-01. + * + * @return the userData value. + */ + public String userData() { + return this.innerProperties() == null ? null : this.innerProperties().userData(); + } + + /** + * Set the userData property: UserData for the VM, which must be base-64 encoded. Customer should not pass any + * secrets in here. Minimum api-version: 2021-03-01. + * + * @param userData the userData value to set. + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withUserData(String userData) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachinePropertiesInner(); + } + this.innerProperties().withUserData(userData); + return this; + } + + /** + * Get the capacityReservation property: Specifies information about the capacity reservation that is used to + * allocate virtual machine. Minimum api-version: 2021-04-01. + * + * @return the capacityReservation value. + */ + public CapacityReservationProfile capacityReservation() { + return this.innerProperties() == null ? null : this.innerProperties().capacityReservation(); + } + + /** + * Set the capacityReservation property: Specifies information about the capacity reservation that is used to + * allocate virtual machine. Minimum api-version: 2021-04-01. + * + * @param capacityReservation the capacityReservation value to set. + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withCapacityReservation(CapacityReservationProfile capacityReservation) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachinePropertiesInner(); + } + this.innerProperties().withCapacityReservation(capacityReservation); + return this; + } + + /** + * Get the applicationProfile property: Specifies the gallery applications that should be made available to the + * VM/VMSS. + * + * @return the applicationProfile value. + */ + public ApplicationProfile applicationProfile() { + return this.innerProperties() == null ? null : this.innerProperties().applicationProfile(); + } + + /** + * Set the applicationProfile property: Specifies the gallery applications that should be made available to the + * VM/VMSS. + * + * @param applicationProfile the applicationProfile value to set. + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withApplicationProfile(ApplicationProfile applicationProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachinePropertiesInner(); + } + this.innerProperties().withApplicationProfile(applicationProfile); + return this; + } + + /** + * Get the timeCreated property: Specifies the time at which the Virtual Machine resource was created. Minimum + * api-version: 2021-11-01. + * + * @return the timeCreated value. + */ + public OffsetDateTime timeCreated() { + return this.innerProperties() == null ? null : this.innerProperties().timeCreated(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (plan() != null) { + plan().validate(); + } + if (innerProperties() != null) { + innerProperties().validate(); + } + if (resources() != null) { + resources().forEach(e -> e.validate()); + } + if (identity() != null) { + identity().validate(); + } + if (extendedLocation() != null) { + extendedLocation().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..2e8f77b842e42 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineInstallPatchesResultInner.java @@ -0,0 +1,228 @@ +// Copyright (c) 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.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.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** The result summary of an installation operation. */ +@Immutable +public final class VirtualMachineInstallPatchesResultInner { + /* + * 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; + + /** Creates an instance of VirtualMachineInstallPatchesResultInner class. */ + public VirtualMachineInstallPatchesResultInner() { + } + + /** + * 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..797d231c72504 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineInstanceViewInner.java @@ -0,0 +1,463 @@ +// Copyright (c) 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.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.JsonProperty; +import java.util.List; + +/** The instance view of a virtual machine. */ +@Fluent +public final class VirtualMachineInstanceViewInner { + /* + * 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; + + /** Creates an instance of VirtualMachineInstanceViewInner class. */ + public VirtualMachineInstanceViewInner() { + } + + /** + * 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. You can easily view the output of your console log. 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. You can easily view the output of your console log. 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. 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/VirtualMachineNetworkInterfaceConfigurationProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineNetworkInterfaceConfigurationProperties.java new file mode 100644 index 0000000000000..3e89fe0de8693 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineNetworkInterfaceConfigurationProperties.java @@ -0,0 +1,316 @@ +// Copyright (c) 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.DeleteOptions; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineNetworkInterfaceDnsSettingsConfiguration; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineNetworkInterfaceIpConfiguration; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a virtual machine network profile's IP configuration. */ +@Fluent +public final class VirtualMachineNetworkInterfaceConfigurationProperties { + /* + * Specifies the primary network interface in case the virtual machine has more than 1 network interface. + */ + @JsonProperty(value = "primary") + private Boolean primary; + + /* + * Specify what happens to the network interface when the VM is deleted + */ + @JsonProperty(value = "deleteOption") + private DeleteOptions deleteOption; + + /* + * Specifies whether the network interface is accelerated networking-enabled. + */ + @JsonProperty(value = "enableAcceleratedNetworking") + private Boolean enableAcceleratedNetworking; + + /* + * Specifies whether the network interface is disabled for tcp state tracking. + */ + @JsonProperty(value = "disableTcpStateTracking") + private Boolean disableTcpStateTracking; + + /* + * Specifies whether the network interface is FPGA networking-enabled. + */ + @JsonProperty(value = "enableFpga") + private Boolean enableFpga; + + /* + * Whether IP forwarding enabled on this NIC. + */ + @JsonProperty(value = "enableIPForwarding") + private Boolean enableIpForwarding; + + /* + * The network security group. + */ + @JsonProperty(value = "networkSecurityGroup") + private SubResource networkSecurityGroup; + + /* + * The dns settings to be applied on the network interfaces. + */ + @JsonProperty(value = "dnsSettings") + private VirtualMachineNetworkInterfaceDnsSettingsConfiguration dnsSettings; + + /* + * Specifies the IP configurations of the network interface. + */ + @JsonProperty(value = "ipConfigurations", required = true) + private List ipConfigurations; + + /* + * The dscpConfiguration property. + */ + @JsonProperty(value = "dscpConfiguration") + private SubResource dscpConfiguration; + + /** Creates an instance of VirtualMachineNetworkInterfaceConfigurationProperties class. */ + public VirtualMachineNetworkInterfaceConfigurationProperties() { + } + + /** + * 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 VirtualMachineNetworkInterfaceConfigurationProperties object itself. + */ + public VirtualMachineNetworkInterfaceConfigurationProperties withPrimary(Boolean primary) { + this.primary = primary; + return this; + } + + /** + * Get the deleteOption property: Specify what happens to the network interface when the VM is deleted. + * + * @return the deleteOption value. + */ + public DeleteOptions deleteOption() { + return this.deleteOption; + } + + /** + * Set the deleteOption property: Specify what happens to the network interface when the VM is deleted. + * + * @param deleteOption the deleteOption value to set. + * @return the VirtualMachineNetworkInterfaceConfigurationProperties object itself. + */ + public VirtualMachineNetworkInterfaceConfigurationProperties withDeleteOption(DeleteOptions deleteOption) { + this.deleteOption = deleteOption; + return this; + } + + /** + * Get the enableAcceleratedNetworking property: Specifies whether the network interface is accelerated + * networking-enabled. + * + * @return the enableAcceleratedNetworking value. + */ + public Boolean enableAcceleratedNetworking() { + return this.enableAcceleratedNetworking; + } + + /** + * Set the enableAcceleratedNetworking property: Specifies whether the network interface is accelerated + * networking-enabled. + * + * @param enableAcceleratedNetworking the enableAcceleratedNetworking value to set. + * @return the VirtualMachineNetworkInterfaceConfigurationProperties object itself. + */ + public VirtualMachineNetworkInterfaceConfigurationProperties withEnableAcceleratedNetworking( + Boolean enableAcceleratedNetworking) { + this.enableAcceleratedNetworking = enableAcceleratedNetworking; + return this; + } + + /** + * Get the disableTcpStateTracking property: Specifies whether the network interface is disabled for tcp state + * tracking. + * + * @return the disableTcpStateTracking value. + */ + public Boolean disableTcpStateTracking() { + return this.disableTcpStateTracking; + } + + /** + * Set the disableTcpStateTracking property: Specifies whether the network interface is disabled for tcp state + * tracking. + * + * @param disableTcpStateTracking the disableTcpStateTracking value to set. + * @return the VirtualMachineNetworkInterfaceConfigurationProperties object itself. + */ + public VirtualMachineNetworkInterfaceConfigurationProperties withDisableTcpStateTracking( + Boolean disableTcpStateTracking) { + this.disableTcpStateTracking = disableTcpStateTracking; + 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 VirtualMachineNetworkInterfaceConfigurationProperties object itself. + */ + public VirtualMachineNetworkInterfaceConfigurationProperties withEnableFpga(Boolean enableFpga) { + this.enableFpga = enableFpga; + return this; + } + + /** + * Get the enableIpForwarding property: Whether IP forwarding enabled on this NIC. + * + * @return the enableIpForwarding value. + */ + public Boolean enableIpForwarding() { + return this.enableIpForwarding; + } + + /** + * Set the enableIpForwarding property: Whether IP forwarding enabled on this NIC. + * + * @param enableIpForwarding the enableIpForwarding value to set. + * @return the VirtualMachineNetworkInterfaceConfigurationProperties object itself. + */ + public VirtualMachineNetworkInterfaceConfigurationProperties withEnableIpForwarding(Boolean enableIpForwarding) { + this.enableIpForwarding = enableIpForwarding; + return this; + } + + /** + * Get the networkSecurityGroup property: The network security group. + * + * @return the networkSecurityGroup value. + */ + public SubResource networkSecurityGroup() { + return this.networkSecurityGroup; + } + + /** + * Set the networkSecurityGroup property: The network security group. + * + * @param networkSecurityGroup the networkSecurityGroup value to set. + * @return the VirtualMachineNetworkInterfaceConfigurationProperties object itself. + */ + public VirtualMachineNetworkInterfaceConfigurationProperties withNetworkSecurityGroup( + SubResource networkSecurityGroup) { + this.networkSecurityGroup = networkSecurityGroup; + return this; + } + + /** + * Get the dnsSettings property: The dns settings to be applied on the network interfaces. + * + * @return the dnsSettings value. + */ + public VirtualMachineNetworkInterfaceDnsSettingsConfiguration dnsSettings() { + return this.dnsSettings; + } + + /** + * Set the dnsSettings property: The dns settings to be applied on the network interfaces. + * + * @param dnsSettings the dnsSettings value to set. + * @return the VirtualMachineNetworkInterfaceConfigurationProperties object itself. + */ + public VirtualMachineNetworkInterfaceConfigurationProperties withDnsSettings( + VirtualMachineNetworkInterfaceDnsSettingsConfiguration dnsSettings) { + this.dnsSettings = dnsSettings; + return this; + } + + /** + * Get the ipConfigurations property: Specifies the IP configurations of the network interface. + * + * @return the ipConfigurations value. + */ + public List ipConfigurations() { + return this.ipConfigurations; + } + + /** + * Set the ipConfigurations property: Specifies the IP configurations of the network interface. + * + * @param ipConfigurations the ipConfigurations value to set. + * @return the VirtualMachineNetworkInterfaceConfigurationProperties object itself. + */ + public VirtualMachineNetworkInterfaceConfigurationProperties withIpConfigurations( + List ipConfigurations) { + this.ipConfigurations = ipConfigurations; + return this; + } + + /** + * Get the dscpConfiguration property: The dscpConfiguration property. + * + * @return the dscpConfiguration value. + */ + public SubResource dscpConfiguration() { + return this.dscpConfiguration; + } + + /** + * Set the dscpConfiguration property: The dscpConfiguration property. + * + * @param dscpConfiguration the dscpConfiguration value to set. + * @return the VirtualMachineNetworkInterfaceConfigurationProperties object itself. + */ + public VirtualMachineNetworkInterfaceConfigurationProperties withDscpConfiguration(SubResource dscpConfiguration) { + this.dscpConfiguration = dscpConfiguration; + 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) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property ipConfigurations in model" + + " VirtualMachineNetworkInterfaceConfigurationProperties")); + } else { + ipConfigurations().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = + new ClientLogger(VirtualMachineNetworkInterfaceConfigurationProperties.class); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineNetworkInterfaceIpConfigurationProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineNetworkInterfaceIpConfigurationProperties.java new file mode 100644 index 0000000000000..40d28763e93c5 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineNetworkInterfaceIpConfigurationProperties.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.Fluent; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.compute.generated.models.IpVersions; +import com.azure.resourcemanager.compute.generated.models.VirtualMachinePublicIpAddressConfiguration; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a virtual machine network interface IP configuration properties. */ +@Fluent +public final class VirtualMachineNetworkInterfaceIpConfigurationProperties { + /* + * Specifies the identifier of the subnet. + */ + @JsonProperty(value = "subnet") + private SubResource subnet; + + /* + * Specifies the primary network interface in case the virtual machine has more than 1 network interface. + */ + @JsonProperty(value = "primary") + private Boolean primary; + + /* + * The publicIPAddressConfiguration. + */ + @JsonProperty(value = "publicIPAddressConfiguration") + private VirtualMachinePublicIpAddressConfiguration publicIpAddressConfiguration; + + /* + * Available from Api-Version 2017-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or + * IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. + */ + @JsonProperty(value = "privateIPAddressVersion") + private IpVersions privateIpAddressVersion; + + /* + * Specifies an array of references to application security group. + */ + @JsonProperty(value = "applicationSecurityGroups") + private List applicationSecurityGroups; + + /* + * Specifies an array of references to backend address pools of application gateways. A virtual machine can + * reference backend address pools of multiple application gateways. Multiple virtual machines cannot use the same + * application gateway. + */ + @JsonProperty(value = "applicationGatewayBackendAddressPools") + private List applicationGatewayBackendAddressPools; + + /* + * Specifies an array of references to backend address pools of load balancers. A virtual machine can reference + * backend address pools of one public and one internal load balancer. [Multiple virtual machines cannot use the + * same basic sku load balancer]. + */ + @JsonProperty(value = "loadBalancerBackendAddressPools") + private List loadBalancerBackendAddressPools; + + /** Creates an instance of VirtualMachineNetworkInterfaceIpConfigurationProperties class. */ + public VirtualMachineNetworkInterfaceIpConfigurationProperties() { + } + + /** + * Get the subnet property: Specifies the identifier of the subnet. + * + * @return the subnet value. + */ + public SubResource subnet() { + return this.subnet; + } + + /** + * Set the subnet property: Specifies the identifier of the subnet. + * + * @param subnet the subnet value to set. + * @return the VirtualMachineNetworkInterfaceIpConfigurationProperties object itself. + */ + public VirtualMachineNetworkInterfaceIpConfigurationProperties withSubnet(SubResource subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get the primary property: Specifies the primary network interface in case the virtual machine has more than 1 + * network interface. + * + * @return the primary value. + */ + public Boolean primary() { + return this.primary; + } + + /** + * Set the primary property: Specifies the primary network interface in case the virtual machine has more than 1 + * network interface. + * + * @param primary the primary value to set. + * @return the VirtualMachineNetworkInterfaceIpConfigurationProperties object itself. + */ + public VirtualMachineNetworkInterfaceIpConfigurationProperties withPrimary(Boolean primary) { + this.primary = primary; + return this; + } + + /** + * Get the publicIpAddressConfiguration property: The publicIPAddressConfiguration. + * + * @return the publicIpAddressConfiguration value. + */ + public VirtualMachinePublicIpAddressConfiguration publicIpAddressConfiguration() { + return this.publicIpAddressConfiguration; + } + + /** + * Set the publicIpAddressConfiguration property: The publicIPAddressConfiguration. + * + * @param publicIpAddressConfiguration the publicIpAddressConfiguration value to set. + * @return the VirtualMachineNetworkInterfaceIpConfigurationProperties object itself. + */ + public VirtualMachineNetworkInterfaceIpConfigurationProperties withPublicIpAddressConfiguration( + VirtualMachinePublicIpAddressConfiguration publicIpAddressConfiguration) { + this.publicIpAddressConfiguration = publicIpAddressConfiguration; + return this; + } + + /** + * Get the privateIpAddressVersion property: Available from Api-Version 2017-03-30 onwards, it represents whether + * the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. + * + * @return the privateIpAddressVersion value. + */ + public IpVersions privateIpAddressVersion() { + return this.privateIpAddressVersion; + } + + /** + * Set the privateIpAddressVersion property: Available from Api-Version 2017-03-30 onwards, it represents whether + * the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. + * + * @param privateIpAddressVersion the privateIpAddressVersion value to set. + * @return the VirtualMachineNetworkInterfaceIpConfigurationProperties object itself. + */ + public VirtualMachineNetworkInterfaceIpConfigurationProperties withPrivateIpAddressVersion( + IpVersions privateIpAddressVersion) { + this.privateIpAddressVersion = privateIpAddressVersion; + return this; + } + + /** + * Get the applicationSecurityGroups property: Specifies an array of references to application security group. + * + * @return the applicationSecurityGroups value. + */ + public List applicationSecurityGroups() { + return this.applicationSecurityGroups; + } + + /** + * Set the applicationSecurityGroups property: Specifies an array of references to application security group. + * + * @param applicationSecurityGroups the applicationSecurityGroups value to set. + * @return the VirtualMachineNetworkInterfaceIpConfigurationProperties object itself. + */ + public VirtualMachineNetworkInterfaceIpConfigurationProperties withApplicationSecurityGroups( + List applicationSecurityGroups) { + this.applicationSecurityGroups = applicationSecurityGroups; + return this; + } + + /** + * Get the applicationGatewayBackendAddressPools property: Specifies an array of references to backend address pools + * of application gateways. A virtual machine can reference backend address pools of multiple application gateways. + * Multiple virtual machines cannot use the same application gateway. + * + * @return the applicationGatewayBackendAddressPools value. + */ + public List applicationGatewayBackendAddressPools() { + return this.applicationGatewayBackendAddressPools; + } + + /** + * Set the applicationGatewayBackendAddressPools property: Specifies an array of references to backend address pools + * of application gateways. A virtual machine can reference backend address pools of multiple application gateways. + * Multiple virtual machines cannot use the same application gateway. + * + * @param applicationGatewayBackendAddressPools the applicationGatewayBackendAddressPools value to set. + * @return the VirtualMachineNetworkInterfaceIpConfigurationProperties object itself. + */ + public VirtualMachineNetworkInterfaceIpConfigurationProperties withApplicationGatewayBackendAddressPools( + List applicationGatewayBackendAddressPools) { + this.applicationGatewayBackendAddressPools = applicationGatewayBackendAddressPools; + return this; + } + + /** + * Get the loadBalancerBackendAddressPools property: Specifies an array of references to backend address pools of + * load balancers. A virtual machine can reference backend address pools of one public and one internal load + * balancer. [Multiple virtual machines cannot use the same basic sku load balancer]. + * + * @return the loadBalancerBackendAddressPools value. + */ + public List loadBalancerBackendAddressPools() { + return this.loadBalancerBackendAddressPools; + } + + /** + * Set the loadBalancerBackendAddressPools property: Specifies an array of references to backend address pools of + * load balancers. A virtual machine can reference backend address pools of one public and one internal load + * balancer. [Multiple virtual machines cannot use the same basic sku load balancer]. + * + * @param loadBalancerBackendAddressPools the loadBalancerBackendAddressPools value to set. + * @return the VirtualMachineNetworkInterfaceIpConfigurationProperties object itself. + */ + public VirtualMachineNetworkInterfaceIpConfigurationProperties withLoadBalancerBackendAddressPools( + List loadBalancerBackendAddressPools) { + this.loadBalancerBackendAddressPools = loadBalancerBackendAddressPools; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (publicIpAddressConfiguration() != null) { + publicIpAddressConfiguration().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachinePropertiesInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachinePropertiesInner.java new file mode 100644 index 0000000000000..bf1038f339175 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachinePropertiesInner.java @@ -0,0 +1,825 @@ +// Copyright (c) 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.resourcemanager.compute.generated.models.AdditionalCapabilities; +import com.azure.resourcemanager.compute.generated.models.ApplicationProfile; +import com.azure.resourcemanager.compute.generated.models.BillingProfile; +import com.azure.resourcemanager.compute.generated.models.CapacityReservationProfile; +import com.azure.resourcemanager.compute.generated.models.DiagnosticsProfile; +import com.azure.resourcemanager.compute.generated.models.HardwareProfile; +import com.azure.resourcemanager.compute.generated.models.NetworkProfile; +import com.azure.resourcemanager.compute.generated.models.OSProfile; +import com.azure.resourcemanager.compute.generated.models.ScheduledEventsProfile; +import com.azure.resourcemanager.compute.generated.models.SecurityProfile; +import com.azure.resourcemanager.compute.generated.models.StorageProfile; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineEvictionPolicyTypes; +import com.azure.resourcemanager.compute.generated.models.VirtualMachinePriorityTypes; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Describes the properties of a Virtual Machine. */ +@Fluent +public final class VirtualMachinePropertiesInner { + /* + * Specifies the hardware settings for the virtual machine. + */ + @JsonProperty(value = "hardwareProfile") + private HardwareProfile hardwareProfile; + + /* + * Specifies the storage settings for the virtual machine disks. + */ + @JsonProperty(value = "storageProfile") + private StorageProfile storageProfile; + + /* + * Specifies additional capabilities enabled or disabled on the virtual machine. + */ + @JsonProperty(value = "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 = "osProfile") + private OSProfile osProfile; + + /* + * Specifies the network interfaces of the virtual machine. + */ + @JsonProperty(value = "networkProfile") + private NetworkProfile networkProfile; + + /* + * Specifies the Security related profile settings for the virtual machine. + */ + @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 information about the availability set that the virtual machine should be assigned to. Virtual + * machines specified in the same availability set are allocated to different nodes to maximize availability. For + * more information about availability sets, see [Availability sets + * overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). For more information on + * Azure planned maintenance, see [Maintenance and updates for Virtual Machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates). Currently, a VM can only be + * added to availability set at creation time. The availability set to which the VM is being added should be under + * the same resource group as the availability set resource. An existing VM cannot be added to an availability set. + * This property cannot exist along with a non-null properties.virtualMachineScaleSet reference. + */ + @JsonProperty(value = "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 = "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 = "proximityPlacementGroup") + private SubResource proximityPlacementGroup; + + /* + * Specifies the priority for the virtual machine. Minimum api-version: 2019-03-01 + */ + @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 virtual machine. Minimum api-version: 2019-03-01. + */ + @JsonProperty(value = "billingProfile") + private BillingProfile billingProfile; + + /* + * Specifies information about the dedicated host that the virtual machine resides in. Minimum api-version: + * 2018-10-01. + */ + @JsonProperty(value = "host") + private SubResource host; + + /* + * Specifies information about the dedicated host group that the virtual machine resides in. **Note:** User cannot + * specify both host and hostGroup properties. Minimum api-version: 2020-06-01. + */ + @JsonProperty(value = "hostGroup") + private SubResource hostGroup; + + /* + * The provisioning state, which only appears in the response. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The virtual machine instance view. + */ + @JsonProperty(value = "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 = "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 = "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 = "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' greater than 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 = "platformFaultDomain") + private Integer platformFaultDomain; + + /* + * Specifies Scheduled Event related configurations. + */ + @JsonProperty(value = "scheduledEventsProfile") + private ScheduledEventsProfile scheduledEventsProfile; + + /* + * UserData for the VM, which must be base-64 encoded. Customer should not pass any secrets in here. Minimum + * api-version: 2021-03-01. + */ + @JsonProperty(value = "userData") + private String userData; + + /* + * Specifies information about the capacity reservation that is used to allocate virtual machine. Minimum + * api-version: 2021-04-01. + */ + @JsonProperty(value = "capacityReservation") + private CapacityReservationProfile capacityReservation; + + /* + * Specifies the gallery applications that should be made available to the VM/VMSS. + */ + @JsonProperty(value = "applicationProfile") + private ApplicationProfile applicationProfile; + + /* + * Specifies the time at which the Virtual Machine resource was created. Minimum api-version: 2021-11-01. + */ + @JsonProperty(value = "timeCreated", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime timeCreated; + + /** Creates an instance of VirtualMachinePropertiesInner class. */ + public VirtualMachinePropertiesInner() { + } + + /** + * 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 VirtualMachinePropertiesInner object itself. + */ + public VirtualMachinePropertiesInner 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 VirtualMachinePropertiesInner object itself. + */ + public VirtualMachinePropertiesInner 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 VirtualMachinePropertiesInner object itself. + */ + public VirtualMachinePropertiesInner 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 VirtualMachinePropertiesInner object itself. + */ + public VirtualMachinePropertiesInner 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 VirtualMachinePropertiesInner object itself. + */ + public VirtualMachinePropertiesInner 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 VirtualMachinePropertiesInner object itself. + */ + public VirtualMachinePropertiesInner withSecurityProfile(SecurityProfile securityProfile) { + this.securityProfile = securityProfile; + return this; + } + + /** + * Get the diagnosticsProfile property: Specifies the boot diagnostic settings state. 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. Minimum api-version: + * 2015-06-15. + * + * @param diagnosticsProfile the diagnosticsProfile value to set. + * @return the VirtualMachinePropertiesInner object itself. + */ + public VirtualMachinePropertiesInner withDiagnosticsProfile(DiagnosticsProfile diagnosticsProfile) { + this.diagnosticsProfile = diagnosticsProfile; + return this; + } + + /** + * Get the availabilitySet property: Specifies information about the availability set that the virtual machine + * should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes + * to maximize availability. For more information about availability sets, see [Availability sets + * overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). For more information on + * Azure planned maintenance, see [Maintenance and updates for Virtual Machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates). Currently, a VM can only be + * added to availability set at creation time. The availability set to which the VM is being added should be under + * the same resource group as the availability set resource. An existing VM cannot be added to an availability set. + * This property cannot exist along with a non-null properties.virtualMachineScaleSet reference. + * + * @return the availabilitySet value. + */ + public SubResource availabilitySet() { + return this.availabilitySet; + } + + /** + * Set the availabilitySet property: Specifies information about the availability set that the virtual machine + * should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes + * to maximize availability. For more information about availability sets, see [Availability sets + * overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). For more information on + * Azure planned maintenance, see [Maintenance and updates for Virtual Machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates). Currently, a VM can only be + * added to availability set at creation time. The availability set to which the VM is being added should be under + * the same resource group as the availability set resource. An existing VM cannot be added to an availability set. + * This property cannot exist along with a non-null properties.virtualMachineScaleSet reference. + * + * @param availabilitySet the availabilitySet value to set. + * @return the VirtualMachinePropertiesInner object itself. + */ + public VirtualMachinePropertiesInner 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. This property cannot exist + * along with a non-null properties.availabilitySet reference. 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. This property cannot exist + * along with a non-null properties.availabilitySet reference. Minimum api‐version: 2019‐03‐01. + * + * @param virtualMachineScaleSet the virtualMachineScaleSet value to set. + * @return the VirtualMachinePropertiesInner object itself. + */ + public VirtualMachinePropertiesInner 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. 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. Minimum api-version: 2018-04-01. + * + * @param proximityPlacementGroup the proximityPlacementGroup value to set. + * @return the VirtualMachinePropertiesInner object itself. + */ + public VirtualMachinePropertiesInner withProximityPlacementGroup(SubResource proximityPlacementGroup) { + this.proximityPlacementGroup = proximityPlacementGroup; + return this; + } + + /** + * Get the priority property: Specifies the priority for the virtual machine. 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. Minimum api-version: 2019-03-01. + * + * @param priority the priority value to set. + * @return the VirtualMachinePropertiesInner object itself. + */ + public VirtualMachinePropertiesInner 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. 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. + * + * @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. 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. + * + * @param evictionPolicy the evictionPolicy value to set. + * @return the VirtualMachinePropertiesInner object itself. + */ + public VirtualMachinePropertiesInner withEvictionPolicy(VirtualMachineEvictionPolicyTypes evictionPolicy) { + this.evictionPolicy = evictionPolicy; + return this; + } + + /** + * Get the billingProfile property: Specifies the billing related details of a Azure Spot virtual machine. 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. Minimum + * api-version: 2019-03-01. + * + * @param billingProfile the billingProfile value to set. + * @return the VirtualMachinePropertiesInner object itself. + */ + public VirtualMachinePropertiesInner withBillingProfile(BillingProfile billingProfile) { + this.billingProfile = billingProfile; + return this; + } + + /** + * Get the host property: Specifies information about the dedicated host that the virtual machine resides in. + * 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. + * Minimum api-version: 2018-10-01. + * + * @param host the host value to set. + * @return the VirtualMachinePropertiesInner object itself. + */ + public VirtualMachinePropertiesInner 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. **Note:** User cannot specify both host and hostGroup properties. 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 resides + * in. **Note:** User cannot specify both host and hostGroup properties. Minimum api-version: 2020-06-01. + * + * @param hostGroup the hostGroup value to set. + * @return the VirtualMachinePropertiesInner object itself. + */ + public VirtualMachinePropertiesInner 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 VirtualMachinePropertiesInner object itself. + */ + public VirtualMachinePropertiesInner 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). 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). Minimum api-version: 2020-06-01. + * + * @param extensionsTimeBudget the extensionsTimeBudget value to set. + * @return the VirtualMachinePropertiesInner object itself. + */ + public VirtualMachinePropertiesInner 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. 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' greater than 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. + * + * @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. 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' greater than 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. + * + * @param platformFaultDomain the platformFaultDomain value to set. + * @return the VirtualMachinePropertiesInner object itself. + */ + public VirtualMachinePropertiesInner withPlatformFaultDomain(Integer platformFaultDomain) { + this.platformFaultDomain = platformFaultDomain; + return this; + } + + /** + * Get the scheduledEventsProfile property: Specifies Scheduled Event related configurations. + * + * @return the scheduledEventsProfile value. + */ + public ScheduledEventsProfile scheduledEventsProfile() { + return this.scheduledEventsProfile; + } + + /** + * Set the scheduledEventsProfile property: Specifies Scheduled Event related configurations. + * + * @param scheduledEventsProfile the scheduledEventsProfile value to set. + * @return the VirtualMachinePropertiesInner object itself. + */ + public VirtualMachinePropertiesInner withScheduledEventsProfile(ScheduledEventsProfile scheduledEventsProfile) { + this.scheduledEventsProfile = scheduledEventsProfile; + return this; + } + + /** + * Get the userData property: UserData for the VM, which must be base-64 encoded. Customer should not pass any + * secrets in here. Minimum api-version: 2021-03-01. + * + * @return the userData value. + */ + public String userData() { + return this.userData; + } + + /** + * Set the userData property: UserData for the VM, which must be base-64 encoded. Customer should not pass any + * secrets in here. Minimum api-version: 2021-03-01. + * + * @param userData the userData value to set. + * @return the VirtualMachinePropertiesInner object itself. + */ + public VirtualMachinePropertiesInner withUserData(String userData) { + this.userData = userData; + return this; + } + + /** + * Get the capacityReservation property: Specifies information about the capacity reservation that is used to + * allocate virtual machine. Minimum api-version: 2021-04-01. + * + * @return the capacityReservation value. + */ + public CapacityReservationProfile capacityReservation() { + return this.capacityReservation; + } + + /** + * Set the capacityReservation property: Specifies information about the capacity reservation that is used to + * allocate virtual machine. Minimum api-version: 2021-04-01. + * + * @param capacityReservation the capacityReservation value to set. + * @return the VirtualMachinePropertiesInner object itself. + */ + public VirtualMachinePropertiesInner withCapacityReservation(CapacityReservationProfile capacityReservation) { + this.capacityReservation = capacityReservation; + return this; + } + + /** + * Get the applicationProfile property: Specifies the gallery applications that should be made available to the + * VM/VMSS. + * + * @return the applicationProfile value. + */ + public ApplicationProfile applicationProfile() { + return this.applicationProfile; + } + + /** + * Set the applicationProfile property: Specifies the gallery applications that should be made available to the + * VM/VMSS. + * + * @param applicationProfile the applicationProfile value to set. + * @return the VirtualMachinePropertiesInner object itself. + */ + public VirtualMachinePropertiesInner withApplicationProfile(ApplicationProfile applicationProfile) { + this.applicationProfile = applicationProfile; + return this; + } + + /** + * Get the timeCreated property: Specifies the time at which the Virtual Machine resource was created. Minimum + * api-version: 2021-11-01. + * + * @return the timeCreated value. + */ + public OffsetDateTime timeCreated() { + return this.timeCreated; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (hardwareProfile() != null) { + hardwareProfile().validate(); + } + if (storageProfile() != null) { + storageProfile().validate(); + } + if (additionalCapabilities() != null) { + additionalCapabilities().validate(); + } + if (osProfile() != null) { + osProfile().validate(); + } + if (networkProfile() != null) { + networkProfile().validate(); + } + if (securityProfile() != null) { + securityProfile().validate(); + } + if (diagnosticsProfile() != null) { + diagnosticsProfile().validate(); + } + if (billingProfile() != null) { + billingProfile().validate(); + } + if (instanceView() != null) { + instanceView().validate(); + } + if (scheduledEventsProfile() != null) { + scheduledEventsProfile().validate(); + } + if (capacityReservation() != null) { + capacityReservation().validate(); + } + if (applicationProfile() != null) { + applicationProfile().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachinePublicIpAddressConfigurationProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachinePublicIpAddressConfigurationProperties.java new file mode 100644 index 0000000000000..ff6386a310388 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachinePublicIpAddressConfigurationProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.compute.generated.models.DeleteOptions; +import com.azure.resourcemanager.compute.generated.models.IpVersions; +import com.azure.resourcemanager.compute.generated.models.PublicIpAllocationMethod; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineIpTag; +import com.azure.resourcemanager.compute.generated.models.VirtualMachinePublicIpAddressDnsSettingsConfiguration; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a virtual machines IP Configuration's PublicIPAddress configuration. */ +@Fluent +public final class VirtualMachinePublicIpAddressConfigurationProperties { + /* + * The idle timeout of the public IP address. + */ + @JsonProperty(value = "idleTimeoutInMinutes") + private Integer idleTimeoutInMinutes; + + /* + * Specify what happens to the public IP address when the VM is deleted + */ + @JsonProperty(value = "deleteOption") + private DeleteOptions deleteOption; + + /* + * The dns settings to be applied on the publicIP addresses . + */ + @JsonProperty(value = "dnsSettings") + private VirtualMachinePublicIpAddressDnsSettingsConfiguration dnsSettings; + + /* + * The list of IP tags associated with the public IP address. + */ + @JsonProperty(value = "ipTags") + private List ipTags; + + /* + * The PublicIPPrefix from which to allocate publicIP addresses. + */ + @JsonProperty(value = "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 = "publicIPAddressVersion") + private IpVersions publicIpAddressVersion; + + /* + * Specify the public IP allocation type + */ + @JsonProperty(value = "publicIPAllocationMethod") + private PublicIpAllocationMethod publicIpAllocationMethod; + + /** Creates an instance of VirtualMachinePublicIpAddressConfigurationProperties class. */ + public VirtualMachinePublicIpAddressConfigurationProperties() { + } + + /** + * 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 VirtualMachinePublicIpAddressConfigurationProperties object itself. + */ + public VirtualMachinePublicIpAddressConfigurationProperties withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes) { + this.idleTimeoutInMinutes = idleTimeoutInMinutes; + return this; + } + + /** + * Get the deleteOption property: Specify what happens to the public IP address when the VM is deleted. + * + * @return the deleteOption value. + */ + public DeleteOptions deleteOption() { + return this.deleteOption; + } + + /** + * Set the deleteOption property: Specify what happens to the public IP address when the VM is deleted. + * + * @param deleteOption the deleteOption value to set. + * @return the VirtualMachinePublicIpAddressConfigurationProperties object itself. + */ + public VirtualMachinePublicIpAddressConfigurationProperties withDeleteOption(DeleteOptions deleteOption) { + this.deleteOption = deleteOption; + return this; + } + + /** + * Get the dnsSettings property: The dns settings to be applied on the publicIP addresses . + * + * @return the dnsSettings value. + */ + public VirtualMachinePublicIpAddressDnsSettingsConfiguration dnsSettings() { + return this.dnsSettings; + } + + /** + * Set the dnsSettings property: The dns settings to be applied on the publicIP addresses . + * + * @param dnsSettings the dnsSettings value to set. + * @return the VirtualMachinePublicIpAddressConfigurationProperties object itself. + */ + public VirtualMachinePublicIpAddressConfigurationProperties withDnsSettings( + VirtualMachinePublicIpAddressDnsSettingsConfiguration dnsSettings) { + this.dnsSettings = dnsSettings; + return this; + } + + /** + * Get the ipTags property: The list of IP tags associated with the public IP address. + * + * @return the ipTags value. + */ + public List ipTags() { + return this.ipTags; + } + + /** + * Set the ipTags property: The list of IP tags associated with the public IP address. + * + * @param ipTags the ipTags value to set. + * @return the VirtualMachinePublicIpAddressConfigurationProperties object itself. + */ + public VirtualMachinePublicIpAddressConfigurationProperties 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 VirtualMachinePublicIpAddressConfigurationProperties object itself. + */ + public VirtualMachinePublicIpAddressConfigurationProperties withPublicIpPrefix(SubResource publicIpPrefix) { + this.publicIpPrefix = publicIpPrefix; + return this; + } + + /** + * Get the publicIpAddressVersion property: Available from Api-Version 2019-07-01 onwards, it represents whether the + * specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. + * + * @return the publicIpAddressVersion value. + */ + public IpVersions publicIpAddressVersion() { + return this.publicIpAddressVersion; + } + + /** + * Set the publicIpAddressVersion property: Available from Api-Version 2019-07-01 onwards, it represents whether the + * specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. + * + * @param publicIpAddressVersion the publicIpAddressVersion value to set. + * @return the VirtualMachinePublicIpAddressConfigurationProperties object itself. + */ + public VirtualMachinePublicIpAddressConfigurationProperties withPublicIpAddressVersion( + IpVersions publicIpAddressVersion) { + this.publicIpAddressVersion = publicIpAddressVersion; + return this; + } + + /** + * Get the publicIpAllocationMethod property: Specify the public IP allocation type. + * + * @return the publicIpAllocationMethod value. + */ + public PublicIpAllocationMethod publicIpAllocationMethod() { + return this.publicIpAllocationMethod; + } + + /** + * Set the publicIpAllocationMethod property: Specify the public IP allocation type. + * + * @param publicIpAllocationMethod the publicIpAllocationMethod value to set. + * @return the VirtualMachinePublicIpAddressConfigurationProperties object itself. + */ + public VirtualMachinePublicIpAddressConfigurationProperties withPublicIpAllocationMethod( + PublicIpAllocationMethod publicIpAllocationMethod) { + this.publicIpAllocationMethod = publicIpAllocationMethod; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dnsSettings() != null) { + dnsSettings().validate(); + } + if (ipTags() != null) { + ipTags().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/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..f1ce7f73da975 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineRunCommandInner.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.resourcemanager.compute.generated.models.RunCommandInputParameter; +import com.azure.resourcemanager.compute.generated.models.RunCommandManagedIdentity; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineRunCommandInstanceView; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineRunCommandScriptSource; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Describes a Virtual Machine run command. */ +@Fluent +public final class VirtualMachineRunCommandInner extends Resource { + /* + * Describes the properties of a Virtual Machine run command. + */ + @JsonProperty(value = "properties") + private VirtualMachineRunCommandProperties innerProperties; + + /** Creates an instance of VirtualMachineRunCommandInner class. */ + public VirtualMachineRunCommandInner() { + } + + /** + * Get the innerProperties property: Describes the properties of a Virtual Machine run command. + * + * @return the innerProperties value. + */ + private VirtualMachineRunCommandProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public VirtualMachineRunCommandInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public VirtualMachineRunCommandInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the source property: The source of the run command script. + * + * @return the source value. + */ + public VirtualMachineRunCommandScriptSource source() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineRunCommandProperties(); + } + this.innerProperties().withSource(source); + return this; + } + + /** + * Get the parameters property: The parameters used by the script. + * + * @return the parameters value. + */ + public List parameters() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineRunCommandProperties(); + } + this.innerProperties().withParameters(parameters); + return this; + } + + /** + * Get the protectedParameters property: The parameters used by the script. + * + * @return the protectedParameters value. + */ + public List protectedParameters() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineRunCommandProperties(); + } + this.innerProperties().withProtectedParameters(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineRunCommandProperties(); + } + this.innerProperties().withAsyncExecution(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineRunCommandProperties(); + } + this.innerProperties().withRunAsUser(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineRunCommandProperties(); + } + this.innerProperties().withRunAsPassword(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineRunCommandProperties(); + } + this.innerProperties().withTimeoutInSeconds(timeoutInSeconds); + return this; + } + + /** + * Get the outputBlobUri property: Specifies the Azure storage blob where script output stream will be uploaded. Use + * a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. + * Refer outputBlobManagedIdentity parameter. + * + * @return the outputBlobUri value. + */ + public String outputBlobUri() { + return this.innerProperties() == null ? null : this.innerProperties().outputBlobUri(); + } + + /** + * Set the outputBlobUri property: Specifies the Azure storage blob where script output stream will be uploaded. Use + * a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. + * Refer outputBlobManagedIdentity parameter. + * + * @param outputBlobUri the outputBlobUri value to set. + * @return the VirtualMachineRunCommandInner object itself. + */ + public VirtualMachineRunCommandInner withOutputBlobUri(String outputBlobUri) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineRunCommandProperties(); + } + this.innerProperties().withOutputBlobUri(outputBlobUri); + return this; + } + + /** + * Get the errorBlobUri property: Specifies the Azure storage blob where script error stream will be uploaded. Use a + * SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. + * Refer errorBlobManagedIdentity parameter. + * + * @return the errorBlobUri value. + */ + public String errorBlobUri() { + return this.innerProperties() == null ? null : this.innerProperties().errorBlobUri(); + } + + /** + * Set the errorBlobUri property: Specifies the Azure storage blob where script error stream will be uploaded. Use a + * SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. + * Refer errorBlobManagedIdentity parameter. + * + * @param errorBlobUri the errorBlobUri value to set. + * @return the VirtualMachineRunCommandInner object itself. + */ + public VirtualMachineRunCommandInner withErrorBlobUri(String errorBlobUri) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineRunCommandProperties(); + } + this.innerProperties().withErrorBlobUri(errorBlobUri); + return this; + } + + /** + * Get the outputBlobManagedIdentity property: User-assigned managed identity that has access to outputBlobUri + * storage blob. Use an empty object in case of system-assigned identity. Make sure managed identity has been given + * access to blob's container with 'Storage Blob Data Contributor' role assignment. In case of user-assigned + * identity, make sure you add it under VM's identity. For more info on managed identity and Run Command, refer + * https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. + * + * @return the outputBlobManagedIdentity value. + */ + public RunCommandManagedIdentity outputBlobManagedIdentity() { + return this.innerProperties() == null ? null : this.innerProperties().outputBlobManagedIdentity(); + } + + /** + * Set the outputBlobManagedIdentity property: User-assigned managed identity that has access to outputBlobUri + * storage blob. Use an empty object in case of system-assigned identity. Make sure managed identity has been given + * access to blob's container with 'Storage Blob Data Contributor' role assignment. In case of user-assigned + * identity, make sure you add it under VM's identity. For more info on managed identity and Run Command, refer + * https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. + * + * @param outputBlobManagedIdentity the outputBlobManagedIdentity value to set. + * @return the VirtualMachineRunCommandInner object itself. + */ + public VirtualMachineRunCommandInner withOutputBlobManagedIdentity( + RunCommandManagedIdentity outputBlobManagedIdentity) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineRunCommandProperties(); + } + this.innerProperties().withOutputBlobManagedIdentity(outputBlobManagedIdentity); + return this; + } + + /** + * Get the errorBlobManagedIdentity property: User-assigned managed identity that has access to errorBlobUri storage + * blob. Use an empty object in case of system-assigned identity. Make sure managed identity has been given access + * to blob's container with 'Storage Blob Data Contributor' role assignment. In case of user-assigned identity, make + * sure you add it under VM's identity. For more info on managed identity and Run Command, refer + * https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. + * + * @return the errorBlobManagedIdentity value. + */ + public RunCommandManagedIdentity errorBlobManagedIdentity() { + return this.innerProperties() == null ? null : this.innerProperties().errorBlobManagedIdentity(); + } + + /** + * Set the errorBlobManagedIdentity property: User-assigned managed identity that has access to errorBlobUri storage + * blob. Use an empty object in case of system-assigned identity. Make sure managed identity has been given access + * to blob's container with 'Storage Blob Data Contributor' role assignment. In case of user-assigned identity, make + * sure you add it under VM's identity. For more info on managed identity and Run Command, refer + * https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. + * + * @param errorBlobManagedIdentity the errorBlobManagedIdentity value to set. + * @return the VirtualMachineRunCommandInner object itself. + */ + public VirtualMachineRunCommandInner withErrorBlobManagedIdentity( + RunCommandManagedIdentity errorBlobManagedIdentity) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineRunCommandProperties(); + } + this.innerProperties().withErrorBlobManagedIdentity(errorBlobManagedIdentity); + return this; + } + + /** + * Get the provisioningState property: The provisioning state, which only appears in the response. If + * treatFailureAsDeploymentFailure set to true, any failure in the script will fail the deployment and + * ProvisioningState will be marked as Failed. If treatFailureAsDeploymentFailure set to false, ProvisioningState + * would only reflect whether the run command was run or not by the extensions platform, it would not indicate + * whether script failed in case of script failures. See instance view of run command in case of script failures to + * see executionMessage, output, error: https://aka.ms/runcommandmanaged#get-execution-status-and-results. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the instanceView property: The virtual machine run command instance view. + * + * @return the instanceView value. + */ + public VirtualMachineRunCommandInstanceView instanceView() { + return this.innerProperties() == null ? null : this.innerProperties().instanceView(); + } + + /** + * Get the treatFailureAsDeploymentFailure property: Optional. If set to true, any failure in the script will fail + * the deployment and ProvisioningState will be marked as Failed. If set to false, ProvisioningState would only + * reflect whether the run command was run or not by the extensions platform, it would not indicate whether script + * failed in case of script failures. See instance view of run command in case of script failures to see + * executionMessage, output, error: https://aka.ms/runcommandmanaged#get-execution-status-and-results. + * + * @return the treatFailureAsDeploymentFailure value. + */ + public Boolean treatFailureAsDeploymentFailure() { + return this.innerProperties() == null ? null : this.innerProperties().treatFailureAsDeploymentFailure(); + } + + /** + * Set the treatFailureAsDeploymentFailure property: Optional. If set to true, any failure in the script will fail + * the deployment and ProvisioningState will be marked as Failed. If set to false, ProvisioningState would only + * reflect whether the run command was run or not by the extensions platform, it would not indicate whether script + * failed in case of script failures. See instance view of run command in case of script failures to see + * executionMessage, output, error: https://aka.ms/runcommandmanaged#get-execution-status-and-results. + * + * @param treatFailureAsDeploymentFailure the treatFailureAsDeploymentFailure value to set. + * @return the VirtualMachineRunCommandInner object itself. + */ + public VirtualMachineRunCommandInner withTreatFailureAsDeploymentFailure(Boolean treatFailureAsDeploymentFailure) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineRunCommandProperties(); + } + this.innerProperties().withTreatFailureAsDeploymentFailure(treatFailureAsDeploymentFailure); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineRunCommandProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineRunCommandProperties.java new file mode 100644 index 0000000000000..087b92ad1e4b6 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineRunCommandProperties.java @@ -0,0 +1,454 @@ +// Copyright (c) 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.resourcemanager.compute.generated.models.RunCommandInputParameter; +import com.azure.resourcemanager.compute.generated.models.RunCommandManagedIdentity; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineRunCommandInstanceView; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineRunCommandScriptSource; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes the properties of a Virtual Machine run command. */ +@Fluent +public final class VirtualMachineRunCommandProperties { + /* + * The source of the run command script. + */ + @JsonProperty(value = "source") + private VirtualMachineRunCommandScriptSource source; + + /* + * The parameters used by the script. + */ + @JsonProperty(value = "parameters") + private List parameters; + + /* + * The parameters used by the script. + */ + @JsonProperty(value = "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 = "asyncExecution") + private Boolean asyncExecution; + + /* + * Specifies the user account on the VM when executing the run command. + */ + @JsonProperty(value = "runAsUser") + private String runAsUser; + + /* + * Specifies the user account password on the VM when executing the run command. + */ + @JsonProperty(value = "runAsPassword") + private String runAsPassword; + + /* + * The timeout in seconds to execute the run command. + */ + @JsonProperty(value = "timeoutInSeconds") + private Integer timeoutInSeconds; + + /* + * Specifies the Azure storage blob where script output stream will be uploaded. Use a SAS URI with read, append, + * create, write access OR use managed identity to provide the VM access to the blob. Refer + * outputBlobManagedIdentity parameter. + */ + @JsonProperty(value = "outputBlobUri") + private String outputBlobUri; + + /* + * Specifies the Azure storage blob where script error stream will be uploaded. Use a SAS URI with read, append, + * create, write access OR use managed identity to provide the VM access to the blob. Refer + * errorBlobManagedIdentity parameter. + */ + @JsonProperty(value = "errorBlobUri") + private String errorBlobUri; + + /* + * User-assigned managed identity that has access to outputBlobUri storage blob. Use an empty object in case of + * system-assigned identity. Make sure managed identity has been given access to blob's container with 'Storage + * Blob Data Contributor' role assignment. In case of user-assigned identity, make sure you add it under VM's + * identity. For more info on managed identity and Run Command, refer https://aka.ms/ManagedIdentity and + * https://aka.ms/RunCommandManaged + */ + @JsonProperty(value = "outputBlobManagedIdentity") + private RunCommandManagedIdentity outputBlobManagedIdentity; + + /* + * User-assigned managed identity that has access to errorBlobUri storage blob. Use an empty object in case of + * system-assigned identity. Make sure managed identity has been given access to blob's container with 'Storage + * Blob Data Contributor' role assignment. In case of user-assigned identity, make sure you add it under VM's + * identity. For more info on managed identity and Run Command, refer https://aka.ms/ManagedIdentity and + * https://aka.ms/RunCommandManaged + */ + @JsonProperty(value = "errorBlobManagedIdentity") + private RunCommandManagedIdentity errorBlobManagedIdentity; + + /* + * The provisioning state, which only appears in the response. If treatFailureAsDeploymentFailure set to true, any + * failure in the script will fail the deployment and ProvisioningState will be marked as Failed. If + * treatFailureAsDeploymentFailure set to false, ProvisioningState would only reflect whether the run command was + * run or not by the extensions platform, it would not indicate whether script failed in case of script failures. + * See instance view of run command in case of script failures to see executionMessage, output, error: + * https://aka.ms/runcommandmanaged#get-execution-status-and-results + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The virtual machine run command instance view. + */ + @JsonProperty(value = "instanceView", access = JsonProperty.Access.WRITE_ONLY) + private VirtualMachineRunCommandInstanceView instanceView; + + /* + * Optional. If set to true, any failure in the script will fail the deployment and ProvisioningState will be + * marked as Failed. If set to false, ProvisioningState would only reflect whether the run command was run or not + * by the extensions platform, it would not indicate whether script failed in case of script failures. See instance + * view of run command in case of script failures to see executionMessage, output, error: + * https://aka.ms/runcommandmanaged#get-execution-status-and-results + */ + @JsonProperty(value = "treatFailureAsDeploymentFailure") + private Boolean treatFailureAsDeploymentFailure; + + /** Creates an instance of VirtualMachineRunCommandProperties class. */ + public VirtualMachineRunCommandProperties() { + } + + /** + * 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 VirtualMachineRunCommandProperties object itself. + */ + public VirtualMachineRunCommandProperties 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 VirtualMachineRunCommandProperties object itself. + */ + public VirtualMachineRunCommandProperties 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 VirtualMachineRunCommandProperties object itself. + */ + public VirtualMachineRunCommandProperties 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 VirtualMachineRunCommandProperties object itself. + */ + public VirtualMachineRunCommandProperties 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 VirtualMachineRunCommandProperties object itself. + */ + public VirtualMachineRunCommandProperties 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 VirtualMachineRunCommandProperties object itself. + */ + public VirtualMachineRunCommandProperties 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 VirtualMachineRunCommandProperties object itself. + */ + public VirtualMachineRunCommandProperties withTimeoutInSeconds(Integer timeoutInSeconds) { + this.timeoutInSeconds = timeoutInSeconds; + return this; + } + + /** + * Get the outputBlobUri property: Specifies the Azure storage blob where script output stream will be uploaded. Use + * a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. + * Refer outputBlobManagedIdentity parameter. + * + * @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. Use + * a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. + * Refer outputBlobManagedIdentity parameter. + * + * @param outputBlobUri the outputBlobUri value to set. + * @return the VirtualMachineRunCommandProperties object itself. + */ + public VirtualMachineRunCommandProperties withOutputBlobUri(String outputBlobUri) { + this.outputBlobUri = outputBlobUri; + return this; + } + + /** + * Get the errorBlobUri property: Specifies the Azure storage blob where script error stream will be uploaded. Use a + * SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. + * Refer errorBlobManagedIdentity parameter. + * + * @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. Use a + * SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. + * Refer errorBlobManagedIdentity parameter. + * + * @param errorBlobUri the errorBlobUri value to set. + * @return the VirtualMachineRunCommandProperties object itself. + */ + public VirtualMachineRunCommandProperties withErrorBlobUri(String errorBlobUri) { + this.errorBlobUri = errorBlobUri; + return this; + } + + /** + * Get the outputBlobManagedIdentity property: User-assigned managed identity that has access to outputBlobUri + * storage blob. Use an empty object in case of system-assigned identity. Make sure managed identity has been given + * access to blob's container with 'Storage Blob Data Contributor' role assignment. In case of user-assigned + * identity, make sure you add it under VM's identity. For more info on managed identity and Run Command, refer + * https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. + * + * @return the outputBlobManagedIdentity value. + */ + public RunCommandManagedIdentity outputBlobManagedIdentity() { + return this.outputBlobManagedIdentity; + } + + /** + * Set the outputBlobManagedIdentity property: User-assigned managed identity that has access to outputBlobUri + * storage blob. Use an empty object in case of system-assigned identity. Make sure managed identity has been given + * access to blob's container with 'Storage Blob Data Contributor' role assignment. In case of user-assigned + * identity, make sure you add it under VM's identity. For more info on managed identity and Run Command, refer + * https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. + * + * @param outputBlobManagedIdentity the outputBlobManagedIdentity value to set. + * @return the VirtualMachineRunCommandProperties object itself. + */ + public VirtualMachineRunCommandProperties withOutputBlobManagedIdentity( + RunCommandManagedIdentity outputBlobManagedIdentity) { + this.outputBlobManagedIdentity = outputBlobManagedIdentity; + return this; + } + + /** + * Get the errorBlobManagedIdentity property: User-assigned managed identity that has access to errorBlobUri storage + * blob. Use an empty object in case of system-assigned identity. Make sure managed identity has been given access + * to blob's container with 'Storage Blob Data Contributor' role assignment. In case of user-assigned identity, make + * sure you add it under VM's identity. For more info on managed identity and Run Command, refer + * https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. + * + * @return the errorBlobManagedIdentity value. + */ + public RunCommandManagedIdentity errorBlobManagedIdentity() { + return this.errorBlobManagedIdentity; + } + + /** + * Set the errorBlobManagedIdentity property: User-assigned managed identity that has access to errorBlobUri storage + * blob. Use an empty object in case of system-assigned identity. Make sure managed identity has been given access + * to blob's container with 'Storage Blob Data Contributor' role assignment. In case of user-assigned identity, make + * sure you add it under VM's identity. For more info on managed identity and Run Command, refer + * https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. + * + * @param errorBlobManagedIdentity the errorBlobManagedIdentity value to set. + * @return the VirtualMachineRunCommandProperties object itself. + */ + public VirtualMachineRunCommandProperties withErrorBlobManagedIdentity( + RunCommandManagedIdentity errorBlobManagedIdentity) { + this.errorBlobManagedIdentity = errorBlobManagedIdentity; + return this; + } + + /** + * Get the provisioningState property: The provisioning state, which only appears in the response. If + * treatFailureAsDeploymentFailure set to true, any failure in the script will fail the deployment and + * ProvisioningState will be marked as Failed. If treatFailureAsDeploymentFailure set to false, ProvisioningState + * would only reflect whether the run command was run or not by the extensions platform, it would not indicate + * whether script failed in case of script failures. See instance view of run command in case of script failures to + * see executionMessage, output, error: https://aka.ms/runcommandmanaged#get-execution-status-and-results. + * + * @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; + } + + /** + * Get the treatFailureAsDeploymentFailure property: Optional. If set to true, any failure in the script will fail + * the deployment and ProvisioningState will be marked as Failed. If set to false, ProvisioningState would only + * reflect whether the run command was run or not by the extensions platform, it would not indicate whether script + * failed in case of script failures. See instance view of run command in case of script failures to see + * executionMessage, output, error: https://aka.ms/runcommandmanaged#get-execution-status-and-results. + * + * @return the treatFailureAsDeploymentFailure value. + */ + public Boolean treatFailureAsDeploymentFailure() { + return this.treatFailureAsDeploymentFailure; + } + + /** + * Set the treatFailureAsDeploymentFailure property: Optional. If set to true, any failure in the script will fail + * the deployment and ProvisioningState will be marked as Failed. If set to false, ProvisioningState would only + * reflect whether the run command was run or not by the extensions platform, it would not indicate whether script + * failed in case of script failures. See instance view of run command in case of script failures to see + * executionMessage, output, error: https://aka.ms/runcommandmanaged#get-execution-status-and-results. + * + * @param treatFailureAsDeploymentFailure the treatFailureAsDeploymentFailure value to set. + * @return the VirtualMachineRunCommandProperties object itself. + */ + public VirtualMachineRunCommandProperties withTreatFailureAsDeploymentFailure( + Boolean treatFailureAsDeploymentFailure) { + this.treatFailureAsDeploymentFailure = treatFailureAsDeploymentFailure; + 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 (outputBlobManagedIdentity() != null) { + outputBlobManagedIdentity().validate(); + } + if (errorBlobManagedIdentity() != null) { + errorBlobManagedIdentity().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..5400436e8ac26 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineScaleSetExtensionInner.java @@ -0,0 +1,369 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.compute.generated.models.KeyVaultSecretReference; +import com.azure.resourcemanager.compute.generated.models.SubResourceReadOnly; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a Virtual Machine Scale Set Extension. */ +@Fluent +public final class VirtualMachineScaleSetExtensionInner extends SubResourceReadOnly { + /* + * The name of the extension. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Resource type + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * Describes the properties of a Virtual Machine Scale Set Extension. + */ + @JsonProperty(value = "properties") + private VirtualMachineScaleSetExtensionProperties innerProperties; + + /** Creates an instance of VirtualMachineScaleSetExtensionInner class. */ + public VirtualMachineScaleSetExtensionInner() { + } + + /** + * 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 innerProperties property: Describes the properties of a Virtual Machine Scale Set Extension. + * + * @return the innerProperties value. + */ + private VirtualMachineScaleSetExtensionProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetExtensionProperties(); + } + this.innerProperties().withForceUpdateTag(forceUpdateTag); + return this; + } + + /** + * Get the publisher property: The name of the extension handler publisher. + * + * @return the publisher value. + */ + public String publisher() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetExtensionProperties(); + } + this.innerProperties().withPublisher(publisher); + return this; + } + + /** + * Get the type property: Specifies the type of the extension; an example is "CustomScriptExtension". + * + * @return the type value. + */ + public String typePropertiesType() { + return this.innerProperties() == null ? null : this.innerProperties().type(); + } + + /** + * Set the type property: Specifies the type of the extension; an example is "CustomScriptExtension". + * + * @param type the type value to set. + * @return the VirtualMachineScaleSetExtensionInner object itself. + */ + public VirtualMachineScaleSetExtensionInner withTypePropertiesType(String type) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetExtensionProperties(); + } + this.innerProperties().withType(type); + return this; + } + + /** + * Get the typeHandlerVersion property: Specifies the version of the script handler. + * + * @return the typeHandlerVersion value. + */ + public String typeHandlerVersion() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetExtensionProperties(); + } + this.innerProperties().withTypeHandlerVersion(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetExtensionProperties(); + } + this.innerProperties().withAutoUpgradeMinorVersion(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetExtensionProperties(); + } + this.innerProperties().withEnableAutomaticUpgrade(enableAutomaticUpgrade); + return this; + } + + /** + * Get the settings property: Json formatted public settings for the extension. + * + * @return the settings value. + */ + public Object settings() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetExtensionProperties(); + } + this.innerProperties().withSettings(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetExtensionProperties(); + } + this.innerProperties().withProtectedSettings(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.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetExtensionProperties(); + } + this.innerProperties().withProvisionAfterExtensions(provisionAfterExtensions); + return this; + } + + /** + * Get the suppressFailures property: Indicates whether failures stemming from the extension will be suppressed + * (Operational failures such as not connecting to the VM will not be suppressed regardless of this value). The + * default is false. + * + * @return the suppressFailures value. + */ + public Boolean suppressFailures() { + return this.innerProperties() == null ? null : this.innerProperties().suppressFailures(); + } + + /** + * Set the suppressFailures property: Indicates whether failures stemming from the extension will be suppressed + * (Operational failures such as not connecting to the VM will not be suppressed regardless of this value). The + * default is false. + * + * @param suppressFailures the suppressFailures value to set. + * @return the VirtualMachineScaleSetExtensionInner object itself. + */ + public VirtualMachineScaleSetExtensionInner withSuppressFailures(Boolean suppressFailures) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetExtensionProperties(); + } + this.innerProperties().withSuppressFailures(suppressFailures); + return this; + } + + /** + * Get the protectedSettingsFromKeyVault property: The extensions protected settings that are passed by reference, + * and consumed from key vault. + * + * @return the protectedSettingsFromKeyVault value. + */ + public KeyVaultSecretReference protectedSettingsFromKeyVault() { + return this.innerProperties() == null ? null : this.innerProperties().protectedSettingsFromKeyVault(); + } + + /** + * Set the protectedSettingsFromKeyVault property: The extensions protected settings that are passed by reference, + * and consumed from key vault. + * + * @param protectedSettingsFromKeyVault the protectedSettingsFromKeyVault value to set. + * @return the VirtualMachineScaleSetExtensionInner object itself. + */ + public VirtualMachineScaleSetExtensionInner withProtectedSettingsFromKeyVault( + KeyVaultSecretReference protectedSettingsFromKeyVault) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetExtensionProperties(); + } + this.innerProperties().withProtectedSettingsFromKeyVault(protectedSettingsFromKeyVault); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineScaleSetExtensionProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineScaleSetExtensionProperties.java new file mode 100644 index 0000000000000..66d0ff205d1ca --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineScaleSetExtensionProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.compute.generated.models.KeyVaultSecretReference; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes the properties of a Virtual Machine Scale Set Extension. */ +@Fluent +public final class VirtualMachineScaleSetExtensionProperties { + /* + * 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 = "forceUpdateTag") + private String forceUpdateTag; + + /* + * The name of the extension handler publisher. + */ + @JsonProperty(value = "publisher") + private String publisher; + + /* + * 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; + + /* + * 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 = "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 = "enableAutomaticUpgrade") + private Boolean enableAutomaticUpgrade; + + /* + * Json formatted public settings for the extension. + */ + @JsonProperty(value = "settings") + private Object settings; + + /* + * The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at + * all. + */ + @JsonProperty(value = "protectedSettings") + private Object protectedSettings; + + /* + * The provisioning state, which only appears in the response. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * Collection of extension names after which this extension needs to be provisioned. + */ + @JsonProperty(value = "provisionAfterExtensions") + private List provisionAfterExtensions; + + /* + * Indicates whether failures stemming from the extension will be suppressed (Operational failures such as not + * connecting to the VM will not be suppressed regardless of this value). The default is false. + */ + @JsonProperty(value = "suppressFailures") + private Boolean suppressFailures; + + /* + * The extensions protected settings that are passed by reference, and consumed from key vault + */ + @JsonProperty(value = "protectedSettingsFromKeyVault") + private KeyVaultSecretReference protectedSettingsFromKeyVault; + + /** Creates an instance of VirtualMachineScaleSetExtensionProperties class. */ + public VirtualMachineScaleSetExtensionProperties() { + } + + /** + * 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 VirtualMachineScaleSetExtensionProperties object itself. + */ + public VirtualMachineScaleSetExtensionProperties 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 VirtualMachineScaleSetExtensionProperties object itself. + */ + public VirtualMachineScaleSetExtensionProperties 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 VirtualMachineScaleSetExtensionProperties object itself. + */ + public VirtualMachineScaleSetExtensionProperties 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 VirtualMachineScaleSetExtensionProperties object itself. + */ + public VirtualMachineScaleSetExtensionProperties 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 VirtualMachineScaleSetExtensionProperties object itself. + */ + public VirtualMachineScaleSetExtensionProperties 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 VirtualMachineScaleSetExtensionProperties object itself. + */ + public VirtualMachineScaleSetExtensionProperties 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 VirtualMachineScaleSetExtensionProperties object itself. + */ + public VirtualMachineScaleSetExtensionProperties 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 VirtualMachineScaleSetExtensionProperties object itself. + */ + public VirtualMachineScaleSetExtensionProperties 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 VirtualMachineScaleSetExtensionProperties object itself. + */ + public VirtualMachineScaleSetExtensionProperties withProvisionAfterExtensions( + List provisionAfterExtensions) { + this.provisionAfterExtensions = provisionAfterExtensions; + return this; + } + + /** + * Get the suppressFailures property: Indicates whether failures stemming from the extension will be suppressed + * (Operational failures such as not connecting to the VM will not be suppressed regardless of this value). The + * default is false. + * + * @return the suppressFailures value. + */ + public Boolean suppressFailures() { + return this.suppressFailures; + } + + /** + * Set the suppressFailures property: Indicates whether failures stemming from the extension will be suppressed + * (Operational failures such as not connecting to the VM will not be suppressed regardless of this value). The + * default is false. + * + * @param suppressFailures the suppressFailures value to set. + * @return the VirtualMachineScaleSetExtensionProperties object itself. + */ + public VirtualMachineScaleSetExtensionProperties withSuppressFailures(Boolean suppressFailures) { + this.suppressFailures = suppressFailures; + return this; + } + + /** + * Get the protectedSettingsFromKeyVault property: The extensions protected settings that are passed by reference, + * and consumed from key vault. + * + * @return the protectedSettingsFromKeyVault value. + */ + public KeyVaultSecretReference protectedSettingsFromKeyVault() { + return this.protectedSettingsFromKeyVault; + } + + /** + * Set the protectedSettingsFromKeyVault property: The extensions protected settings that are passed by reference, + * and consumed from key vault. + * + * @param protectedSettingsFromKeyVault the protectedSettingsFromKeyVault value to set. + * @return the VirtualMachineScaleSetExtensionProperties object itself. + */ + public VirtualMachineScaleSetExtensionProperties withProtectedSettingsFromKeyVault( + KeyVaultSecretReference protectedSettingsFromKeyVault) { + this.protectedSettingsFromKeyVault = protectedSettingsFromKeyVault; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (protectedSettingsFromKeyVault() != null) { + protectedSettingsFromKeyVault().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/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..05714a1207974 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineScaleSetInner.java @@ -0,0 +1,650 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SubResource; +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.PriorityMixPolicy; +import com.azure.resourcemanager.compute.generated.models.ScaleInPolicy; +import com.azure.resourcemanager.compute.generated.models.Sku; +import com.azure.resourcemanager.compute.generated.models.SpotRestorePolicy; +import com.azure.resourcemanager.compute.generated.models.UpgradePolicy; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetIdentity; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMProfile; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** Describes a Virtual Machine Scale Set. */ +@Fluent +public final class VirtualMachineScaleSetInner extends Resource { + /* + * 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; + + /* + * Describes the properties of a Virtual Machine Scale Set. + */ + @JsonProperty(value = "properties") + private VirtualMachineScaleSetProperties innerProperties; + + /* + * 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; + + /** Creates an instance of VirtualMachineScaleSetInner class. */ + public VirtualMachineScaleSetInner() { + } + + /** + * 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 innerProperties property: Describes the properties of a Virtual Machine Scale Set. + * + * @return the innerProperties value. + */ + private VirtualMachineScaleSetProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** {@inheritDoc} */ + @Override + public VirtualMachineScaleSetInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public VirtualMachineScaleSetInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the upgradePolicy property: The upgrade policy. + * + * @return the upgradePolicy value. + */ + public UpgradePolicy upgradePolicy() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetProperties(); + } + this.innerProperties().withUpgradePolicy(upgradePolicy); + return this; + } + + /** + * Get the automaticRepairsPolicy property: Policy for automatic repairs. + * + * @return the automaticRepairsPolicy value. + */ + public AutomaticRepairsPolicy automaticRepairsPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetProperties(); + } + this.innerProperties().withAutomaticRepairsPolicy(automaticRepairsPolicy); + return this; + } + + /** + * Get the virtualMachineProfile property: The virtual machine profile. + * + * @return the virtualMachineProfile value. + */ + public VirtualMachineScaleSetVMProfile virtualMachineProfile() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetProperties(); + } + this.innerProperties().withVirtualMachineProfile(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.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the overprovision property: Specifies whether the Virtual Machine Scale Set should be overprovisioned. + * + * @return the overprovision value. + */ + public Boolean overprovision() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetProperties(); + } + this.innerProperties().withOverprovision(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetProperties(); + } + this.innerProperties().withDoNotRunExtensionsOnOverprovisionedVMs(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.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetProperties(); + } + this.innerProperties().withSinglePlacementGroup(singlePlacementGroup); + return this; + } + + /** + * Get the zoneBalance property: Whether to force strictly even Virtual Machine distribution cross x-zones in case + * there is zone outage. zoneBalance property can only be set if the zones property of the scale set contains more + * than one zone. If there are no zones or only one zone specified, then zoneBalance property should not be set. + * + * @return the zoneBalance value. + */ + public Boolean zoneBalance() { + return this.innerProperties() == null ? null : this.innerProperties().zoneBalance(); + } + + /** + * Set the zoneBalance property: Whether to force strictly even Virtual Machine distribution cross x-zones in case + * there is zone outage. zoneBalance property can only be set if the zones property of the scale set contains more + * than one zone. If there are no zones or only one zone specified, then zoneBalance property should not be set. + * + * @param zoneBalance the zoneBalance value to set. + * @return the VirtualMachineScaleSetInner object itself. + */ + public VirtualMachineScaleSetInner withZoneBalance(Boolean zoneBalance) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetProperties(); + } + this.innerProperties().withZoneBalance(zoneBalance); + return this; + } + + /** + * Get the platformFaultDomainCount property: Fault Domain count for each placement group. + * + * @return the platformFaultDomainCount value. + */ + public Integer platformFaultDomainCount() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetProperties(); + } + this.innerProperties().withPlatformFaultDomainCount(platformFaultDomainCount); + return this; + } + + /** + * Get the proximityPlacementGroup property: Specifies information about the proximity placement group that the + * virtual machine scale set should be assigned to. Minimum api-version: 2018-04-01. + * + * @return the proximityPlacementGroup value. + */ + public SubResource proximityPlacementGroup() { + return this.innerProperties() == null ? null : this.innerProperties().proximityPlacementGroup(); + } + + /** + * Set the proximityPlacementGroup property: Specifies information about the proximity placement group that the + * virtual machine scale set should be assigned to. Minimum api-version: 2018-04-01. + * + * @param proximityPlacementGroup the proximityPlacementGroup value to set. + * @return the VirtualMachineScaleSetInner object itself. + */ + public VirtualMachineScaleSetInner withProximityPlacementGroup(SubResource proximityPlacementGroup) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetProperties(); + } + this.innerProperties().withProximityPlacementGroup(proximityPlacementGroup); + return this; + } + + /** + * Get the hostGroup property: Specifies information about the dedicated host group that the virtual machine scale + * set resides in. Minimum api-version: 2020-06-01. + * + * @return the hostGroup value. + */ + public SubResource hostGroup() { + return this.innerProperties() == null ? null : this.innerProperties().hostGroup(); + } + + /** + * Set the hostGroup property: Specifies information about the dedicated host group that the virtual machine scale + * set resides in. Minimum api-version: 2020-06-01. + * + * @param hostGroup the hostGroup value to set. + * @return the VirtualMachineScaleSetInner object itself. + */ + public VirtualMachineScaleSetInner withHostGroup(SubResource hostGroup) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetProperties(); + } + this.innerProperties().withHostGroup(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetProperties(); + } + this.innerProperties().withAdditionalCapabilities(additionalCapabilities); + return this; + } + + /** + * Get the scaleInPolicy property: Specifies the policies applied when scaling in Virtual Machines in the Virtual + * Machine Scale Set. + * + * @return the scaleInPolicy value. + */ + public ScaleInPolicy scaleInPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().scaleInPolicy(); + } + + /** + * Set the scaleInPolicy property: Specifies the policies applied when scaling in Virtual Machines in the Virtual + * Machine Scale Set. + * + * @param scaleInPolicy the scaleInPolicy value to set. + * @return the VirtualMachineScaleSetInner object itself. + */ + public VirtualMachineScaleSetInner withScaleInPolicy(ScaleInPolicy scaleInPolicy) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetProperties(); + } + this.innerProperties().withScaleInPolicy(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetProperties(); + } + this.innerProperties().withOrchestrationMode(orchestrationMode); + return this; + } + + /** + * Get the spotRestorePolicy property: Specifies the Spot Restore properties for the virtual machine scale set. + * + * @return the spotRestorePolicy value. + */ + public SpotRestorePolicy spotRestorePolicy() { + return this.innerProperties() == null ? null : this.innerProperties().spotRestorePolicy(); + } + + /** + * Set the spotRestorePolicy property: Specifies the Spot Restore properties for the virtual machine scale set. + * + * @param spotRestorePolicy the spotRestorePolicy value to set. + * @return the VirtualMachineScaleSetInner object itself. + */ + public VirtualMachineScaleSetInner withSpotRestorePolicy(SpotRestorePolicy spotRestorePolicy) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetProperties(); + } + this.innerProperties().withSpotRestorePolicy(spotRestorePolicy); + return this; + } + + /** + * Get the priorityMixPolicy property: Specifies the desired targets for mixing Spot and Regular priority VMs within + * the same VMSS Flex instance. + * + * @return the priorityMixPolicy value. + */ + public PriorityMixPolicy priorityMixPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().priorityMixPolicy(); + } + + /** + * Set the priorityMixPolicy property: Specifies the desired targets for mixing Spot and Regular priority VMs within + * the same VMSS Flex instance. + * + * @param priorityMixPolicy the priorityMixPolicy value to set. + * @return the VirtualMachineScaleSetInner object itself. + */ + public VirtualMachineScaleSetInner withPriorityMixPolicy(PriorityMixPolicy priorityMixPolicy) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetProperties(); + } + this.innerProperties().withPriorityMixPolicy(priorityMixPolicy); + return this; + } + + /** + * Get the timeCreated property: Specifies the time at which the Virtual Machine Scale Set resource was created. + * Minimum api-version: 2021-11-01. + * + * @return the timeCreated value. + */ + public OffsetDateTime timeCreated() { + return this.innerProperties() == null ? null : this.innerProperties().timeCreated(); + } + + /** + * Get the constrainedMaximumCapacity property: Optional property which must either be set to True or omitted. + * + * @return the constrainedMaximumCapacity value. + */ + public Boolean constrainedMaximumCapacity() { + return this.innerProperties() == null ? null : this.innerProperties().constrainedMaximumCapacity(); + } + + /** + * Set the constrainedMaximumCapacity property: Optional property which must either be set to True or omitted. + * + * @param constrainedMaximumCapacity the constrainedMaximumCapacity value to set. + * @return the VirtualMachineScaleSetInner object itself. + */ + public VirtualMachineScaleSetInner withConstrainedMaximumCapacity(Boolean constrainedMaximumCapacity) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetProperties(); + } + this.innerProperties().withConstrainedMaximumCapacity(constrainedMaximumCapacity); + 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 (innerProperties() != null) { + innerProperties().validate(); + } + if (identity() != null) { + identity().validate(); + } + if (extendedLocation() != null) { + extendedLocation().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..88581f9bdd6fb --- /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.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.JsonProperty; +import java.util.List; + +/** The instance view of a virtual machine scale set. */ +@Fluent +public final class VirtualMachineScaleSetInstanceViewInner { + /* + * 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; + + /** Creates an instance of VirtualMachineScaleSetInstanceViewInner class. */ + public VirtualMachineScaleSetInstanceViewInner() { + } + + /** + * 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/VirtualMachineScaleSetIpConfigurationProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineScaleSetIpConfigurationProperties.java new file mode 100644 index 0000000000000..f718b6194a95c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineScaleSetIpConfigurationProperties.java @@ -0,0 +1,272 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.compute.generated.models.ApiEntityReference; +import com.azure.resourcemanager.compute.generated.models.IpVersion; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetPublicIpAddressConfiguration; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a virtual machine scale set network profile's IP configuration properties. */ +@Fluent +public final class VirtualMachineScaleSetIpConfigurationProperties { + /* + * Specifies the identifier of the subnet. + */ + @JsonProperty(value = "subnet") + private ApiEntityReference subnet; + + /* + * Specifies the primary network interface in case the virtual machine has more than 1 network interface. + */ + @JsonProperty(value = "primary") + private Boolean primary; + + /* + * The publicIPAddressConfiguration. + */ + @JsonProperty(value = "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 = "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 = "applicationGatewayBackendAddressPools") + private List applicationGatewayBackendAddressPools; + + /* + * Specifies an array of references to application security group. + */ + @JsonProperty(value = "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 = "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 = "loadBalancerInboundNatPools") + private List loadBalancerInboundNatPools; + + /** Creates an instance of VirtualMachineScaleSetIpConfigurationProperties class. */ + public VirtualMachineScaleSetIpConfigurationProperties() { + } + + /** + * 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 VirtualMachineScaleSetIpConfigurationProperties object itself. + */ + public VirtualMachineScaleSetIpConfigurationProperties 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 VirtualMachineScaleSetIpConfigurationProperties object itself. + */ + public VirtualMachineScaleSetIpConfigurationProperties 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 VirtualMachineScaleSetIpConfigurationProperties object itself. + */ + public VirtualMachineScaleSetIpConfigurationProperties 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 VirtualMachineScaleSetIpConfigurationProperties object itself. + */ + public VirtualMachineScaleSetIpConfigurationProperties 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 VirtualMachineScaleSetIpConfigurationProperties object itself. + */ + public VirtualMachineScaleSetIpConfigurationProperties 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 VirtualMachineScaleSetIpConfigurationProperties object itself. + */ + public VirtualMachineScaleSetIpConfigurationProperties 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 VirtualMachineScaleSetIpConfigurationProperties object itself. + */ + public VirtualMachineScaleSetIpConfigurationProperties 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 VirtualMachineScaleSetIpConfigurationProperties object itself. + */ + public VirtualMachineScaleSetIpConfigurationProperties withLoadBalancerInboundNatPools( + List loadBalancerInboundNatPools) { + this.loadBalancerInboundNatPools = loadBalancerInboundNatPools; + 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/fluent/models/VirtualMachineScaleSetNetworkConfigurationProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineScaleSetNetworkConfigurationProperties.java new file mode 100644 index 0000000000000..0e35e0aa4b9e0 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineScaleSetNetworkConfigurationProperties.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.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.DeleteOptions; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetIpConfiguration; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetNetworkConfigurationDnsSettings; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a virtual machine scale set network profile's IP configuration. */ +@Fluent +public final class VirtualMachineScaleSetNetworkConfigurationProperties { + /* + * Specifies the primary network interface in case the virtual machine has more than 1 network interface. + */ + @JsonProperty(value = "primary") + private Boolean primary; + + /* + * Specifies whether the network interface is accelerated networking-enabled. + */ + @JsonProperty(value = "enableAcceleratedNetworking") + private Boolean enableAcceleratedNetworking; + + /* + * Specifies whether the network interface is disabled for tcp state tracking. + */ + @JsonProperty(value = "disableTcpStateTracking") + private Boolean disableTcpStateTracking; + + /* + * Specifies whether the network interface is FPGA networking-enabled. + */ + @JsonProperty(value = "enableFpga") + private Boolean enableFpga; + + /* + * The network security group. + */ + @JsonProperty(value = "networkSecurityGroup") + private SubResource networkSecurityGroup; + + /* + * The dns settings to be applied on the network interfaces. + */ + @JsonProperty(value = "dnsSettings") + private VirtualMachineScaleSetNetworkConfigurationDnsSettings dnsSettings; + + /* + * Specifies the IP configurations of the network interface. + */ + @JsonProperty(value = "ipConfigurations", required = true) + private List ipConfigurations; + + /* + * Whether IP forwarding enabled on this NIC. + */ + @JsonProperty(value = "enableIPForwarding") + private Boolean enableIpForwarding; + + /* + * Specify what happens to the network interface when the VM is deleted + */ + @JsonProperty(value = "deleteOption") + private DeleteOptions deleteOption; + + /** Creates an instance of VirtualMachineScaleSetNetworkConfigurationProperties class. */ + public VirtualMachineScaleSetNetworkConfigurationProperties() { + } + + /** + * 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 VirtualMachineScaleSetNetworkConfigurationProperties object itself. + */ + public VirtualMachineScaleSetNetworkConfigurationProperties 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 VirtualMachineScaleSetNetworkConfigurationProperties object itself. + */ + public VirtualMachineScaleSetNetworkConfigurationProperties withEnableAcceleratedNetworking( + Boolean enableAcceleratedNetworking) { + this.enableAcceleratedNetworking = enableAcceleratedNetworking; + return this; + } + + /** + * Get the disableTcpStateTracking property: Specifies whether the network interface is disabled for tcp state + * tracking. + * + * @return the disableTcpStateTracking value. + */ + public Boolean disableTcpStateTracking() { + return this.disableTcpStateTracking; + } + + /** + * Set the disableTcpStateTracking property: Specifies whether the network interface is disabled for tcp state + * tracking. + * + * @param disableTcpStateTracking the disableTcpStateTracking value to set. + * @return the VirtualMachineScaleSetNetworkConfigurationProperties object itself. + */ + public VirtualMachineScaleSetNetworkConfigurationProperties withDisableTcpStateTracking( + Boolean disableTcpStateTracking) { + this.disableTcpStateTracking = disableTcpStateTracking; + 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 VirtualMachineScaleSetNetworkConfigurationProperties object itself. + */ + public VirtualMachineScaleSetNetworkConfigurationProperties 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 VirtualMachineScaleSetNetworkConfigurationProperties object itself. + */ + public VirtualMachineScaleSetNetworkConfigurationProperties 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 VirtualMachineScaleSetNetworkConfigurationProperties object itself. + */ + public VirtualMachineScaleSetNetworkConfigurationProperties 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 VirtualMachineScaleSetNetworkConfigurationProperties object itself. + */ + public VirtualMachineScaleSetNetworkConfigurationProperties 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 VirtualMachineScaleSetNetworkConfigurationProperties object itself. + */ + public VirtualMachineScaleSetNetworkConfigurationProperties withEnableIpForwarding(Boolean enableIpForwarding) { + this.enableIpForwarding = enableIpForwarding; + return this; + } + + /** + * Get the deleteOption property: Specify what happens to the network interface when the VM is deleted. + * + * @return the deleteOption value. + */ + public DeleteOptions deleteOption() { + return this.deleteOption; + } + + /** + * Set the deleteOption property: Specify what happens to the network interface when the VM is deleted. + * + * @param deleteOption the deleteOption value to set. + * @return the VirtualMachineScaleSetNetworkConfigurationProperties object itself. + */ + public VirtualMachineScaleSetNetworkConfigurationProperties withDeleteOption(DeleteOptions deleteOption) { + this.deleteOption = deleteOption; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dnsSettings() != null) { + dnsSettings().validate(); + } + if (ipConfigurations() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property ipConfigurations in model" + + " VirtualMachineScaleSetNetworkConfigurationProperties")); + } else { + ipConfigurations().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = + new ClientLogger(VirtualMachineScaleSetNetworkConfigurationProperties.class); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineScaleSetProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineScaleSetProperties.java new file mode 100644 index 0000000000000..ce1441f5913e9 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineScaleSetProperties.java @@ -0,0 +1,552 @@ +// Copyright (c) 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.resourcemanager.compute.generated.models.AdditionalCapabilities; +import com.azure.resourcemanager.compute.generated.models.AutomaticRepairsPolicy; +import com.azure.resourcemanager.compute.generated.models.OrchestrationMode; +import com.azure.resourcemanager.compute.generated.models.PriorityMixPolicy; +import com.azure.resourcemanager.compute.generated.models.ScaleInPolicy; +import com.azure.resourcemanager.compute.generated.models.SpotRestorePolicy; +import com.azure.resourcemanager.compute.generated.models.UpgradePolicy; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMProfile; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Describes the properties of a Virtual Machine Scale Set. */ +@Fluent +public final class VirtualMachineScaleSetProperties { + /* + * The upgrade policy. + */ + @JsonProperty(value = "upgradePolicy") + private UpgradePolicy upgradePolicy; + + /* + * Policy for automatic repairs. + */ + @JsonProperty(value = "automaticRepairsPolicy") + private AutomaticRepairsPolicy automaticRepairsPolicy; + + /* + * The virtual machine profile. + */ + @JsonProperty(value = "virtualMachineProfile") + private VirtualMachineScaleSetVMProfile virtualMachineProfile; + + /* + * The provisioning state, which only appears in the response. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * Specifies whether the Virtual Machine Scale Set should be overprovisioned. + */ + @JsonProperty(value = "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 = "doNotRunExtensionsOnOverprovisionedVMs") + private Boolean doNotRunExtensionsOnOverprovisionedVMs; + + /* + * Specifies the ID which uniquely identifies a Virtual Machine Scale Set. + */ + @JsonProperty(value = "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 = "singlePlacementGroup") + private Boolean singlePlacementGroup; + + /* + * Whether to force strictly even Virtual Machine distribution cross x-zones in case there is zone outage. + * zoneBalance property can only be set if the zones property of the scale set contains more than one zone. If + * there are no zones or only one zone specified, then zoneBalance property should not be set. + */ + @JsonProperty(value = "zoneBalance") + private Boolean zoneBalance; + + /* + * Fault Domain count for each placement group. + */ + @JsonProperty(value = "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 = "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 = "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 = "additionalCapabilities") + private AdditionalCapabilities additionalCapabilities; + + /* + * Specifies the policies applied when scaling in Virtual Machines in the Virtual Machine Scale Set. + */ + @JsonProperty(value = "scaleInPolicy") + private ScaleInPolicy scaleInPolicy; + + /* + * Specifies the orchestration mode for the virtual machine scale set. + */ + @JsonProperty(value = "orchestrationMode") + private OrchestrationMode orchestrationMode; + + /* + * Specifies the Spot Restore properties for the virtual machine scale set. + */ + @JsonProperty(value = "spotRestorePolicy") + private SpotRestorePolicy spotRestorePolicy; + + /* + * Specifies the desired targets for mixing Spot and Regular priority VMs within the same VMSS Flex instance. + */ + @JsonProperty(value = "priorityMixPolicy") + private PriorityMixPolicy priorityMixPolicy; + + /* + * Specifies the time at which the Virtual Machine Scale Set resource was created. Minimum api-version: 2021-11-01. + */ + @JsonProperty(value = "timeCreated", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime timeCreated; + + /* + * Optional property which must either be set to True or omitted. + */ + @JsonProperty(value = "constrainedMaximumCapacity") + private Boolean constrainedMaximumCapacity; + + /** Creates an instance of VirtualMachineScaleSetProperties class. */ + public VirtualMachineScaleSetProperties() { + } + + /** + * 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 VirtualMachineScaleSetProperties object itself. + */ + public VirtualMachineScaleSetProperties 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 VirtualMachineScaleSetProperties object itself. + */ + public VirtualMachineScaleSetProperties 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 VirtualMachineScaleSetProperties object itself. + */ + public VirtualMachineScaleSetProperties 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 VirtualMachineScaleSetProperties object itself. + */ + public VirtualMachineScaleSetProperties 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 VirtualMachineScaleSetProperties object itself. + */ + public VirtualMachineScaleSetProperties 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 VirtualMachineScaleSetProperties object itself. + */ + public VirtualMachineScaleSetProperties 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. zoneBalance property can only be set if the zones property of the scale set contains more + * than one zone. If there are no zones or only one zone specified, then zoneBalance property should not be set. + * + * @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. zoneBalance property can only be set if the zones property of the scale set contains more + * than one zone. If there are no zones or only one zone specified, then zoneBalance property should not be set. + * + * @param zoneBalance the zoneBalance value to set. + * @return the VirtualMachineScaleSetProperties object itself. + */ + public VirtualMachineScaleSetProperties 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 VirtualMachineScaleSetProperties object itself. + */ + public VirtualMachineScaleSetProperties 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. 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. Minimum api-version: 2018-04-01. + * + * @param proximityPlacementGroup the proximityPlacementGroup value to set. + * @return the VirtualMachineScaleSetProperties object itself. + */ + public VirtualMachineScaleSetProperties 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. 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. Minimum api-version: 2020-06-01. + * + * @param hostGroup the hostGroup value to set. + * @return the VirtualMachineScaleSetProperties object itself. + */ + public VirtualMachineScaleSetProperties 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 VirtualMachineScaleSetProperties object itself. + */ + public VirtualMachineScaleSetProperties withAdditionalCapabilities(AdditionalCapabilities additionalCapabilities) { + this.additionalCapabilities = additionalCapabilities; + return this; + } + + /** + * Get the scaleInPolicy property: Specifies the policies applied when scaling in Virtual Machines in the Virtual + * Machine Scale Set. + * + * @return the scaleInPolicy value. + */ + public ScaleInPolicy scaleInPolicy() { + return this.scaleInPolicy; + } + + /** + * Set the scaleInPolicy property: Specifies the policies applied when scaling in Virtual Machines in the Virtual + * Machine Scale Set. + * + * @param scaleInPolicy the scaleInPolicy value to set. + * @return the VirtualMachineScaleSetProperties object itself. + */ + public VirtualMachineScaleSetProperties 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 VirtualMachineScaleSetProperties object itself. + */ + public VirtualMachineScaleSetProperties withOrchestrationMode(OrchestrationMode orchestrationMode) { + this.orchestrationMode = orchestrationMode; + return this; + } + + /** + * Get the spotRestorePolicy property: Specifies the Spot Restore properties for the virtual machine scale set. + * + * @return the spotRestorePolicy value. + */ + public SpotRestorePolicy spotRestorePolicy() { + return this.spotRestorePolicy; + } + + /** + * Set the spotRestorePolicy property: Specifies the Spot Restore properties for the virtual machine scale set. + * + * @param spotRestorePolicy the spotRestorePolicy value to set. + * @return the VirtualMachineScaleSetProperties object itself. + */ + public VirtualMachineScaleSetProperties withSpotRestorePolicy(SpotRestorePolicy spotRestorePolicy) { + this.spotRestorePolicy = spotRestorePolicy; + return this; + } + + /** + * Get the priorityMixPolicy property: Specifies the desired targets for mixing Spot and Regular priority VMs within + * the same VMSS Flex instance. + * + * @return the priorityMixPolicy value. + */ + public PriorityMixPolicy priorityMixPolicy() { + return this.priorityMixPolicy; + } + + /** + * Set the priorityMixPolicy property: Specifies the desired targets for mixing Spot and Regular priority VMs within + * the same VMSS Flex instance. + * + * @param priorityMixPolicy the priorityMixPolicy value to set. + * @return the VirtualMachineScaleSetProperties object itself. + */ + public VirtualMachineScaleSetProperties withPriorityMixPolicy(PriorityMixPolicy priorityMixPolicy) { + this.priorityMixPolicy = priorityMixPolicy; + return this; + } + + /** + * Get the timeCreated property: Specifies the time at which the Virtual Machine Scale Set resource was created. + * Minimum api-version: 2021-11-01. + * + * @return the timeCreated value. + */ + public OffsetDateTime timeCreated() { + return this.timeCreated; + } + + /** + * Get the constrainedMaximumCapacity property: Optional property which must either be set to True or omitted. + * + * @return the constrainedMaximumCapacity value. + */ + public Boolean constrainedMaximumCapacity() { + return this.constrainedMaximumCapacity; + } + + /** + * Set the constrainedMaximumCapacity property: Optional property which must either be set to True or omitted. + * + * @param constrainedMaximumCapacity the constrainedMaximumCapacity value to set. + * @return the VirtualMachineScaleSetProperties object itself. + */ + public VirtualMachineScaleSetProperties withConstrainedMaximumCapacity(Boolean constrainedMaximumCapacity) { + this.constrainedMaximumCapacity = constrainedMaximumCapacity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (upgradePolicy() != null) { + upgradePolicy().validate(); + } + if (automaticRepairsPolicy() != null) { + automaticRepairsPolicy().validate(); + } + if (virtualMachineProfile() != null) { + virtualMachineProfile().validate(); + } + if (additionalCapabilities() != null) { + additionalCapabilities().validate(); + } + if (scaleInPolicy() != null) { + scaleInPolicy().validate(); + } + if (spotRestorePolicy() != null) { + spotRestorePolicy().validate(); + } + if (priorityMixPolicy() != null) { + priorityMixPolicy().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineScaleSetPublicIpAddressConfigurationProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineScaleSetPublicIpAddressConfigurationProperties.java new file mode 100644 index 0000000000000..d769eb7485b96 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineScaleSetPublicIpAddressConfigurationProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.compute.generated.models.DeleteOptions; +import com.azure.resourcemanager.compute.generated.models.IpVersion; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetIpTag; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a virtual machines scale set IP Configuration's PublicIPAddress configuration. */ +@Fluent +public final class VirtualMachineScaleSetPublicIpAddressConfigurationProperties { + /* + * The idle timeout of the public IP address. + */ + @JsonProperty(value = "idleTimeoutInMinutes") + private Integer idleTimeoutInMinutes; + + /* + * The dns settings to be applied on the publicIP addresses . + */ + @JsonProperty(value = "dnsSettings") + private VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings dnsSettings; + + /* + * The list of IP tags associated with the public IP address. + */ + @JsonProperty(value = "ipTags") + private List ipTags; + + /* + * The PublicIPPrefix from which to allocate publicIP addresses. + */ + @JsonProperty(value = "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 = "publicIPAddressVersion") + private IpVersion publicIpAddressVersion; + + /* + * Specify what happens to the public IP when the VM is deleted + */ + @JsonProperty(value = "deleteOption") + private DeleteOptions deleteOption; + + /** Creates an instance of VirtualMachineScaleSetPublicIpAddressConfigurationProperties class. */ + public VirtualMachineScaleSetPublicIpAddressConfigurationProperties() { + } + + /** + * 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 VirtualMachineScaleSetPublicIpAddressConfigurationProperties object itself. + */ + public VirtualMachineScaleSetPublicIpAddressConfigurationProperties 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 VirtualMachineScaleSetPublicIpAddressConfigurationProperties object itself. + */ + public VirtualMachineScaleSetPublicIpAddressConfigurationProperties 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 VirtualMachineScaleSetPublicIpAddressConfigurationProperties object itself. + */ + public VirtualMachineScaleSetPublicIpAddressConfigurationProperties 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 VirtualMachineScaleSetPublicIpAddressConfigurationProperties object itself. + */ + public VirtualMachineScaleSetPublicIpAddressConfigurationProperties 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 VirtualMachineScaleSetPublicIpAddressConfigurationProperties object itself. + */ + public VirtualMachineScaleSetPublicIpAddressConfigurationProperties withPublicIpAddressVersion( + IpVersion publicIpAddressVersion) { + this.publicIpAddressVersion = publicIpAddressVersion; + return this; + } + + /** + * Get the deleteOption property: Specify what happens to the public IP when the VM is deleted. + * + * @return the deleteOption value. + */ + public DeleteOptions deleteOption() { + return this.deleteOption; + } + + /** + * Set the deleteOption property: Specify what happens to the public IP when the VM is deleted. + * + * @param deleteOption the deleteOption value to set. + * @return the VirtualMachineScaleSetPublicIpAddressConfigurationProperties object itself. + */ + public VirtualMachineScaleSetPublicIpAddressConfigurationProperties withDeleteOption(DeleteOptions deleteOption) { + this.deleteOption = deleteOption; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dnsSettings() != null) { + dnsSettings().validate(); + } + 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/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..8c822303f6969 --- /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.resourcemanager.compute.generated.models.Sku; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetSkuCapacity; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes an available virtual machine scale set sku. */ +@Immutable +public final class VirtualMachineScaleSetSkuInner { + /* + * 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; + + /** Creates an instance of VirtualMachineScaleSetSkuInner class. */ + public VirtualMachineScaleSetSkuInner() { + } + + /** + * 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/VirtualMachineScaleSetUpdateIpConfigurationProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineScaleSetUpdateIpConfigurationProperties.java new file mode 100644 index 0000000000000..24e15321807cf --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineScaleSetUpdateIpConfigurationProperties.java @@ -0,0 +1,254 @@ +// Copyright (c) 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.resourcemanager.compute.generated.models.ApiEntityReference; +import com.azure.resourcemanager.compute.generated.models.IpVersion; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetUpdatePublicIpAddressConfiguration; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a virtual machine scale set network profile's IP configuration properties. */ +@Fluent +public final class VirtualMachineScaleSetUpdateIpConfigurationProperties { + /* + * The subnet. + */ + @JsonProperty(value = "subnet") + private ApiEntityReference subnet; + + /* + * Specifies the primary IP Configuration in case the network interface has more than one IP Configuration. + */ + @JsonProperty(value = "primary") + private Boolean primary; + + /* + * The publicIPAddressConfiguration. + */ + @JsonProperty(value = "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 = "privateIPAddressVersion") + private IpVersion privateIpAddressVersion; + + /* + * The application gateway backend address pools. + */ + @JsonProperty(value = "applicationGatewayBackendAddressPools") + private List applicationGatewayBackendAddressPools; + + /* + * Specifies an array of references to application security group. + */ + @JsonProperty(value = "applicationSecurityGroups") + private List applicationSecurityGroups; + + /* + * The load balancer backend address pools. + */ + @JsonProperty(value = "loadBalancerBackendAddressPools") + private List loadBalancerBackendAddressPools; + + /* + * The load balancer inbound nat pools. + */ + @JsonProperty(value = "loadBalancerInboundNatPools") + private List loadBalancerInboundNatPools; + + /** Creates an instance of VirtualMachineScaleSetUpdateIpConfigurationProperties class. */ + public VirtualMachineScaleSetUpdateIpConfigurationProperties() { + } + + /** + * 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 VirtualMachineScaleSetUpdateIpConfigurationProperties object itself. + */ + public VirtualMachineScaleSetUpdateIpConfigurationProperties 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 VirtualMachineScaleSetUpdateIpConfigurationProperties object itself. + */ + public VirtualMachineScaleSetUpdateIpConfigurationProperties 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 VirtualMachineScaleSetUpdateIpConfigurationProperties object itself. + */ + public VirtualMachineScaleSetUpdateIpConfigurationProperties 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 VirtualMachineScaleSetUpdateIpConfigurationProperties object itself. + */ + public VirtualMachineScaleSetUpdateIpConfigurationProperties 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 VirtualMachineScaleSetUpdateIpConfigurationProperties object itself. + */ + public VirtualMachineScaleSetUpdateIpConfigurationProperties 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 VirtualMachineScaleSetUpdateIpConfigurationProperties object itself. + */ + public VirtualMachineScaleSetUpdateIpConfigurationProperties 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 VirtualMachineScaleSetUpdateIpConfigurationProperties object itself. + */ + public VirtualMachineScaleSetUpdateIpConfigurationProperties 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 VirtualMachineScaleSetUpdateIpConfigurationProperties object itself. + */ + public VirtualMachineScaleSetUpdateIpConfigurationProperties withLoadBalancerInboundNatPools( + List loadBalancerInboundNatPools) { + this.loadBalancerInboundNatPools = loadBalancerInboundNatPools; + 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/fluent/models/VirtualMachineScaleSetUpdateNetworkConfigurationProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineScaleSetUpdateNetworkConfigurationProperties.java new file mode 100644 index 0000000000000..4529a68b6ec4d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineScaleSetUpdateNetworkConfigurationProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.compute.generated.models.DeleteOptions; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetNetworkConfigurationDnsSettings; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetUpdateIpConfiguration; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Describes a virtual machine scale set updatable network profile's IP configuration.Use this object for updating + * network profile's IP Configuration. + */ +@Fluent +public final class VirtualMachineScaleSetUpdateNetworkConfigurationProperties { + /* + * Whether this is a primary NIC on a virtual machine. + */ + @JsonProperty(value = "primary") + private Boolean primary; + + /* + * Specifies whether the network interface is accelerated networking-enabled. + */ + @JsonProperty(value = "enableAcceleratedNetworking") + private Boolean enableAcceleratedNetworking; + + /* + * Specifies whether the network interface is disabled for tcp state tracking. + */ + @JsonProperty(value = "disableTcpStateTracking") + private Boolean disableTcpStateTracking; + + /* + * Specifies whether the network interface is FPGA networking-enabled. + */ + @JsonProperty(value = "enableFpga") + private Boolean enableFpga; + + /* + * The network security group. + */ + @JsonProperty(value = "networkSecurityGroup") + private SubResource networkSecurityGroup; + + /* + * The dns settings to be applied on the network interfaces. + */ + @JsonProperty(value = "dnsSettings") + private VirtualMachineScaleSetNetworkConfigurationDnsSettings dnsSettings; + + /* + * The virtual machine scale set IP Configuration. + */ + @JsonProperty(value = "ipConfigurations") + private List ipConfigurations; + + /* + * Whether IP forwarding enabled on this NIC. + */ + @JsonProperty(value = "enableIPForwarding") + private Boolean enableIpForwarding; + + /* + * Specify what happens to the network interface when the VM is deleted + */ + @JsonProperty(value = "deleteOption") + private DeleteOptions deleteOption; + + /** Creates an instance of VirtualMachineScaleSetUpdateNetworkConfigurationProperties class. */ + public VirtualMachineScaleSetUpdateNetworkConfigurationProperties() { + } + + /** + * 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 VirtualMachineScaleSetUpdateNetworkConfigurationProperties object itself. + */ + public VirtualMachineScaleSetUpdateNetworkConfigurationProperties 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 VirtualMachineScaleSetUpdateNetworkConfigurationProperties object itself. + */ + public VirtualMachineScaleSetUpdateNetworkConfigurationProperties withEnableAcceleratedNetworking( + Boolean enableAcceleratedNetworking) { + this.enableAcceleratedNetworking = enableAcceleratedNetworking; + return this; + } + + /** + * Get the disableTcpStateTracking property: Specifies whether the network interface is disabled for tcp state + * tracking. + * + * @return the disableTcpStateTracking value. + */ + public Boolean disableTcpStateTracking() { + return this.disableTcpStateTracking; + } + + /** + * Set the disableTcpStateTracking property: Specifies whether the network interface is disabled for tcp state + * tracking. + * + * @param disableTcpStateTracking the disableTcpStateTracking value to set. + * @return the VirtualMachineScaleSetUpdateNetworkConfigurationProperties object itself. + */ + public VirtualMachineScaleSetUpdateNetworkConfigurationProperties withDisableTcpStateTracking( + Boolean disableTcpStateTracking) { + this.disableTcpStateTracking = disableTcpStateTracking; + 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 VirtualMachineScaleSetUpdateNetworkConfigurationProperties object itself. + */ + public VirtualMachineScaleSetUpdateNetworkConfigurationProperties 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 VirtualMachineScaleSetUpdateNetworkConfigurationProperties object itself. + */ + public VirtualMachineScaleSetUpdateNetworkConfigurationProperties 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 VirtualMachineScaleSetUpdateNetworkConfigurationProperties object itself. + */ + public VirtualMachineScaleSetUpdateNetworkConfigurationProperties 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 VirtualMachineScaleSetUpdateNetworkConfigurationProperties object itself. + */ + public VirtualMachineScaleSetUpdateNetworkConfigurationProperties 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 VirtualMachineScaleSetUpdateNetworkConfigurationProperties object itself. + */ + public VirtualMachineScaleSetUpdateNetworkConfigurationProperties withEnableIpForwarding( + Boolean enableIpForwarding) { + this.enableIpForwarding = enableIpForwarding; + return this; + } + + /** + * Get the deleteOption property: Specify what happens to the network interface when the VM is deleted. + * + * @return the deleteOption value. + */ + public DeleteOptions deleteOption() { + return this.deleteOption; + } + + /** + * Set the deleteOption property: Specify what happens to the network interface when the VM is deleted. + * + * @param deleteOption the deleteOption value to set. + * @return the VirtualMachineScaleSetUpdateNetworkConfigurationProperties object itself. + */ + public VirtualMachineScaleSetUpdateNetworkConfigurationProperties withDeleteOption(DeleteOptions deleteOption) { + this.deleteOption = deleteOption; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dnsSettings() != null) { + dnsSettings().validate(); + } + 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/fluent/models/VirtualMachineScaleSetUpdateProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineScaleSetUpdateProperties.java new file mode 100644 index 0000000000000..519c51401bd21 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineScaleSetUpdateProperties.java @@ -0,0 +1,367 @@ +// Copyright (c) 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.resourcemanager.compute.generated.models.AdditionalCapabilities; +import com.azure.resourcemanager.compute.generated.models.AutomaticRepairsPolicy; +import com.azure.resourcemanager.compute.generated.models.PriorityMixPolicy; +import com.azure.resourcemanager.compute.generated.models.ScaleInPolicy; +import com.azure.resourcemanager.compute.generated.models.SpotRestorePolicy; +import com.azure.resourcemanager.compute.generated.models.UpgradePolicy; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetUpdateVMProfile; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the properties of a Virtual Machine Scale Set. */ +@Fluent +public final class VirtualMachineScaleSetUpdateProperties { + /* + * The upgrade policy. + */ + @JsonProperty(value = "upgradePolicy") + private UpgradePolicy upgradePolicy; + + /* + * Policy for automatic repairs. + */ + @JsonProperty(value = "automaticRepairsPolicy") + private AutomaticRepairsPolicy automaticRepairsPolicy; + + /* + * The virtual machine profile. + */ + @JsonProperty(value = "virtualMachineProfile") + private VirtualMachineScaleSetUpdateVMProfile virtualMachineProfile; + + /* + * Specifies whether the Virtual Machine Scale Set should be overprovisioned. + */ + @JsonProperty(value = "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 = "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 = "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 = "additionalCapabilities") + private AdditionalCapabilities additionalCapabilities; + + /* + * Specifies the policies applied when scaling in Virtual Machines in the Virtual Machine Scale Set. + */ + @JsonProperty(value = "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 = "proximityPlacementGroup") + private SubResource proximityPlacementGroup; + + /* + * Specifies the desired targets for mixing Spot and Regular priority VMs within the same VMSS Flex instance. + */ + @JsonProperty(value = "priorityMixPolicy") + private PriorityMixPolicy priorityMixPolicy; + + /* + * Specifies the Spot Restore properties for the virtual machine scale set. + */ + @JsonProperty(value = "spotRestorePolicy") + private SpotRestorePolicy spotRestorePolicy; + + /** Creates an instance of VirtualMachineScaleSetUpdateProperties class. */ + public VirtualMachineScaleSetUpdateProperties() { + } + + /** + * 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 VirtualMachineScaleSetUpdateProperties object itself. + */ + public VirtualMachineScaleSetUpdateProperties 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 VirtualMachineScaleSetUpdateProperties object itself. + */ + public VirtualMachineScaleSetUpdateProperties 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 VirtualMachineScaleSetUpdateProperties object itself. + */ + public VirtualMachineScaleSetUpdateProperties 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 VirtualMachineScaleSetUpdateProperties object itself. + */ + public VirtualMachineScaleSetUpdateProperties 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 VirtualMachineScaleSetUpdateProperties object itself. + */ + public VirtualMachineScaleSetUpdateProperties 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 VirtualMachineScaleSetUpdateProperties object itself. + */ + public VirtualMachineScaleSetUpdateProperties 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 VirtualMachineScaleSetUpdateProperties object itself. + */ + public VirtualMachineScaleSetUpdateProperties withAdditionalCapabilities( + AdditionalCapabilities additionalCapabilities) { + this.additionalCapabilities = additionalCapabilities; + return this; + } + + /** + * Get the scaleInPolicy property: Specifies the policies applied when scaling in Virtual Machines in the Virtual + * Machine Scale Set. + * + * @return the scaleInPolicy value. + */ + public ScaleInPolicy scaleInPolicy() { + return this.scaleInPolicy; + } + + /** + * Set the scaleInPolicy property: Specifies the policies applied when scaling in Virtual Machines in the Virtual + * Machine Scale Set. + * + * @param scaleInPolicy the scaleInPolicy value to set. + * @return the VirtualMachineScaleSetUpdateProperties object itself. + */ + public VirtualMachineScaleSetUpdateProperties 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 VirtualMachineScaleSetUpdateProperties object itself. + */ + public VirtualMachineScaleSetUpdateProperties withProximityPlacementGroup(SubResource proximityPlacementGroup) { + this.proximityPlacementGroup = proximityPlacementGroup; + return this; + } + + /** + * Get the priorityMixPolicy property: Specifies the desired targets for mixing Spot and Regular priority VMs within + * the same VMSS Flex instance. + * + * @return the priorityMixPolicy value. + */ + public PriorityMixPolicy priorityMixPolicy() { + return this.priorityMixPolicy; + } + + /** + * Set the priorityMixPolicy property: Specifies the desired targets for mixing Spot and Regular priority VMs within + * the same VMSS Flex instance. + * + * @param priorityMixPolicy the priorityMixPolicy value to set. + * @return the VirtualMachineScaleSetUpdateProperties object itself. + */ + public VirtualMachineScaleSetUpdateProperties withPriorityMixPolicy(PriorityMixPolicy priorityMixPolicy) { + this.priorityMixPolicy = priorityMixPolicy; + return this; + } + + /** + * Get the spotRestorePolicy property: Specifies the Spot Restore properties for the virtual machine scale set. + * + * @return the spotRestorePolicy value. + */ + public SpotRestorePolicy spotRestorePolicy() { + return this.spotRestorePolicy; + } + + /** + * Set the spotRestorePolicy property: Specifies the Spot Restore properties for the virtual machine scale set. + * + * @param spotRestorePolicy the spotRestorePolicy value to set. + * @return the VirtualMachineScaleSetUpdateProperties object itself. + */ + public VirtualMachineScaleSetUpdateProperties withSpotRestorePolicy(SpotRestorePolicy spotRestorePolicy) { + this.spotRestorePolicy = spotRestorePolicy; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (upgradePolicy() != null) { + upgradePolicy().validate(); + } + if (automaticRepairsPolicy() != null) { + automaticRepairsPolicy().validate(); + } + if (virtualMachineProfile() != null) { + virtualMachineProfile().validate(); + } + if (additionalCapabilities() != null) { + additionalCapabilities().validate(); + } + if (scaleInPolicy() != null) { + scaleInPolicy().validate(); + } + if (priorityMixPolicy() != null) { + priorityMixPolicy().validate(); + } + if (spotRestorePolicy() != null) { + spotRestorePolicy().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineScaleSetUpdatePublicIpAddressConfigurationProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineScaleSetUpdatePublicIpAddressConfigurationProperties.java new file mode 100644 index 0000000000000..ebbb7040b0081 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineScaleSetUpdatePublicIpAddressConfigurationProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.compute.generated.models.DeleteOptions; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a virtual machines scale set IP Configuration's PublicIPAddress configuration. */ +@Fluent +public final class VirtualMachineScaleSetUpdatePublicIpAddressConfigurationProperties { + /* + * The idle timeout of the public IP address. + */ + @JsonProperty(value = "idleTimeoutInMinutes") + private Integer idleTimeoutInMinutes; + + /* + * The dns settings to be applied on the publicIP addresses . + */ + @JsonProperty(value = "dnsSettings") + private VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings dnsSettings; + + /* + * The PublicIPPrefix from which to allocate publicIP addresses. + */ + @JsonProperty(value = "publicIPPrefix") + private SubResource publicIpPrefix; + + /* + * Specify what happens to the public IP when the VM is deleted + */ + @JsonProperty(value = "deleteOption") + private DeleteOptions deleteOption; + + /** Creates an instance of VirtualMachineScaleSetUpdatePublicIpAddressConfigurationProperties class. */ + public VirtualMachineScaleSetUpdatePublicIpAddressConfigurationProperties() { + } + + /** + * 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 VirtualMachineScaleSetUpdatePublicIpAddressConfigurationProperties object itself. + */ + public VirtualMachineScaleSetUpdatePublicIpAddressConfigurationProperties 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 VirtualMachineScaleSetUpdatePublicIpAddressConfigurationProperties object itself. + */ + public VirtualMachineScaleSetUpdatePublicIpAddressConfigurationProperties withDnsSettings( + VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings dnsSettings) { + this.dnsSettings = dnsSettings; + 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 VirtualMachineScaleSetUpdatePublicIpAddressConfigurationProperties object itself. + */ + public VirtualMachineScaleSetUpdatePublicIpAddressConfigurationProperties withPublicIpPrefix( + SubResource publicIpPrefix) { + this.publicIpPrefix = publicIpPrefix; + return this; + } + + /** + * Get the deleteOption property: Specify what happens to the public IP when the VM is deleted. + * + * @return the deleteOption value. + */ + public DeleteOptions deleteOption() { + return this.deleteOption; + } + + /** + * Set the deleteOption property: Specify what happens to the public IP when the VM is deleted. + * + * @param deleteOption the deleteOption value to set. + * @return the VirtualMachineScaleSetUpdatePublicIpAddressConfigurationProperties object itself. + */ + public VirtualMachineScaleSetUpdatePublicIpAddressConfigurationProperties withDeleteOption( + DeleteOptions deleteOption) { + this.deleteOption = deleteOption; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dnsSettings() != null) { + dnsSettings().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/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..11b64f93687db --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineScaleSetVMExtensionInner.java @@ -0,0 +1,408 @@ +// Copyright (c) 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.resourcemanager.compute.generated.models.KeyVaultSecretReference; +import com.azure.resourcemanager.compute.generated.models.SubResourceReadOnly; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineExtensionInstanceView; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a VMSS VM Extension. */ +@Fluent +public final class VirtualMachineScaleSetVMExtensionInner extends SubResourceReadOnly { + /* + * 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; + + /* + * The location of the extension. + */ + @JsonProperty(value = "location") + private String location; + + /* + * Describes the properties of a Virtual Machine Extension. + */ + @JsonProperty(value = "properties") + private VirtualMachineExtensionProperties innerProperties; + + /** Creates an instance of VirtualMachineScaleSetVMExtensionInner class. */ + public VirtualMachineScaleSetVMExtensionInner() { + } + + /** + * 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 location property: The location of the extension. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The location of the extension. + * + * @param location the location value to set. + * @return the VirtualMachineScaleSetVMExtensionInner object itself. + */ + public VirtualMachineScaleSetVMExtensionInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the innerProperties property: Describes the properties of a Virtual Machine Extension. + * + * @return the innerProperties value. + */ + private VirtualMachineExtensionProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineExtensionProperties(); + } + this.innerProperties().withForceUpdateTag(forceUpdateTag); + return this; + } + + /** + * Get the publisher property: The name of the extension handler publisher. + * + * @return the publisher value. + */ + public String publisher() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineExtensionProperties(); + } + this.innerProperties().withPublisher(publisher); + return this; + } + + /** + * Get the type property: Specifies the type of the extension; an example is "CustomScriptExtension". + * + * @return the type value. + */ + public String typePropertiesType() { + return this.innerProperties() == null ? null : this.innerProperties().type(); + } + + /** + * Set the type property: Specifies the type of the extension; an example is "CustomScriptExtension". + * + * @param type the type value to set. + * @return the VirtualMachineScaleSetVMExtensionInner object itself. + */ + public VirtualMachineScaleSetVMExtensionInner withTypePropertiesType(String type) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineExtensionProperties(); + } + this.innerProperties().withType(type); + return this; + } + + /** + * Get the typeHandlerVersion property: Specifies the version of the script handler. + * + * @return the typeHandlerVersion value. + */ + public String typeHandlerVersion() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineExtensionProperties(); + } + this.innerProperties().withTypeHandlerVersion(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineExtensionProperties(); + } + this.innerProperties().withAutoUpgradeMinorVersion(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineExtensionProperties(); + } + this.innerProperties().withEnableAutomaticUpgrade(enableAutomaticUpgrade); + return this; + } + + /** + * Get the settings property: Json formatted public settings for the extension. + * + * @return the settings value. + */ + public Object settings() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineExtensionProperties(); + } + this.innerProperties().withSettings(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineExtensionProperties(); + } + this.innerProperties().withProtectedSettings(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.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the instanceView property: The virtual machine extension instance view. + * + * @return the instanceView value. + */ + public VirtualMachineExtensionInstanceView instanceView() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineExtensionProperties(); + } + this.innerProperties().withInstanceView(instanceView); + return this; + } + + /** + * Get the suppressFailures property: Indicates whether failures stemming from the extension will be suppressed + * (Operational failures such as not connecting to the VM will not be suppressed regardless of this value). The + * default is false. + * + * @return the suppressFailures value. + */ + public Boolean suppressFailures() { + return this.innerProperties() == null ? null : this.innerProperties().suppressFailures(); + } + + /** + * Set the suppressFailures property: Indicates whether failures stemming from the extension will be suppressed + * (Operational failures such as not connecting to the VM will not be suppressed regardless of this value). The + * default is false. + * + * @param suppressFailures the suppressFailures value to set. + * @return the VirtualMachineScaleSetVMExtensionInner object itself. + */ + public VirtualMachineScaleSetVMExtensionInner withSuppressFailures(Boolean suppressFailures) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineExtensionProperties(); + } + this.innerProperties().withSuppressFailures(suppressFailures); + return this; + } + + /** + * Get the protectedSettingsFromKeyVault property: The extensions protected settings that are passed by reference, + * and consumed from key vault. + * + * @return the protectedSettingsFromKeyVault value. + */ + public KeyVaultSecretReference protectedSettingsFromKeyVault() { + return this.innerProperties() == null ? null : this.innerProperties().protectedSettingsFromKeyVault(); + } + + /** + * Set the protectedSettingsFromKeyVault property: The extensions protected settings that are passed by reference, + * and consumed from key vault. + * + * @param protectedSettingsFromKeyVault the protectedSettingsFromKeyVault value to set. + * @return the VirtualMachineScaleSetVMExtensionInner object itself. + */ + public VirtualMachineScaleSetVMExtensionInner withProtectedSettingsFromKeyVault( + KeyVaultSecretReference protectedSettingsFromKeyVault) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineExtensionProperties(); + } + this.innerProperties().withProtectedSettingsFromKeyVault(protectedSettingsFromKeyVault); + return this; + } + + /** + * 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.innerProperties() == null ? null : this.innerProperties().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 VirtualMachineScaleSetVMExtensionInner object itself. + */ + public VirtualMachineScaleSetVMExtensionInner withProvisionAfterExtensions(List provisionAfterExtensions) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineExtensionProperties(); + } + this.innerProperties().withProvisionAfterExtensions(provisionAfterExtensions); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().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..1ae9397943365 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineScaleSetVMExtensionsListResultInner.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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List VMSS VM Extension operation response. */ +@Fluent +public final class VirtualMachineScaleSetVMExtensionsListResultInner { + /* + * The list of VMSS VM extensions + */ + @JsonProperty(value = "value") + private List value; + + /** Creates an instance of VirtualMachineScaleSetVMExtensionsListResultInner class. */ + public VirtualMachineScaleSetVMExtensionsListResultInner() { + } + + /** + * 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..f01b2498d378c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineScaleSetVMInner.java @@ -0,0 +1,577 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SubResource; +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.VirtualMachineIdentity; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMNetworkProfileConfiguration; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMProtectionPolicy; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** Describes a virtual machine scale set virtual machine. */ +@Fluent +public final class VirtualMachineScaleSetVMInner extends Resource { + /* + * 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; + + /* + * Describes the properties of a virtual machine scale set virtual machine. + */ + @JsonProperty(value = "properties") + private VirtualMachineScaleSetVMPropertiesInner innerProperties; + + /* + * 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; + + /* + * The identity of the virtual machine, if configured. + */ + @JsonProperty(value = "identity") + private VirtualMachineIdentity identity; + + /** Creates an instance of VirtualMachineScaleSetVMInner class. */ + public VirtualMachineScaleSetVMInner() { + } + + /** + * 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 innerProperties property: Describes the properties of a virtual machine scale set virtual machine. + * + * @return the innerProperties value. + */ + private VirtualMachineScaleSetVMPropertiesInner innerProperties() { + return this.innerProperties; + } + + /** + * 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 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 VirtualMachineScaleSetVMInner object itself. + */ + public VirtualMachineScaleSetVMInner withIdentity(VirtualMachineIdentity identity) { + this.identity = identity; + 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; + } + + /** + * 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.innerProperties() == null ? null : this.innerProperties().latestModelApplied(); + } + + /** + * Get the vmId property: Azure VM unique ID. + * + * @return the vmId value. + */ + public String vmId() { + return this.innerProperties() == null ? null : this.innerProperties().vmId(); + } + + /** + * Get the instanceView property: The virtual machine instance view. + * + * @return the instanceView value. + */ + public VirtualMachineScaleSetVMInstanceViewInner instanceView() { + return this.innerProperties() == null ? null : this.innerProperties().instanceView(); + } + + /** + * Get the hardwareProfile property: Specifies the hardware settings for the virtual machine. + * + * @return the hardwareProfile value. + */ + public HardwareProfile hardwareProfile() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetVMPropertiesInner(); + } + this.innerProperties().withHardwareProfile(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetVMPropertiesInner(); + } + this.innerProperties().withStorageProfile(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetVMPropertiesInner(); + } + this.innerProperties().withAdditionalCapabilities(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetVMPropertiesInner(); + } + this.innerProperties().withOsProfile(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetVMPropertiesInner(); + } + this.innerProperties().withSecurityProfile(securityProfile); + return this; + } + + /** + * Get the networkProfile property: Specifies the network interfaces of the virtual machine. + * + * @return the networkProfile value. + */ + public NetworkProfile networkProfile() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetVMPropertiesInner(); + } + this.innerProperties().withNetworkProfile(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetVMPropertiesInner(); + } + this.innerProperties().withNetworkProfileConfiguration(networkProfileConfiguration); + return this; + } + + /** + * Get the diagnosticsProfile property: Specifies the boot diagnostic settings state. Minimum api-version: + * 2015-06-15. + * + * @return the diagnosticsProfile value. + */ + public DiagnosticsProfile diagnosticsProfile() { + return this.innerProperties() == null ? null : this.innerProperties().diagnosticsProfile(); + } + + /** + * Set the diagnosticsProfile property: Specifies the boot diagnostic settings state. Minimum api-version: + * 2015-06-15. + * + * @param diagnosticsProfile the diagnosticsProfile value to set. + * @return the VirtualMachineScaleSetVMInner object itself. + */ + public VirtualMachineScaleSetVMInner withDiagnosticsProfile(DiagnosticsProfile diagnosticsProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetVMPropertiesInner(); + } + this.innerProperties().withDiagnosticsProfile(diagnosticsProfile); + return this; + } + + /** + * Get the availabilitySet property: Specifies information about the availability set that the virtual machine + * should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes + * to maximize availability. For more information about availability sets, see [Availability sets + * overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). For more information on + * Azure planned maintenance, see [Maintenance and updates for Virtual Machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates). Currently, a VM can only be + * added to availability set at creation time. An existing VM cannot be added to an availability set. + * + * @return the availabilitySet value. + */ + public SubResource availabilitySet() { + return this.innerProperties() == null ? null : this.innerProperties().availabilitySet(); + } + + /** + * Set the availabilitySet property: Specifies information about the availability set that the virtual machine + * should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes + * to maximize availability. For more information about availability sets, see [Availability sets + * overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). For more information on + * Azure planned maintenance, see [Maintenance and updates for Virtual Machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates). Currently, a VM can only be + * added to availability set at creation time. An existing VM cannot be added to an availability set. + * + * @param availabilitySet the availabilitySet value to set. + * @return the VirtualMachineScaleSetVMInner object itself. + */ + public VirtualMachineScaleSetVMInner withAvailabilitySet(SubResource availabilitySet) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetVMPropertiesInner(); + } + this.innerProperties().withAvailabilitySet(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.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetVMPropertiesInner(); + } + this.innerProperties().withLicenseType(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.innerProperties() == null ? null : this.innerProperties().modelDefinitionApplied(); + } + + /** + * Get the protectionPolicy property: Specifies the protection policy of the virtual machine. + * + * @return the protectionPolicy value. + */ + public VirtualMachineScaleSetVMProtectionPolicy protectionPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetVMPropertiesInner(); + } + this.innerProperties().withProtectionPolicy(protectionPolicy); + return this; + } + + /** + * Get the userData property: UserData for the VM, which must be base-64 encoded. Customer should not pass any + * secrets in here. <br><br>Minimum api-version: 2021-03-01. + * + * @return the userData value. + */ + public String userData() { + return this.innerProperties() == null ? null : this.innerProperties().userData(); + } + + /** + * Set the userData property: UserData for the VM, which must be base-64 encoded. Customer should not pass any + * secrets in here. <br><br>Minimum api-version: 2021-03-01. + * + * @param userData the userData value to set. + * @return the VirtualMachineScaleSetVMInner object itself. + */ + public VirtualMachineScaleSetVMInner withUserData(String userData) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetVMPropertiesInner(); + } + this.innerProperties().withUserData(userData); + return this; + } + + /** + * Get the timeCreated property: Specifies the time at which the Virtual Machine resource was created. + * + * @return the timeCreated value. + */ + public OffsetDateTime timeCreated() { + return this.innerProperties() == null ? null : this.innerProperties().timeCreated(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() != null) { + sku().validate(); + } + if (innerProperties() != null) { + innerProperties().validate(); + } + if (plan() != null) { + plan().validate(); + } + if (resources() != null) { + resources().forEach(e -> e.validate()); + } + if (identity() != null) { + identity().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..653c6b14bb816 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineScaleSetVMInstanceViewInner.java @@ -0,0 +1,473 @@ +// Copyright (c) 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.resourcemanager.compute.generated.models.BootDiagnosticsInstanceView; +import com.azure.resourcemanager.compute.generated.models.DiskInstanceView; +import com.azure.resourcemanager.compute.generated.models.HyperVGeneration; +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.JsonProperty; +import java.util.List; + +/** The instance view of a virtual machine scale set VM. */ +@Fluent +public final class VirtualMachineScaleSetVMInstanceViewInner { + /* + * 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; + + /* + * 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; + + /* + * The Operating System running on the hybrid machine. + */ + @JsonProperty(value = "osName") + private String osName; + + /* + * The version of Operating System running on the hybrid machine. + */ + @JsonProperty(value = "osVersion") + private String osVersion; + + /* + * The hypervisor generation of the Virtual Machine [V1, V2] + */ + @JsonProperty(value = "hyperVGeneration") + private HyperVGeneration hyperVGeneration; + + /** Creates an instance of VirtualMachineScaleSetVMInstanceViewInner class. */ + public VirtualMachineScaleSetVMInstanceViewInner() { + } + + /** + * 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. You can easily view the output of your console log. 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. You can easily view the output of your console log. 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. 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; + } + + /** + * 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 VirtualMachineScaleSetVMInstanceViewInner object itself. + */ + public VirtualMachineScaleSetVMInstanceViewInner withComputerName(String computerName) { + this.computerName = computerName; + return this; + } + + /** + * Get the osName property: The Operating System running on the hybrid machine. + * + * @return the osName value. + */ + public String osName() { + return this.osName; + } + + /** + * Set the osName property: The Operating System running on the hybrid machine. + * + * @param osName the osName value to set. + * @return the VirtualMachineScaleSetVMInstanceViewInner object itself. + */ + public VirtualMachineScaleSetVMInstanceViewInner withOsName(String osName) { + this.osName = osName; + return this; + } + + /** + * Get the osVersion property: The version of Operating System running on the hybrid machine. + * + * @return the osVersion value. + */ + public String osVersion() { + return this.osVersion; + } + + /** + * Set the osVersion property: The version of Operating System running on the hybrid machine. + * + * @param osVersion the osVersion value to set. + * @return the VirtualMachineScaleSetVMInstanceViewInner object itself. + */ + public VirtualMachineScaleSetVMInstanceViewInner withOsVersion(String osVersion) { + this.osVersion = osVersion; + return this; + } + + /** + * Get the hyperVGeneration property: The hypervisor generation of the Virtual Machine [V1, V2]. + * + * @return the hyperVGeneration value. + */ + public HyperVGeneration hyperVGeneration() { + return this.hyperVGeneration; + } + + /** + * Set the hyperVGeneration property: The hypervisor generation of the Virtual Machine [V1, V2]. + * + * @param hyperVGeneration the hyperVGeneration value to set. + * @return the VirtualMachineScaleSetVMInstanceViewInner object itself. + */ + public VirtualMachineScaleSetVMInstanceViewInner withHyperVGeneration(HyperVGeneration hyperVGeneration) { + this.hyperVGeneration = hyperVGeneration; + 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/VirtualMachineScaleSetVMPropertiesInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineScaleSetVMPropertiesInner.java new file mode 100644 index 0000000000000..ebbe307a24761 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineScaleSetVMPropertiesInner.java @@ -0,0 +1,524 @@ +// Copyright (c) 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.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.SecurityProfile; +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.JsonProperty; +import java.time.OffsetDateTime; + +/** Describes the properties of a virtual machine scale set virtual machine. */ +@Fluent +public final class VirtualMachineScaleSetVMPropertiesInner { + /* + * Specifies whether the latest model has been applied to the virtual machine. + */ + @JsonProperty(value = "latestModelApplied", access = JsonProperty.Access.WRITE_ONLY) + private Boolean latestModelApplied; + + /* + * Azure VM unique ID. + */ + @JsonProperty(value = "vmId", access = JsonProperty.Access.WRITE_ONLY) + private String vmId; + + /* + * The virtual machine instance view. + */ + @JsonProperty(value = "instanceView", access = JsonProperty.Access.WRITE_ONLY) + private VirtualMachineScaleSetVMInstanceViewInner instanceView; + + /* + * Specifies the hardware settings for the virtual machine. + */ + @JsonProperty(value = "hardwareProfile") + private HardwareProfile hardwareProfile; + + /* + * Specifies the storage settings for the virtual machine disks. + */ + @JsonProperty(value = "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 = "additionalCapabilities") + private AdditionalCapabilities additionalCapabilities; + + /* + * Specifies the operating system settings for the virtual machine. + */ + @JsonProperty(value = "osProfile") + private OSProfile osProfile; + + /* + * Specifies the Security related profile settings for the virtual machine. + */ + @JsonProperty(value = "securityProfile") + private SecurityProfile securityProfile; + + /* + * Specifies the network interfaces of the virtual machine. + */ + @JsonProperty(value = "networkProfile") + private NetworkProfile networkProfile; + + /* + * Specifies the network profile configuration of the virtual machine. + */ + @JsonProperty(value = "networkProfileConfiguration") + private VirtualMachineScaleSetVMNetworkProfileConfiguration networkProfileConfiguration; + + /* + * Specifies the boot diagnostic settings state. Minimum api-version: 2015-06-15. + */ + @JsonProperty(value = "diagnosticsProfile") + private DiagnosticsProfile diagnosticsProfile; + + /* + * Specifies information about the availability set that the virtual machine should be assigned to. Virtual + * machines specified in the same availability set are allocated to different nodes to maximize availability. For + * more information about availability sets, see [Availability sets + * overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). For more information on + * Azure planned maintenance, see [Maintenance and updates for Virtual Machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates). Currently, a VM can only be + * added to availability set at creation time. An existing VM cannot be added to an availability set. + */ + @JsonProperty(value = "availabilitySet") + private SubResource availabilitySet; + + /* + * The provisioning state, which only appears in the response. + */ + @JsonProperty(value = "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 = "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 = "modelDefinitionApplied", access = JsonProperty.Access.WRITE_ONLY) + private String modelDefinitionApplied; + + /* + * Specifies the protection policy of the virtual machine. + */ + @JsonProperty(value = "protectionPolicy") + private VirtualMachineScaleSetVMProtectionPolicy protectionPolicy; + + /* + * UserData for the VM, which must be base-64 encoded. Customer should not pass any secrets in here. + *

Minimum api-version: 2021-03-01 + */ + @JsonProperty(value = "userData") + private String userData; + + /* + * Specifies the time at which the Virtual Machine resource was created. + */ + @JsonProperty(value = "timeCreated", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime timeCreated; + + /** Creates an instance of VirtualMachineScaleSetVMPropertiesInner class. */ + public VirtualMachineScaleSetVMPropertiesInner() { + } + + /** + * 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 VirtualMachineScaleSetVMPropertiesInner object itself. + */ + public VirtualMachineScaleSetVMPropertiesInner 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 VirtualMachineScaleSetVMPropertiesInner object itself. + */ + public VirtualMachineScaleSetVMPropertiesInner 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 VirtualMachineScaleSetVMPropertiesInner object itself. + */ + public VirtualMachineScaleSetVMPropertiesInner 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 VirtualMachineScaleSetVMPropertiesInner object itself. + */ + public VirtualMachineScaleSetVMPropertiesInner 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 VirtualMachineScaleSetVMPropertiesInner object itself. + */ + public VirtualMachineScaleSetVMPropertiesInner 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 VirtualMachineScaleSetVMPropertiesInner object itself. + */ + public VirtualMachineScaleSetVMPropertiesInner 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 VirtualMachineScaleSetVMPropertiesInner object itself. + */ + public VirtualMachineScaleSetVMPropertiesInner withNetworkProfileConfiguration( + VirtualMachineScaleSetVMNetworkProfileConfiguration networkProfileConfiguration) { + this.networkProfileConfiguration = networkProfileConfiguration; + return this; + } + + /** + * Get the diagnosticsProfile property: Specifies the boot diagnostic settings state. 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. Minimum api-version: + * 2015-06-15. + * + * @param diagnosticsProfile the diagnosticsProfile value to set. + * @return the VirtualMachineScaleSetVMPropertiesInner object itself. + */ + public VirtualMachineScaleSetVMPropertiesInner withDiagnosticsProfile(DiagnosticsProfile diagnosticsProfile) { + this.diagnosticsProfile = diagnosticsProfile; + return this; + } + + /** + * Get the availabilitySet property: Specifies information about the availability set that the virtual machine + * should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes + * to maximize availability. For more information about availability sets, see [Availability sets + * overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). For more information on + * Azure planned maintenance, see [Maintenance and updates for Virtual Machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates). Currently, a VM can only be + * added to availability set at creation time. An existing VM cannot be added to an availability set. + * + * @return the availabilitySet value. + */ + public SubResource availabilitySet() { + return this.availabilitySet; + } + + /** + * Set the availabilitySet property: Specifies information about the availability set that the virtual machine + * should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes + * to maximize availability. For more information about availability sets, see [Availability sets + * overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). For more information on + * Azure planned maintenance, see [Maintenance and updates for Virtual Machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates). Currently, a VM can only be + * added to availability set at creation time. An existing VM cannot be added to an availability set. + * + * @param availabilitySet the availabilitySet value to set. + * @return the VirtualMachineScaleSetVMPropertiesInner object itself. + */ + public VirtualMachineScaleSetVMPropertiesInner 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 VirtualMachineScaleSetVMPropertiesInner object itself. + */ + public VirtualMachineScaleSetVMPropertiesInner 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 VirtualMachineScaleSetVMPropertiesInner object itself. + */ + public VirtualMachineScaleSetVMPropertiesInner withProtectionPolicy( + VirtualMachineScaleSetVMProtectionPolicy protectionPolicy) { + this.protectionPolicy = protectionPolicy; + return this; + } + + /** + * Get the userData property: UserData for the VM, which must be base-64 encoded. Customer should not pass any + * secrets in here. <br><br>Minimum api-version: 2021-03-01. + * + * @return the userData value. + */ + public String userData() { + return this.userData; + } + + /** + * Set the userData property: UserData for the VM, which must be base-64 encoded. Customer should not pass any + * secrets in here. <br><br>Minimum api-version: 2021-03-01. + * + * @param userData the userData value to set. + * @return the VirtualMachineScaleSetVMPropertiesInner object itself. + */ + public VirtualMachineScaleSetVMPropertiesInner withUserData(String userData) { + this.userData = userData; + return this; + } + + /** + * Get the timeCreated property: Specifies the time at which the Virtual Machine resource was created. + * + * @return the timeCreated value. + */ + public OffsetDateTime timeCreated() { + return this.timeCreated; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void 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/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..6ec84fd8fb28b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineSizeInner.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the properties of a VM size. */ +@Fluent +public final class VirtualMachineSizeInner { + /* + * The name of the virtual machine size. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The number of cores supported by the virtual machine size. For Constrained vCPU capable VM sizes, this number + * represents the total vCPUs of quota that the VM uses. For accurate vCPU count, please refer to + * https://docs.microsoft.com/azure/virtual-machines/constrained-vcpu or + * https://docs.microsoft.com/rest/api/compute/resourceskus/list + */ + @JsonProperty(value = "numberOfCores") + private Integer numberOfCores; + + /* + * The OS disk size, in MB, allowed by the virtual machine size. + */ + @JsonProperty(value = "osDiskSizeInMB") + private Integer osDiskSizeInMB; + + /* + * The resource disk size, in MB, allowed by the virtual machine size. + */ + @JsonProperty(value = "resourceDiskSizeInMB") + private Integer resourceDiskSizeInMB; + + /* + * The amount of memory, in MB, supported by the virtual machine size. + */ + @JsonProperty(value = "memoryInMB") + private Integer memoryInMB; + + /* + * The maximum number of data disks that can be attached to the virtual machine size. + */ + @JsonProperty(value = "maxDataDiskCount") + private Integer maxDataDiskCount; + + /** Creates an instance of VirtualMachineSizeInner class. */ + public VirtualMachineSizeInner() { + } + + /** + * Get the name property: The name of the virtual machine size. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the virtual machine size. + * + * @param name the name value to set. + * @return the VirtualMachineSizeInner object itself. + */ + public VirtualMachineSizeInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the numberOfCores property: The number of cores supported by the virtual machine size. For Constrained vCPU + * capable VM sizes, this number represents the total vCPUs of quota that the VM uses. For accurate vCPU count, + * please refer to https://docs.microsoft.com/azure/virtual-machines/constrained-vcpu or + * https://docs.microsoft.com/rest/api/compute/resourceskus/list. + * + * @return the numberOfCores value. + */ + public Integer numberOfCores() { + return this.numberOfCores; + } + + /** + * Set the numberOfCores property: The number of cores supported by the virtual machine size. For Constrained vCPU + * capable VM sizes, this number represents the total vCPUs of quota that the VM uses. For accurate vCPU count, + * please refer to https://docs.microsoft.com/azure/virtual-machines/constrained-vcpu or + * https://docs.microsoft.com/rest/api/compute/resourceskus/list. + * + * @param numberOfCores the numberOfCores value to set. + * @return the VirtualMachineSizeInner object itself. + */ + public VirtualMachineSizeInner withNumberOfCores(Integer numberOfCores) { + this.numberOfCores = numberOfCores; + return this; + } + + /** + * Get the osDiskSizeInMB property: The OS disk size, in MB, allowed by the virtual machine size. + * + * @return the osDiskSizeInMB value. + */ + public Integer osDiskSizeInMB() { + return this.osDiskSizeInMB; + } + + /** + * Set the osDiskSizeInMB property: The OS disk size, in MB, allowed by the virtual machine size. + * + * @param osDiskSizeInMB the osDiskSizeInMB value to set. + * @return the VirtualMachineSizeInner object itself. + */ + public VirtualMachineSizeInner withOsDiskSizeInMB(Integer osDiskSizeInMB) { + this.osDiskSizeInMB = osDiskSizeInMB; + return this; + } + + /** + * Get the resourceDiskSizeInMB property: The resource disk size, in MB, allowed by the virtual machine size. + * + * @return the resourceDiskSizeInMB value. + */ + public Integer resourceDiskSizeInMB() { + return this.resourceDiskSizeInMB; + } + + /** + * Set the resourceDiskSizeInMB property: The resource disk size, in MB, allowed by the virtual machine size. + * + * @param resourceDiskSizeInMB the resourceDiskSizeInMB value to set. + * @return the VirtualMachineSizeInner object itself. + */ + public VirtualMachineSizeInner withResourceDiskSizeInMB(Integer resourceDiskSizeInMB) { + this.resourceDiskSizeInMB = resourceDiskSizeInMB; + return this; + } + + /** + * Get the memoryInMB property: The amount of memory, in MB, supported by the virtual machine size. + * + * @return the memoryInMB value. + */ + public Integer memoryInMB() { + return this.memoryInMB; + } + + /** + * Set the memoryInMB property: The amount of memory, in MB, supported by the virtual machine size. + * + * @param memoryInMB the memoryInMB value to set. + * @return the VirtualMachineSizeInner object itself. + */ + public VirtualMachineSizeInner withMemoryInMB(Integer memoryInMB) { + this.memoryInMB = memoryInMB; + return this; + } + + /** + * Get the maxDataDiskCount property: The maximum number of data disks that can be attached to the virtual machine + * size. + * + * @return the maxDataDiskCount value. + */ + public Integer maxDataDiskCount() { + return this.maxDataDiskCount; + } + + /** + * Set the maxDataDiskCount property: The maximum number of data disks that can be attached to the virtual machine + * size. + * + * @param maxDataDiskCount the maxDataDiskCount value to set. + * @return the VirtualMachineSizeInner object itself. + */ + public VirtualMachineSizeInner withMaxDataDiskCount(Integer maxDataDiskCount) { + this.maxDataDiskCount = maxDataDiskCount; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineUpdateInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineUpdateInner.java new file mode 100644 index 0000000000000..6bc4c7d6af2d0 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineUpdateInner.java @@ -0,0 +1,790 @@ +// Copyright (c) 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.resourcemanager.compute.generated.models.AdditionalCapabilities; +import com.azure.resourcemanager.compute.generated.models.ApplicationProfile; +import com.azure.resourcemanager.compute.generated.models.BillingProfile; +import com.azure.resourcemanager.compute.generated.models.CapacityReservationProfile; +import com.azure.resourcemanager.compute.generated.models.DiagnosticsProfile; +import com.azure.resourcemanager.compute.generated.models.HardwareProfile; +import com.azure.resourcemanager.compute.generated.models.NetworkProfile; +import com.azure.resourcemanager.compute.generated.models.OSProfile; +import com.azure.resourcemanager.compute.generated.models.Plan; +import com.azure.resourcemanager.compute.generated.models.ScheduledEventsProfile; +import com.azure.resourcemanager.compute.generated.models.SecurityProfile; +import com.azure.resourcemanager.compute.generated.models.StorageProfile; +import com.azure.resourcemanager.compute.generated.models.UpdateResource; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineEvictionPolicyTypes; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineIdentity; +import com.azure.resourcemanager.compute.generated.models.VirtualMachinePriorityTypes; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** Describes a Virtual Machine Update. */ +@Fluent +public final class VirtualMachineUpdateInner extends UpdateResource { + /* + * 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; + + /* + * Describes the properties of a Virtual Machine. + */ + @JsonProperty(value = "properties") + private VirtualMachinePropertiesInner innerProperties; + + /* + * The identity of the virtual machine, if configured. + */ + @JsonProperty(value = "identity") + private VirtualMachineIdentity identity; + + /* + * The virtual machine zones. + */ + @JsonProperty(value = "zones") + private List zones; + + /** Creates an instance of VirtualMachineUpdateInner class. */ + public VirtualMachineUpdateInner() { + } + + /** + * 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 innerProperties property: Describes the properties of a Virtual Machine. + * + * @return the innerProperties value. + */ + private VirtualMachinePropertiesInner innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** {@inheritDoc} */ + @Override + public VirtualMachineUpdateInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the hardwareProfile property: Specifies the hardware settings for the virtual machine. + * + * @return the hardwareProfile value. + */ + public HardwareProfile hardwareProfile() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachinePropertiesInner(); + } + this.innerProperties().withHardwareProfile(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachinePropertiesInner(); + } + this.innerProperties().withStorageProfile(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachinePropertiesInner(); + } + this.innerProperties().withAdditionalCapabilities(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachinePropertiesInner(); + } + this.innerProperties().withOsProfile(osProfile); + return this; + } + + /** + * Get the networkProfile property: Specifies the network interfaces of the virtual machine. + * + * @return the networkProfile value. + */ + public NetworkProfile networkProfile() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachinePropertiesInner(); + } + this.innerProperties().withNetworkProfile(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachinePropertiesInner(); + } + this.innerProperties().withSecurityProfile(securityProfile); + return this; + } + + /** + * Get the diagnosticsProfile property: Specifies the boot diagnostic settings state. Minimum api-version: + * 2015-06-15. + * + * @return the diagnosticsProfile value. + */ + public DiagnosticsProfile diagnosticsProfile() { + return this.innerProperties() == null ? null : this.innerProperties().diagnosticsProfile(); + } + + /** + * Set the diagnosticsProfile property: Specifies the boot diagnostic settings state. Minimum api-version: + * 2015-06-15. + * + * @param diagnosticsProfile the diagnosticsProfile value to set. + * @return the VirtualMachineUpdateInner object itself. + */ + public VirtualMachineUpdateInner withDiagnosticsProfile(DiagnosticsProfile diagnosticsProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachinePropertiesInner(); + } + this.innerProperties().withDiagnosticsProfile(diagnosticsProfile); + return this; + } + + /** + * Get the availabilitySet property: Specifies information about the availability set that the virtual machine + * should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes + * to maximize availability. For more information about availability sets, see [Availability sets + * overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). For more information on + * Azure planned maintenance, see [Maintenance and updates for Virtual Machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates). Currently, a VM can only be + * added to availability set at creation time. The availability set to which the VM is being added should be under + * the same resource group as the availability set resource. An existing VM cannot be added to an availability set. + * This property cannot exist along with a non-null properties.virtualMachineScaleSet reference. + * + * @return the availabilitySet value. + */ + public SubResource availabilitySet() { + return this.innerProperties() == null ? null : this.innerProperties().availabilitySet(); + } + + /** + * Set the availabilitySet property: Specifies information about the availability set that the virtual machine + * should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes + * to maximize availability. For more information about availability sets, see [Availability sets + * overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). For more information on + * Azure planned maintenance, see [Maintenance and updates for Virtual Machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates). Currently, a VM can only be + * added to availability set at creation time. The availability set to which the VM is being added should be under + * the same resource group as the availability set resource. An existing VM cannot be added to an availability set. + * This property cannot exist along with a non-null properties.virtualMachineScaleSet reference. + * + * @param availabilitySet the availabilitySet value to set. + * @return the VirtualMachineUpdateInner object itself. + */ + public VirtualMachineUpdateInner withAvailabilitySet(SubResource availabilitySet) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachinePropertiesInner(); + } + this.innerProperties().withAvailabilitySet(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. This property cannot exist + * along with a non-null properties.availabilitySet reference. Minimum api‐version: 2019‐03‐01. + * + * @return the virtualMachineScaleSet value. + */ + public SubResource virtualMachineScaleSet() { + return this.innerProperties() == null ? null : this.innerProperties().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. This property cannot exist + * along with a non-null properties.availabilitySet reference. Minimum api‐version: 2019‐03‐01. + * + * @param virtualMachineScaleSet the virtualMachineScaleSet value to set. + * @return the VirtualMachineUpdateInner object itself. + */ + public VirtualMachineUpdateInner withVirtualMachineScaleSet(SubResource virtualMachineScaleSet) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachinePropertiesInner(); + } + this.innerProperties().withVirtualMachineScaleSet(virtualMachineScaleSet); + return this; + } + + /** + * Get the proximityPlacementGroup property: Specifies information about the proximity placement group that the + * virtual machine should be assigned to. Minimum api-version: 2018-04-01. + * + * @return the proximityPlacementGroup value. + */ + public SubResource proximityPlacementGroup() { + return this.innerProperties() == null ? null : this.innerProperties().proximityPlacementGroup(); + } + + /** + * Set the proximityPlacementGroup property: Specifies information about the proximity placement group that the + * virtual machine should be assigned to. Minimum api-version: 2018-04-01. + * + * @param proximityPlacementGroup the proximityPlacementGroup value to set. + * @return the VirtualMachineUpdateInner object itself. + */ + public VirtualMachineUpdateInner withProximityPlacementGroup(SubResource proximityPlacementGroup) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachinePropertiesInner(); + } + this.innerProperties().withProximityPlacementGroup(proximityPlacementGroup); + return this; + } + + /** + * Get the priority property: Specifies the priority for the virtual machine. Minimum api-version: 2019-03-01. + * + * @return the priority value. + */ + public VirtualMachinePriorityTypes priority() { + return this.innerProperties() == null ? null : this.innerProperties().priority(); + } + + /** + * Set the priority property: Specifies the priority for the virtual machine. Minimum api-version: 2019-03-01. + * + * @param priority the priority value to set. + * @return the VirtualMachineUpdateInner object itself. + */ + public VirtualMachineUpdateInner withPriority(VirtualMachinePriorityTypes priority) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachinePropertiesInner(); + } + this.innerProperties().withPriority(priority); + return this; + } + + /** + * Get the evictionPolicy property: 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. + * + * @return the evictionPolicy value. + */ + public VirtualMachineEvictionPolicyTypes evictionPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().evictionPolicy(); + } + + /** + * Set the evictionPolicy property: 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. + * + * @param evictionPolicy the evictionPolicy value to set. + * @return the VirtualMachineUpdateInner object itself. + */ + public VirtualMachineUpdateInner withEvictionPolicy(VirtualMachineEvictionPolicyTypes evictionPolicy) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachinePropertiesInner(); + } + this.innerProperties().withEvictionPolicy(evictionPolicy); + return this; + } + + /** + * Get the billingProfile property: Specifies the billing related details of a Azure Spot virtual machine. Minimum + * api-version: 2019-03-01. + * + * @return the billingProfile value. + */ + public BillingProfile billingProfile() { + return this.innerProperties() == null ? null : this.innerProperties().billingProfile(); + } + + /** + * Set the billingProfile property: Specifies the billing related details of a Azure Spot virtual machine. Minimum + * api-version: 2019-03-01. + * + * @param billingProfile the billingProfile value to set. + * @return the VirtualMachineUpdateInner object itself. + */ + public VirtualMachineUpdateInner withBillingProfile(BillingProfile billingProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachinePropertiesInner(); + } + this.innerProperties().withBillingProfile(billingProfile); + return this; + } + + /** + * Get the host property: Specifies information about the dedicated host that the virtual machine resides in. + * Minimum api-version: 2018-10-01. + * + * @return the host value. + */ + public SubResource host() { + return this.innerProperties() == null ? null : this.innerProperties().host(); + } + + /** + * Set the host property: Specifies information about the dedicated host that the virtual machine resides in. + * Minimum api-version: 2018-10-01. + * + * @param host the host value to set. + * @return the VirtualMachineUpdateInner object itself. + */ + public VirtualMachineUpdateInner withHost(SubResource host) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachinePropertiesInner(); + } + this.innerProperties().withHost(host); + return this; + } + + /** + * Get the hostGroup property: Specifies information about the dedicated host group that the virtual machine resides + * in. **Note:** User cannot specify both host and hostGroup properties. Minimum api-version: 2020-06-01. + * + * @return the hostGroup value. + */ + public SubResource hostGroup() { + return this.innerProperties() == null ? null : this.innerProperties().hostGroup(); + } + + /** + * Set the hostGroup property: Specifies information about the dedicated host group that the virtual machine resides + * in. **Note:** User cannot specify both host and hostGroup properties. Minimum api-version: 2020-06-01. + * + * @param hostGroup the hostGroup value to set. + * @return the VirtualMachineUpdateInner object itself. + */ + public VirtualMachineUpdateInner withHostGroup(SubResource hostGroup) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachinePropertiesInner(); + } + this.innerProperties().withHostGroup(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.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the instanceView property: The virtual machine instance view. + * + * @return the instanceView value. + */ + public VirtualMachineInstanceViewInner instanceView() { + return this.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachinePropertiesInner(); + } + this.innerProperties().withLicenseType(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.innerProperties() == null ? null : this.innerProperties().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). Minimum api-version: 2020-06-01. + * + * @return the extensionsTimeBudget value. + */ + public String extensionsTimeBudget() { + return this.innerProperties() == null ? null : this.innerProperties().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). Minimum api-version: 2020-06-01. + * + * @param extensionsTimeBudget the extensionsTimeBudget value to set. + * @return the VirtualMachineUpdateInner object itself. + */ + public VirtualMachineUpdateInner withExtensionsTimeBudget(String extensionsTimeBudget) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachinePropertiesInner(); + } + this.innerProperties().withExtensionsTimeBudget(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. 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' greater than 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. + * + * @return the platformFaultDomain value. + */ + public Integer platformFaultDomain() { + return this.innerProperties() == null ? null : this.innerProperties().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. 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' greater than 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. + * + * @param platformFaultDomain the platformFaultDomain value to set. + * @return the VirtualMachineUpdateInner object itself. + */ + public VirtualMachineUpdateInner withPlatformFaultDomain(Integer platformFaultDomain) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachinePropertiesInner(); + } + this.innerProperties().withPlatformFaultDomain(platformFaultDomain); + return this; + } + + /** + * Get the scheduledEventsProfile property: Specifies Scheduled Event related configurations. + * + * @return the scheduledEventsProfile value. + */ + public ScheduledEventsProfile scheduledEventsProfile() { + return this.innerProperties() == null ? null : this.innerProperties().scheduledEventsProfile(); + } + + /** + * Set the scheduledEventsProfile property: Specifies Scheduled Event related configurations. + * + * @param scheduledEventsProfile the scheduledEventsProfile value to set. + * @return the VirtualMachineUpdateInner object itself. + */ + public VirtualMachineUpdateInner withScheduledEventsProfile(ScheduledEventsProfile scheduledEventsProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachinePropertiesInner(); + } + this.innerProperties().withScheduledEventsProfile(scheduledEventsProfile); + return this; + } + + /** + * Get the userData property: UserData for the VM, which must be base-64 encoded. Customer should not pass any + * secrets in here. Minimum api-version: 2021-03-01. + * + * @return the userData value. + */ + public String userData() { + return this.innerProperties() == null ? null : this.innerProperties().userData(); + } + + /** + * Set the userData property: UserData for the VM, which must be base-64 encoded. Customer should not pass any + * secrets in here. Minimum api-version: 2021-03-01. + * + * @param userData the userData value to set. + * @return the VirtualMachineUpdateInner object itself. + */ + public VirtualMachineUpdateInner withUserData(String userData) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachinePropertiesInner(); + } + this.innerProperties().withUserData(userData); + return this; + } + + /** + * Get the capacityReservation property: Specifies information about the capacity reservation that is used to + * allocate virtual machine. Minimum api-version: 2021-04-01. + * + * @return the capacityReservation value. + */ + public CapacityReservationProfile capacityReservation() { + return this.innerProperties() == null ? null : this.innerProperties().capacityReservation(); + } + + /** + * Set the capacityReservation property: Specifies information about the capacity reservation that is used to + * allocate virtual machine. Minimum api-version: 2021-04-01. + * + * @param capacityReservation the capacityReservation value to set. + * @return the VirtualMachineUpdateInner object itself. + */ + public VirtualMachineUpdateInner withCapacityReservation(CapacityReservationProfile capacityReservation) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachinePropertiesInner(); + } + this.innerProperties().withCapacityReservation(capacityReservation); + return this; + } + + /** + * Get the applicationProfile property: Specifies the gallery applications that should be made available to the + * VM/VMSS. + * + * @return the applicationProfile value. + */ + public ApplicationProfile applicationProfile() { + return this.innerProperties() == null ? null : this.innerProperties().applicationProfile(); + } + + /** + * Set the applicationProfile property: Specifies the gallery applications that should be made available to the + * VM/VMSS. + * + * @param applicationProfile the applicationProfile value to set. + * @return the VirtualMachineUpdateInner object itself. + */ + public VirtualMachineUpdateInner withApplicationProfile(ApplicationProfile applicationProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachinePropertiesInner(); + } + this.innerProperties().withApplicationProfile(applicationProfile); + return this; + } + + /** + * Get the timeCreated property: Specifies the time at which the Virtual Machine resource was created. Minimum + * api-version: 2021-11-01. + * + * @return the timeCreated value. + */ + public OffsetDateTime timeCreated() { + return this.innerProperties() == null ? null : this.innerProperties().timeCreated(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (plan() != null) { + plan().validate(); + } + if (innerProperties() != null) { + innerProperties().validate(); + } + if (identity() != null) { + identity().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VmImagesInEdgeZoneListResultInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VmImagesInEdgeZoneListResultInner.java new file mode 100644 index 0000000000000..d2e193d6217bf --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VmImagesInEdgeZoneListResultInner.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List VmImages in EdgeZone operation response. */ +@Fluent +public final class VmImagesInEdgeZoneListResultInner { + /* + * The list of VMImages in EdgeZone + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URI to fetch the next page of VMImages in EdgeZone. Call ListNext() with this URI to fetch the next page of + * VmImages. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of VmImagesInEdgeZoneListResultInner class. */ + public VmImagesInEdgeZoneListResultInner() { + } + + /** + * Get the value property: The list of VMImages in EdgeZone. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of VMImages in EdgeZone. + * + * @param value the value value to set. + * @return the VmImagesInEdgeZoneListResultInner object itself. + */ + public VmImagesInEdgeZoneListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URI to fetch the next page of VMImages in EdgeZone. Call ListNext() with this URI + * to fetch the next page of VmImages. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URI to fetch the next page of VMImages in EdgeZone. Call ListNext() with this URI + * to fetch the next page of VmImages. + * + * @param nextLink the nextLink value to set. + * @return the VmImagesInEdgeZoneListResultInner object itself. + */ + public VmImagesInEdgeZoneListResultInner 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/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..0679353c22d73 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/AccessUriImpl.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.resourcemanager.compute.generated.fluent.models.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 String securityDataAccessSas() { + return this.innerModel().securityDataAccessSas(); + } + + 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..36f9b3ee4440b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/AvailabilitySetImpl.java @@ -0,0 +1,266 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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 String resourceGroupName() { + return resourceGroupName; + } + + 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..ce93c4875c7f5 --- /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.util.Context; +import com.azure.core.util.FluxUtil; +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.ApiErrorException; +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 { + /** 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") + public interface AvailabilitySetsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.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(ApiErrorException.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({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> delete( + @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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.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(ApiErrorException.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(ApiErrorException.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(ApiErrorException.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(ApiErrorException.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(ApiErrorException.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 ApiErrorException thrown if the 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 along + * with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + availabilitySetName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update an availability set. + * + * @param resourceGroupName The name of the resource group. + * @param availabilitySetName The name of the availability set. + * @param parameters Parameters supplied to the Create Availability Set operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the 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 along + * with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-03-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 ApiErrorException thrown if the 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 on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String availabilitySetName, AvailabilitySetInner parameters) { + return createOrUpdateWithResponseAsync(resourceGroupName, availabilitySetName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 ApiErrorException thrown if the 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 along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, String availabilitySetName, AvailabilitySetInner parameters, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, availabilitySetName, parameters, context).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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the 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 createOrUpdateWithResponse(resourceGroupName, availabilitySetName, parameters, Context.NONE).getValue(); + } + + /** + * 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 ApiErrorException thrown if the 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 along + * with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + availabilitySetName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update an availability set. + * + * @param resourceGroupName The name of the resource group. + * @param availabilitySetName The name of the availability set. + * @param parameters Parameters supplied to the Update Availability Set operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the 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 along + * with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-03-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 ApiErrorException thrown if the 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 on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String availabilitySetName, AvailabilitySetUpdate parameters) { + return updateWithResponseAsync(resourceGroupName, availabilitySetName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 ApiErrorException thrown if the 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 along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, String availabilitySetName, AvailabilitySetUpdate parameters, Context context) { + return updateWithResponseAsync(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 ApiErrorException thrown if the 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 updateWithResponse(resourceGroupName, availabilitySetName, parameters, Context.NONE).getValue(); + } + + /** + * 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String 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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + availabilitySetName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete an availability set. + * + * @param resourceGroupName The name of the resource group. + * @param availabilitySetName The name of the availability set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String 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 = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + availabilitySetName, + apiVersion, + this.client.getSubscriptionId(), + accept, + 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String availabilitySetName) { + return deleteWithResponseAsync(resourceGroupName, availabilitySetName).flatMap(ignored -> Mono.empty()); + } + + /** + * 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String availabilitySetName, Context context) { + return deleteWithResponseAsync(resourceGroupName, availabilitySetName, 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 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 availabilitySetName) { + deleteWithResponse(resourceGroupName, availabilitySetName, Context.NONE); + } + + /** + * 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 ApiErrorException thrown if the 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 along + * with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + availabilitySetName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves information about an availability set. + * + * @param resourceGroupName The name of the resource group. + * @param availabilitySetName The name of the availability set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the 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 along + * with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-03-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 ApiErrorException thrown if the 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 on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String availabilitySetName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, availabilitySetName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 ApiErrorException thrown if the 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 along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String availabilitySetName, Context context) { + return getByResourceGroupWithResponseAsync(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 ApiErrorException thrown if the 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 getByResourceGroupWithResponse(resourceGroupName, availabilitySetName, Context.NONE).getValue(); + } + + /** + * 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 ApiErrorException thrown 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all availability sets in a subscription. + * + * @param expand The expand expression to apply to the operation. Allowed values are 'instanceView'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 = "2023-03-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 ApiErrorException thrown 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 as paginated response with {@link PagedFlux}. + */ + @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 ApiErrorException thrown 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 as paginated response with {@link PagedFlux}. + */ + @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 ApiErrorException thrown 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 as paginated response with {@link PagedFlux}. + */ + @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 ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + @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 ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + @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 ApiErrorException thrown 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all availability sets in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2023-03-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 ApiErrorException thrown 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 as paginated response with {@link PagedFlux}. + */ + @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 ApiErrorException thrown 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 as paginated response with {@link PagedFlux}. + */ + @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 ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + @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 ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + @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 ApiErrorException thrown 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listAvailableSizes( + this.client.getEndpoint(), + resourceGroupName, + availabilitySetName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing + * availability set. + * + * @param resourceGroupName The name of the resource group. + * @param availabilitySetName The name of the availability set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 = "2023-03-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 ApiErrorException thrown 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 as paginated response with {@link PagedFlux}. + */ + @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 ApiErrorException thrown 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 as paginated response with {@link PagedFlux}. + */ + @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 ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + @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 ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + @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 URL to get the next list of items + *

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 Availability Set operation response along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/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..b063fe9b3c1d0 --- /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; + +public final class AvailabilitySetsImpl implements AvailabilitySets { + private static 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 Response deleteByResourceGroupWithResponse( + String resourceGroupName, String availabilitySetName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, availabilitySetName, context); + } + + public void deleteByResourceGroup(String resourceGroupName, String availabilitySetName) { + this.serviceClient().delete(resourceGroupName, availabilitySetName); + } + + 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 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 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.deleteByResourceGroupWithResponse(resourceGroupName, availabilitySetName, Context.NONE); + } + + 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.deleteByResourceGroupWithResponse(resourceGroupName, availabilitySetName, context); + } + + private AvailabilitySetsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } + + public AvailabilitySetImpl define(String name) { + return new AvailabilitySetImpl(name, this.manager()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CapacityReservationGroupImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CapacityReservationGroupImpl.java new file mode 100644 index 0000000000000..fd1e6b3fd860d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CapacityReservationGroupImpl.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.CapacityReservationGroupInner; +import com.azure.resourcemanager.compute.generated.models.CapacityReservationGroup; +import com.azure.resourcemanager.compute.generated.models.CapacityReservationGroupInstanceView; +import com.azure.resourcemanager.compute.generated.models.CapacityReservationGroupInstanceViewTypes; +import com.azure.resourcemanager.compute.generated.models.CapacityReservationGroupUpdate; +import com.azure.resourcemanager.compute.generated.models.SubResourceReadOnly; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class CapacityReservationGroupImpl + implements CapacityReservationGroup, CapacityReservationGroup.Definition, CapacityReservationGroup.Update { + private CapacityReservationGroupInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public List zones() { + List inner = this.innerModel().zones(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List capacityReservations() { + List inner = this.innerModel().capacityReservations(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List virtualMachinesAssociated() { + List inner = this.innerModel().virtualMachinesAssociated(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public CapacityReservationGroupInstanceView instanceView() { + return this.innerModel().instanceView(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public CapacityReservationGroupInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String capacityReservationGroupName; + + private CapacityReservationGroupUpdate updateParameters; + + public CapacityReservationGroupImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public CapacityReservationGroup create() { + this.innerObject = + serviceManager + .serviceClient() + .getCapacityReservationGroups() + .createOrUpdateWithResponse( + resourceGroupName, capacityReservationGroupName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public CapacityReservationGroup create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getCapacityReservationGroups() + .createOrUpdateWithResponse(resourceGroupName, capacityReservationGroupName, this.innerModel(), context) + .getValue(); + return this; + } + + CapacityReservationGroupImpl( + String name, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = new CapacityReservationGroupInner(); + this.serviceManager = serviceManager; + this.capacityReservationGroupName = name; + } + + public CapacityReservationGroupImpl update() { + this.updateParameters = new CapacityReservationGroupUpdate(); + return this; + } + + public CapacityReservationGroup apply() { + this.innerObject = + serviceManager + .serviceClient() + .getCapacityReservationGroups() + .updateWithResponse(resourceGroupName, capacityReservationGroupName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public CapacityReservationGroup apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getCapacityReservationGroups() + .updateWithResponse(resourceGroupName, capacityReservationGroupName, updateParameters, context) + .getValue(); + return this; + } + + CapacityReservationGroupImpl( + CapacityReservationGroupInner innerObject, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.capacityReservationGroupName = Utils.getValueFromIdByName(innerObject.id(), "capacityReservationGroups"); + } + + public CapacityReservationGroup refresh() { + CapacityReservationGroupInstanceViewTypes localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getCapacityReservationGroups() + .getByResourceGroupWithResponse( + resourceGroupName, capacityReservationGroupName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public CapacityReservationGroup refresh(Context context) { + CapacityReservationGroupInstanceViewTypes localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getCapacityReservationGroups() + .getByResourceGroupWithResponse(resourceGroupName, capacityReservationGroupName, localExpand, context) + .getValue(); + return this; + } + + public CapacityReservationGroupImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public CapacityReservationGroupImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public CapacityReservationGroupImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public CapacityReservationGroupImpl withZones(List zones) { + this.innerModel().withZones(zones); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CapacityReservationGroupsClientImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CapacityReservationGroupsClientImpl.java new file mode 100644 index 0000000000000..d534eb1d25de0 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CapacityReservationGroupsClientImpl.java @@ -0,0 +1,1449 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.compute.generated.fluent.CapacityReservationGroupsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.CapacityReservationGroupInner; +import com.azure.resourcemanager.compute.generated.models.ApiErrorException; +import com.azure.resourcemanager.compute.generated.models.CapacityReservationGroupInstanceViewTypes; +import com.azure.resourcemanager.compute.generated.models.CapacityReservationGroupListResult; +import com.azure.resourcemanager.compute.generated.models.CapacityReservationGroupUpdate; +import com.azure.resourcemanager.compute.generated.models.ExpandTypesForGetCapacityReservationGroups; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in CapacityReservationGroupsClient. */ +public final class CapacityReservationGroupsClientImpl implements CapacityReservationGroupsClient { + /** The proxy service used to perform REST calls. */ + private final CapacityReservationGroupsService service; + + /** The service client containing this operation class. */ + private final ComputeManagementClientImpl client; + + /** + * Initializes an instance of CapacityReservationGroupsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CapacityReservationGroupsClientImpl(ComputeManagementClientImpl client) { + this.service = + RestProxy + .create( + CapacityReservationGroupsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ComputeManagementClientCapacityReservationGroups to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ComputeManagementCli") + public interface CapacityReservationGroupsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("capacityReservationGroupName") String capacityReservationGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") CapacityReservationGroupInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("capacityReservationGroupName") String capacityReservationGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") CapacityReservationGroupUpdate parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("capacityReservationGroupName") String capacityReservationGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("capacityReservationGroupName") String capacityReservationGroupName, + @QueryParam("$expand") CapacityReservationGroupInstanceViewTypes expand, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") ExpandTypesForGetCapacityReservationGroups expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/capacityReservationGroups") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") ExpandTypesForGetCapacityReservationGroups expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * The operation to create or update a capacity reservation group. When updating a capacity reservation group, only + * tags may be modified. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param parameters Parameters supplied to the Create capacity reservation Group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation group that the capacity reservations should be + * assigned to along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String capacityReservationGroupName, CapacityReservationGroupInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (capacityReservationGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter capacityReservationGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + capacityReservationGroupName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to create or update a capacity reservation group. When updating a capacity reservation group, only + * tags may be modified. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param parameters Parameters supplied to the Create capacity reservation Group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation group that the capacity reservations should be + * assigned to along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String capacityReservationGroupName, + CapacityReservationGroupInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (capacityReservationGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter capacityReservationGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + capacityReservationGroupName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * The operation to create or update a capacity reservation group. When updating a capacity reservation group, only + * tags may be modified. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param parameters Parameters supplied to the Create capacity reservation Group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation group that the capacity reservations should be + * assigned to on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String capacityReservationGroupName, CapacityReservationGroupInner parameters) { + return createOrUpdateWithResponseAsync(resourceGroupName, capacityReservationGroupName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * The operation to create or update a capacity reservation group. When updating a capacity reservation group, only + * tags may be modified. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param parameters Parameters supplied to the Create capacity reservation Group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation group that the capacity reservations should be + * assigned to along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String capacityReservationGroupName, + CapacityReservationGroupInner parameters, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, capacityReservationGroupName, parameters, context) + .block(); + } + + /** + * The operation to create or update a capacity reservation group. When updating a capacity reservation group, only + * tags may be modified. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param parameters Parameters supplied to the Create capacity reservation Group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation group that the capacity reservations should be + * assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CapacityReservationGroupInner createOrUpdate( + String resourceGroupName, String capacityReservationGroupName, CapacityReservationGroupInner parameters) { + return createOrUpdateWithResponse(resourceGroupName, capacityReservationGroupName, parameters, Context.NONE) + .getValue(); + } + + /** + * The operation to update a capacity reservation group. When updating a capacity reservation group, only tags may + * be modified. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param parameters Parameters supplied to the Update capacity reservation Group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation group that the capacity reservations should be + * assigned to along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String capacityReservationGroupName, CapacityReservationGroupUpdate parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (capacityReservationGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter capacityReservationGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + capacityReservationGroupName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to update a capacity reservation group. When updating a capacity reservation group, only tags may + * be modified. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param parameters Parameters supplied to the Update capacity reservation Group operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation group that the capacity reservations should be + * assigned to along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String capacityReservationGroupName, + CapacityReservationGroupUpdate parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (capacityReservationGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter capacityReservationGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + capacityReservationGroupName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * The operation to update a capacity reservation group. When updating a capacity reservation group, only tags may + * be modified. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param parameters Parameters supplied to the Update capacity reservation Group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation group that the capacity reservations should be + * assigned to on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String capacityReservationGroupName, CapacityReservationGroupUpdate parameters) { + return updateWithResponseAsync(resourceGroupName, capacityReservationGroupName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * The operation to update a capacity reservation group. When updating a capacity reservation group, only tags may + * be modified. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param parameters Parameters supplied to the Update capacity reservation Group operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation group that the capacity reservations should be + * assigned to along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String capacityReservationGroupName, + CapacityReservationGroupUpdate parameters, + Context context) { + return updateWithResponseAsync(resourceGroupName, capacityReservationGroupName, parameters, context).block(); + } + + /** + * The operation to update a capacity reservation group. When updating a capacity reservation group, only tags may + * be modified. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param parameters Parameters supplied to the Update capacity reservation Group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation group that the capacity reservations should be + * assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CapacityReservationGroupInner update( + String resourceGroupName, String capacityReservationGroupName, CapacityReservationGroupUpdate parameters) { + return updateWithResponse(resourceGroupName, capacityReservationGroupName, parameters, Context.NONE).getValue(); + } + + /** + * The operation to delete a capacity reservation group. This operation is allowed only if all the associated + * resources are disassociated from the reservation group and all capacity reservations under the reservation group + * have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String capacityReservationGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (capacityReservationGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter capacityReservationGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + capacityReservationGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to delete a capacity reservation group. This operation is allowed only if all the associated + * resources are disassociated from the reservation group and all capacity reservations under the reservation group + * have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String capacityReservationGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (capacityReservationGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter capacityReservationGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + capacityReservationGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * The operation to delete a capacity reservation group. This operation is allowed only if all the associated + * resources are disassociated from the reservation group and all capacity reservations under the reservation group + * have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String capacityReservationGroupName) { + return deleteWithResponseAsync(resourceGroupName, capacityReservationGroupName) + .flatMap(ignored -> Mono.empty()); + } + + /** + * The operation to delete a capacity reservation group. This operation is allowed only if all the associated + * resources are disassociated from the reservation group and all capacity reservations under the reservation group + * have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String capacityReservationGroupName, Context context) { + return deleteWithResponseAsync(resourceGroupName, capacityReservationGroupName, context).block(); + } + + /** + * The operation to delete a capacity reservation group. This operation is allowed only if all the associated + * resources are disassociated from the reservation group and all capacity reservations under the reservation group + * have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String capacityReservationGroupName) { + deleteWithResponse(resourceGroupName, capacityReservationGroupName, Context.NONE); + } + + /** + * The operation that retrieves information about a capacity reservation group. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param expand The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance + * views of the capacity reservations under the capacity reservation group which is a snapshot of the runtime + * properties of a capacity reservation that is managed by the platform and can change outside of control plane + * operations. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation group that the capacity reservations should be + * assigned to along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, + String capacityReservationGroupName, + CapacityReservationGroupInstanceViewTypes expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (capacityReservationGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter capacityReservationGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + capacityReservationGroupName, + expand, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation that retrieves information about a capacity reservation group. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param expand The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance + * views of the capacity reservations under the capacity reservation group which is a snapshot of the runtime + * properties of a capacity reservation that is managed by the platform and can change outside of control plane + * operations. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation group that the capacity reservations should be + * assigned to along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, + String capacityReservationGroupName, + CapacityReservationGroupInstanceViewTypes expand, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (capacityReservationGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter capacityReservationGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + capacityReservationGroupName, + expand, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * The operation that retrieves information about a capacity reservation group. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation group that the capacity reservations should be + * assigned to on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String capacityReservationGroupName) { + final CapacityReservationGroupInstanceViewTypes expand = null; + return getByResourceGroupWithResponseAsync(resourceGroupName, capacityReservationGroupName, expand) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * The operation that retrieves information about a capacity reservation group. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param expand The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance + * views of the capacity reservations under the capacity reservation group which is a snapshot of the runtime + * properties of a capacity reservation that is managed by the platform and can change outside of control plane + * operations. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation group that the capacity reservations should be + * assigned to along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, + String capacityReservationGroupName, + CapacityReservationGroupInstanceViewTypes expand, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, capacityReservationGroupName, expand, context) + .block(); + } + + /** + * The operation that retrieves information about a capacity reservation group. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation group that the capacity reservations should be + * assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CapacityReservationGroupInner getByResourceGroup( + String resourceGroupName, String capacityReservationGroupName) { + final CapacityReservationGroupInstanceViewTypes expand = null; + return getByResourceGroupWithResponse(resourceGroupName, capacityReservationGroupName, expand, Context.NONE) + .getValue(); + } + + /** + * Lists all of the capacity reservation groups in the specified resource group. Use the nextLink property in the + * response to get the next page of capacity reservation groups. + * + * @param resourceGroupName The name of the resource group. + * @param expand The expand expression to apply on the operation. Based on the expand param(s) specified we return + * Virtual Machine or ScaleSet VM Instance or both resource Ids which are associated to capacity reservation + * group in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List capacity reservation group with resource group response along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, ExpandTypesForGetCapacityReservationGroups expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all of the capacity reservation groups in the specified resource group. Use the nextLink property in the + * response to get the next page of capacity reservation groups. + * + * @param resourceGroupName The name of the resource group. + * @param expand The expand expression to apply on the operation. Based on the expand param(s) specified we return + * Virtual Machine or ScaleSet VM Instance or both resource Ids which are associated to capacity reservation + * group in the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List capacity reservation group with resource group response along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, ExpandTypesForGetCapacityReservationGroups expand, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all of the capacity reservation groups in the specified resource group. Use the nextLink property in the + * response to get the next page of capacity reservation groups. + * + * @param resourceGroupName The name of the resource group. + * @param expand The expand expression to apply on the operation. Based on the expand param(s) specified we return + * Virtual Machine or ScaleSet VM Instance or both resource Ids which are associated to capacity reservation + * group in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List capacity reservation group with resource group response as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, ExpandTypesForGetCapacityReservationGroups expand) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, expand), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the capacity reservation groups in the specified resource group. Use the nextLink property in the + * response to get the next page of capacity reservation groups. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List capacity reservation group with resource group response as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + final ExpandTypesForGetCapacityReservationGroups expand = null; + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, expand), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the capacity reservation groups in the specified resource group. Use the nextLink property in the + * response to get the next page of capacity reservation groups. + * + * @param resourceGroupName The name of the resource group. + * @param expand The expand expression to apply on the operation. Based on the expand param(s) specified we return + * Virtual Machine or ScaleSet VM Instance or both resource Ids which are associated to capacity reservation + * group in the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List capacity reservation group with resource group response as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, ExpandTypesForGetCapacityReservationGroups expand, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, expand, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the capacity reservation groups in the specified resource group. Use the nextLink property in the + * response to get the next page of capacity reservation groups. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List capacity reservation group with resource group response as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + final ExpandTypesForGetCapacityReservationGroups expand = null; + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, expand)); + } + + /** + * Lists all of the capacity reservation groups in the specified resource group. Use the nextLink property in the + * response to get the next page of capacity reservation groups. + * + * @param resourceGroupName The name of the resource group. + * @param expand The expand expression to apply on the operation. Based on the expand param(s) specified we return + * Virtual Machine or ScaleSet VM Instance or both resource Ids which are associated to capacity reservation + * group in the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List capacity reservation group with resource group response as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup( + String resourceGroupName, ExpandTypesForGetCapacityReservationGroups expand, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, expand, context)); + } + + /** + * Lists all of the capacity reservation groups in the subscription. Use the nextLink property in the response to + * get the next page of capacity reservation groups. + * + * @param expand The expand expression to apply on the operation. Based on the expand param(s) specified we return + * Virtual Machine or ScaleSet VM Instance or both resource Ids which are associated to capacity reservation + * group in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List capacity reservation group with resource group response along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + ExpandTypesForGetCapacityReservationGroups expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all of the capacity reservation groups in the subscription. Use the nextLink property in the response to + * get the next page of capacity reservation groups. + * + * @param expand The expand expression to apply on the operation. Based on the expand param(s) specified we return + * Virtual Machine or ScaleSet VM Instance or both resource Ids which are associated to capacity reservation + * group in the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List capacity reservation group with resource group response along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + ExpandTypesForGetCapacityReservationGroups expand, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), expand, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all of the capacity reservation groups in the subscription. Use the nextLink property in the response to + * get the next page of capacity reservation groups. + * + * @param expand The expand expression to apply on the operation. Based on the expand param(s) specified we return + * Virtual Machine or ScaleSet VM Instance or both resource Ids which are associated to capacity reservation + * group in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List capacity reservation group with resource group response as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(ExpandTypesForGetCapacityReservationGroups expand) { + return new PagedFlux<>( + () -> listSinglePageAsync(expand), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the capacity reservation groups in the subscription. Use the nextLink property in the response to + * get the next page of capacity reservation groups. + * + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List capacity reservation group with resource group response as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + final ExpandTypesForGetCapacityReservationGroups expand = null; + return new PagedFlux<>( + () -> listSinglePageAsync(expand), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the capacity reservation groups in the subscription. Use the nextLink property in the response to + * get the next page of capacity reservation groups. + * + * @param expand The expand expression to apply on the operation. Based on the expand param(s) specified we return + * Virtual Machine or ScaleSet VM Instance or both resource Ids which are associated to capacity reservation + * group in the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List capacity reservation group with resource group response as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + ExpandTypesForGetCapacityReservationGroups expand, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(expand, context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the capacity reservation groups in the subscription. Use the nextLink property in the response to + * get the next page of capacity reservation groups. + * + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List capacity reservation group with resource group response as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + final ExpandTypesForGetCapacityReservationGroups expand = null; + return new PagedIterable<>(listAsync(expand)); + } + + /** + * Lists all of the capacity reservation groups in the subscription. Use the nextLink property in the response to + * get the next page of capacity reservation groups. + * + * @param expand The expand expression to apply on the operation. Based on the expand param(s) specified we return + * Virtual Machine or ScaleSet VM Instance or both resource Ids which are associated to capacity reservation + * group in the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List capacity reservation group with resource group response as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + ExpandTypesForGetCapacityReservationGroups expand, Context context) { + return new PagedIterable<>(listAsync(expand, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List capacity reservation group with resource group response along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List capacity reservation group with resource group response along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List capacity reservation group with resource group response along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List capacity reservation group with resource group response along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CapacityReservationGroupsImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CapacityReservationGroupsImpl.java new file mode 100644 index 0000000000000..b172d8d7b1ebb --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CapacityReservationGroupsImpl.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.CapacityReservationGroupsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.CapacityReservationGroupInner; +import com.azure.resourcemanager.compute.generated.models.CapacityReservationGroup; +import com.azure.resourcemanager.compute.generated.models.CapacityReservationGroupInstanceViewTypes; +import com.azure.resourcemanager.compute.generated.models.CapacityReservationGroups; +import com.azure.resourcemanager.compute.generated.models.ExpandTypesForGetCapacityReservationGroups; + +public final class CapacityReservationGroupsImpl implements CapacityReservationGroups { + private static final ClientLogger LOGGER = new ClientLogger(CapacityReservationGroupsImpl.class); + + private final CapacityReservationGroupsClient innerClient; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + public CapacityReservationGroupsImpl( + CapacityReservationGroupsClient innerClient, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response deleteByResourceGroupWithResponse( + String resourceGroupName, String capacityReservationGroupName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, capacityReservationGroupName, context); + } + + public void deleteByResourceGroup(String resourceGroupName, String capacityReservationGroupName) { + this.serviceClient().delete(resourceGroupName, capacityReservationGroupName); + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, + String capacityReservationGroupName, + CapacityReservationGroupInstanceViewTypes expand, + Context context) { + Response inner = + this + .serviceClient() + .getByResourceGroupWithResponse(resourceGroupName, capacityReservationGroupName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CapacityReservationGroupImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CapacityReservationGroup getByResourceGroup(String resourceGroupName, String capacityReservationGroupName) { + CapacityReservationGroupInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, capacityReservationGroupName); + if (inner != null) { + return new CapacityReservationGroupImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new CapacityReservationGroupImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup( + String resourceGroupName, ExpandTypesForGetCapacityReservationGroups expand, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, expand, context); + return Utils.mapPage(inner, inner1 -> new CapacityReservationGroupImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new CapacityReservationGroupImpl(inner1, this.manager())); + } + + public PagedIterable list( + ExpandTypesForGetCapacityReservationGroups expand, Context context) { + PagedIterable inner = this.serviceClient().list(expand, context); + return Utils.mapPage(inner, inner1 -> new CapacityReservationGroupImpl(inner1, this.manager())); + } + + public CapacityReservationGroup getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String capacityReservationGroupName = Utils.getValueFromIdByName(id, "capacityReservationGroups"); + if (capacityReservationGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'capacityReservationGroups'.", + id))); + } + CapacityReservationGroupInstanceViewTypes localExpand = null; + return this + .getByResourceGroupWithResponse(resourceGroupName, capacityReservationGroupName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse( + String id, CapacityReservationGroupInstanceViewTypes expand, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String capacityReservationGroupName = Utils.getValueFromIdByName(id, "capacityReservationGroups"); + if (capacityReservationGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'capacityReservationGroups'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, capacityReservationGroupName, expand, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String capacityReservationGroupName = Utils.getValueFromIdByName(id, "capacityReservationGroups"); + if (capacityReservationGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'capacityReservationGroups'.", + id))); + } + this.deleteByResourceGroupWithResponse(resourceGroupName, capacityReservationGroupName, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String capacityReservationGroupName = Utils.getValueFromIdByName(id, "capacityReservationGroups"); + if (capacityReservationGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'capacityReservationGroups'.", + id))); + } + return this.deleteByResourceGroupWithResponse(resourceGroupName, capacityReservationGroupName, context); + } + + private CapacityReservationGroupsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } + + public CapacityReservationGroupImpl define(String name) { + return new CapacityReservationGroupImpl(name, this.manager()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CapacityReservationImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CapacityReservationImpl.java new file mode 100644 index 0000000000000..fb25362fba179 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CapacityReservationImpl.java @@ -0,0 +1,272 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.CapacityReservationInner; +import com.azure.resourcemanager.compute.generated.models.CapacityReservation; +import com.azure.resourcemanager.compute.generated.models.CapacityReservationInstanceView; +import com.azure.resourcemanager.compute.generated.models.CapacityReservationInstanceViewTypes; +import com.azure.resourcemanager.compute.generated.models.CapacityReservationUpdate; +import com.azure.resourcemanager.compute.generated.models.Sku; +import com.azure.resourcemanager.compute.generated.models.SubResourceReadOnly; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class CapacityReservationImpl + implements CapacityReservation, CapacityReservation.Definition, CapacityReservation.Update { + private CapacityReservationInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Sku sku() { + return this.innerModel().sku(); + } + + public List zones() { + List inner = this.innerModel().zones(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String reservationId() { + return this.innerModel().reservationId(); + } + + public Integer platformFaultDomainCount() { + return this.innerModel().platformFaultDomainCount(); + } + + public List virtualMachinesAssociated() { + List inner = this.innerModel().virtualMachinesAssociated(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public OffsetDateTime provisioningTime() { + return this.innerModel().provisioningTime(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public CapacityReservationInstanceView instanceView() { + return this.innerModel().instanceView(); + } + + public OffsetDateTime timeCreated() { + return this.innerModel().timeCreated(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public CapacityReservationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String capacityReservationGroupName; + + private String capacityReservationName; + + private CapacityReservationUpdate updateParameters; + + public CapacityReservationImpl withExistingCapacityReservationGroup( + String resourceGroupName, String capacityReservationGroupName) { + this.resourceGroupName = resourceGroupName; + this.capacityReservationGroupName = capacityReservationGroupName; + return this; + } + + public CapacityReservation create() { + this.innerObject = + serviceManager + .serviceClient() + .getCapacityReservations() + .createOrUpdate( + resourceGroupName, + capacityReservationGroupName, + capacityReservationName, + this.innerModel(), + Context.NONE); + return this; + } + + public CapacityReservation create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getCapacityReservations() + .createOrUpdate( + resourceGroupName, + capacityReservationGroupName, + capacityReservationName, + this.innerModel(), + context); + return this; + } + + CapacityReservationImpl(String name, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = new CapacityReservationInner(); + this.serviceManager = serviceManager; + this.capacityReservationName = name; + } + + public CapacityReservationImpl update() { + this.updateParameters = new CapacityReservationUpdate(); + return this; + } + + public CapacityReservation apply() { + this.innerObject = + serviceManager + .serviceClient() + .getCapacityReservations() + .update( + resourceGroupName, + capacityReservationGroupName, + capacityReservationName, + updateParameters, + Context.NONE); + return this; + } + + public CapacityReservation apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getCapacityReservations() + .update( + resourceGroupName, + capacityReservationGroupName, + capacityReservationName, + updateParameters, + context); + return this; + } + + CapacityReservationImpl( + CapacityReservationInner innerObject, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.capacityReservationGroupName = Utils.getValueFromIdByName(innerObject.id(), "capacityReservationGroups"); + this.capacityReservationName = Utils.getValueFromIdByName(innerObject.id(), "capacityReservations"); + } + + public CapacityReservation refresh() { + CapacityReservationInstanceViewTypes localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getCapacityReservations() + .getWithResponse( + resourceGroupName, capacityReservationGroupName, capacityReservationName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public CapacityReservation refresh(Context context) { + CapacityReservationInstanceViewTypes localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getCapacityReservations() + .getWithResponse( + resourceGroupName, capacityReservationGroupName, capacityReservationName, localExpand, context) + .getValue(); + return this; + } + + public CapacityReservationImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public CapacityReservationImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public CapacityReservationImpl withSku(Sku sku) { + if (isInCreateMode()) { + this.innerModel().withSku(sku); + return this; + } else { + this.updateParameters.withSku(sku); + return this; + } + } + + public CapacityReservationImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public CapacityReservationImpl withZones(List zones) { + this.innerModel().withZones(zones); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CapacityReservationsClientImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CapacityReservationsClientImpl.java new file mode 100644 index 0000000000000..cc4846c355f59 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CapacityReservationsClientImpl.java @@ -0,0 +1,1653 @@ +// Copyright (c) Microsoft Corporation. All rights 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.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.compute.generated.fluent.CapacityReservationsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.CapacityReservationInner; +import com.azure.resourcemanager.compute.generated.models.ApiErrorException; +import com.azure.resourcemanager.compute.generated.models.CapacityReservationInstanceViewTypes; +import com.azure.resourcemanager.compute.generated.models.CapacityReservationListResult; +import com.azure.resourcemanager.compute.generated.models.CapacityReservationUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in CapacityReservationsClient. */ +public final class CapacityReservationsClientImpl implements CapacityReservationsClient { + /** The proxy service used to perform REST calls. */ + private final CapacityReservationsService service; + + /** The service client containing this operation class. */ + private final ComputeManagementClientImpl client; + + /** + * Initializes an instance of CapacityReservationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CapacityReservationsClientImpl(ComputeManagementClientImpl client) { + this.service = + RestProxy + .create(CapacityReservationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ComputeManagementClientCapacityReservations to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ComputeManagementCli") + public interface CapacityReservationsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("capacityReservationGroupName") String capacityReservationGroupName, + @PathParam("capacityReservationName") String capacityReservationName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") CapacityReservationInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("capacityReservationGroupName") String capacityReservationGroupName, + @PathParam("capacityReservationName") String capacityReservationName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") CapacityReservationUpdate parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("capacityReservationGroupName") String capacityReservationGroupName, + @PathParam("capacityReservationName") String capacityReservationName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("capacityReservationGroupName") String capacityReservationGroupName, + @PathParam("capacityReservationName") String capacityReservationName, + @QueryParam("$expand") CapacityReservationInstanceViewTypes expand, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> listByCapacityReservationGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("capacityReservationGroupName") String capacityReservationGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> listByCapacityReservationGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * The operation to create or update a capacity reservation. Please note some properties can be set only during + * capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param parameters Parameters supplied to the Create capacity reservation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + CapacityReservationInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (capacityReservationGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter capacityReservationGroupName is required and cannot be null.")); + } + if (capacityReservationName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter capacityReservationName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + capacityReservationGroupName, + capacityReservationName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to create or update a capacity reservation. Please note some properties can be set only during + * capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param parameters Parameters supplied to the Create capacity reservation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + CapacityReservationInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (capacityReservationGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter capacityReservationGroupName is required and cannot be null.")); + } + if (capacityReservationName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter capacityReservationName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + capacityReservationGroupName, + capacityReservationName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * The operation to create or update a capacity reservation. Please note some properties can be set only during + * capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param parameters Parameters supplied to the Create capacity reservation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of specifies information about the capacity reservation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CapacityReservationInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + CapacityReservationInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + CapacityReservationInner.class, + CapacityReservationInner.class, + this.client.getContext()); + } + + /** + * The operation to create or update a capacity reservation. Please note some properties can be set only during + * capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param parameters Parameters supplied to the Create capacity reservation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of specifies information about the capacity reservation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CapacityReservationInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + CapacityReservationInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + CapacityReservationInner.class, + CapacityReservationInner.class, + context); + } + + /** + * The operation to create or update a capacity reservation. Please note some properties can be set only during + * capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param parameters Parameters supplied to the Create capacity reservation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of specifies information about the capacity reservation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CapacityReservationInner> beginCreateOrUpdate( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + CapacityReservationInner parameters) { + return this + .beginCreateOrUpdateAsync( + resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters) + .getSyncPoller(); + } + + /** + * The operation to create or update a capacity reservation. Please note some properties can be set only during + * capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param parameters Parameters supplied to the Create capacity reservation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of specifies information about the capacity reservation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CapacityReservationInner> beginCreateOrUpdate( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + CapacityReservationInner parameters, + Context context) { + return this + .beginCreateOrUpdateAsync( + resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters, context) + .getSyncPoller(); + } + + /** + * The operation to create or update a capacity reservation. Please note some properties can be set only during + * capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param parameters Parameters supplied to the Create capacity reservation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + CapacityReservationInner parameters) { + return beginCreateOrUpdateAsync( + resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to create or update a capacity reservation. Please note some properties can be set only during + * capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param parameters Parameters supplied to the Create capacity reservation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + CapacityReservationInner parameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to create or update a capacity reservation. Please note some properties can be set only during + * capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param parameters Parameters supplied to the Create capacity reservation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CapacityReservationInner createOrUpdate( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + CapacityReservationInner parameters) { + return createOrUpdateAsync(resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters) + .block(); + } + + /** + * The operation to create or update a capacity reservation. Please note some properties can be set only during + * capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param parameters Parameters supplied to the Create capacity reservation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CapacityReservationInner createOrUpdate( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + CapacityReservationInner parameters, + Context context) { + return createOrUpdateAsync( + resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters, context) + .block(); + } + + /** + * The operation to update a capacity reservation. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param parameters Parameters supplied to the Update capacity reservation operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + CapacityReservationUpdate parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (capacityReservationGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter capacityReservationGroupName is required and cannot be null.")); + } + if (capacityReservationName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter capacityReservationName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + capacityReservationGroupName, + capacityReservationName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to update a capacity reservation. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param parameters Parameters supplied to the Update capacity reservation operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + CapacityReservationUpdate parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (capacityReservationGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter capacityReservationGroupName is required and cannot be null.")); + } + if (capacityReservationName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter capacityReservationName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + capacityReservationGroupName, + capacityReservationName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * The operation to update a capacity reservation. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param parameters Parameters supplied to the Update capacity reservation operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of specifies information about the capacity reservation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CapacityReservationInner> beginUpdateAsync( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + CapacityReservationUpdate parameters) { + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + CapacityReservationInner.class, + CapacityReservationInner.class, + this.client.getContext()); + } + + /** + * The operation to update a capacity reservation. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param parameters Parameters supplied to the Update capacity reservation operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of specifies information about the capacity reservation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CapacityReservationInner> beginUpdateAsync( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + CapacityReservationUpdate parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + CapacityReservationInner.class, + CapacityReservationInner.class, + context); + } + + /** + * The operation to update a capacity reservation. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param parameters Parameters supplied to the Update capacity reservation operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of specifies information about the capacity reservation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CapacityReservationInner> beginUpdate( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + CapacityReservationUpdate parameters) { + return this + .beginUpdateAsync(resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters) + .getSyncPoller(); + } + + /** + * The operation to update a capacity reservation. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param parameters Parameters supplied to the Update capacity reservation operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of specifies information about the capacity reservation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CapacityReservationInner> beginUpdate( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + CapacityReservationUpdate parameters, + Context context) { + return this + .beginUpdateAsync( + resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters, context) + .getSyncPoller(); + } + + /** + * The operation to update a capacity reservation. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param parameters Parameters supplied to the Update capacity reservation operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + CapacityReservationUpdate parameters) { + return beginUpdateAsync(resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to update a capacity reservation. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param parameters Parameters supplied to the Update capacity reservation operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + CapacityReservationUpdate parameters, + Context context) { + return beginUpdateAsync( + resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to update a capacity reservation. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param parameters Parameters supplied to the Update capacity reservation operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CapacityReservationInner update( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + CapacityReservationUpdate parameters) { + return updateAsync(resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters) + .block(); + } + + /** + * The operation to update a capacity reservation. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param parameters Parameters supplied to the Update capacity reservation operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CapacityReservationInner update( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + CapacityReservationUpdate parameters, + Context context) { + return updateAsync( + resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters, context) + .block(); + } + + /** + * The operation to delete a capacity reservation. This operation is allowed only when all the associated resources + * are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more + * details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String capacityReservationGroupName, String capacityReservationName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (capacityReservationGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter capacityReservationGroupName is required and cannot be null.")); + } + if (capacityReservationName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter capacityReservationName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + capacityReservationGroupName, + capacityReservationName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to delete a capacity reservation. This operation is allowed only when all the associated resources + * are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more + * details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (capacityReservationGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter capacityReservationGroupName is required and cannot be null.")); + } + if (capacityReservationName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter capacityReservationName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + capacityReservationGroupName, + capacityReservationName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * The operation to delete a capacity reservation. This operation is allowed only when all the associated resources + * are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more + * details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String capacityReservationGroupName, String capacityReservationName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, capacityReservationGroupName, capacityReservationName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * The operation to delete a capacity reservation. This operation is allowed only when all the associated resources + * are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more + * details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, capacityReservationGroupName, capacityReservationName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * The operation to delete a capacity reservation. This operation is allowed only when all the associated resources + * are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more + * details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String capacityReservationGroupName, String capacityReservationName) { + return this + .beginDeleteAsync(resourceGroupName, capacityReservationGroupName, capacityReservationName) + .getSyncPoller(); + } + + /** + * The operation to delete a capacity reservation. This operation is allowed only when all the associated resources + * are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more + * details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + Context context) { + return this + .beginDeleteAsync(resourceGroupName, capacityReservationGroupName, capacityReservationName, context) + .getSyncPoller(); + } + + /** + * The operation to delete a capacity reservation. This operation is allowed only when all the associated resources + * are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more + * details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String capacityReservationGroupName, String capacityReservationName) { + return beginDeleteAsync(resourceGroupName, capacityReservationGroupName, capacityReservationName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to delete a capacity reservation. This operation is allowed only when all the associated resources + * are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more + * details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + Context context) { + return beginDeleteAsync(resourceGroupName, capacityReservationGroupName, capacityReservationName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to delete a capacity reservation. This operation is allowed only when all the associated resources + * are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more + * details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String capacityReservationGroupName, String capacityReservationName) { + deleteAsync(resourceGroupName, capacityReservationGroupName, capacityReservationName).block(); + } + + /** + * The operation to delete a capacity reservation. This operation is allowed only when all the associated resources + * are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more + * details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + Context context) { + deleteAsync(resourceGroupName, capacityReservationGroupName, capacityReservationName, context).block(); + } + + /** + * The operation that retrieves information about the capacity reservation. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param expand The expand expression to apply on the operation. 'InstanceView' retrieves a snapshot of the runtime + * properties of the capacity reservation that is managed by the platform and can change outside of control + * plane operations. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + CapacityReservationInstanceViewTypes expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (capacityReservationGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter capacityReservationGroupName is required and cannot be null.")); + } + if (capacityReservationName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter capacityReservationName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + capacityReservationGroupName, + capacityReservationName, + expand, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation that retrieves information about the capacity reservation. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param expand The expand expression to apply on the operation. 'InstanceView' retrieves a snapshot of the runtime + * properties of the capacity reservation that is managed by the platform and can change outside of control + * plane operations. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + CapacityReservationInstanceViewTypes expand, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (capacityReservationGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter capacityReservationGroupName is required and cannot be null.")); + } + if (capacityReservationName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter capacityReservationName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + capacityReservationGroupName, + capacityReservationName, + expand, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * The operation that retrieves information about the capacity reservation. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String capacityReservationGroupName, String capacityReservationName) { + final CapacityReservationInstanceViewTypes expand = null; + return getWithResponseAsync(resourceGroupName, capacityReservationGroupName, capacityReservationName, expand) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * The operation that retrieves information about the capacity reservation. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param expand The expand expression to apply on the operation. 'InstanceView' retrieves a snapshot of the runtime + * properties of the capacity reservation that is managed by the platform and can change outside of control + * plane operations. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + CapacityReservationInstanceViewTypes expand, + Context context) { + return getWithResponseAsync( + resourceGroupName, capacityReservationGroupName, capacityReservationName, expand, context) + .block(); + } + + /** + * The operation that retrieves information about the capacity reservation. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CapacityReservationInner get( + String resourceGroupName, String capacityReservationGroupName, String capacityReservationName) { + final CapacityReservationInstanceViewTypes expand = null; + return getWithResponse( + resourceGroupName, capacityReservationGroupName, capacityReservationName, expand, Context.NONE) + .getValue(); + } + + /** + * Lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in + * the response to get the next page of capacity reservations. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list capacity reservation operation response along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByCapacityReservationGroupSinglePageAsync( + String resourceGroupName, String capacityReservationGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (capacityReservationGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter capacityReservationGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByCapacityReservationGroup( + this.client.getEndpoint(), + resourceGroupName, + capacityReservationGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in + * the response to get the next page of capacity reservations. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list capacity reservation operation response along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByCapacityReservationGroupSinglePageAsync( + String resourceGroupName, String capacityReservationGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (capacityReservationGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter capacityReservationGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByCapacityReservationGroup( + this.client.getEndpoint(), + resourceGroupName, + capacityReservationGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in + * the response to get the next page of capacity reservations. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list capacity reservation operation response as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByCapacityReservationGroupAsync( + String resourceGroupName, String capacityReservationGroupName) { + return new PagedFlux<>( + () -> listByCapacityReservationGroupSinglePageAsync(resourceGroupName, capacityReservationGroupName), + nextLink -> listByCapacityReservationGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in + * the response to get the next page of capacity reservations. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list capacity reservation operation response as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByCapacityReservationGroupAsync( + String resourceGroupName, String capacityReservationGroupName, Context context) { + return new PagedFlux<>( + () -> + listByCapacityReservationGroupSinglePageAsync(resourceGroupName, capacityReservationGroupName, context), + nextLink -> listByCapacityReservationGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in + * the response to get the next page of capacity reservations. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list capacity reservation operation response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByCapacityReservationGroup( + String resourceGroupName, String capacityReservationGroupName) { + return new PagedIterable<>( + listByCapacityReservationGroupAsync(resourceGroupName, capacityReservationGroupName)); + } + + /** + * Lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in + * the response to get the next page of capacity reservations. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list capacity reservation operation response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByCapacityReservationGroup( + String resourceGroupName, String capacityReservationGroupName, Context context) { + return new PagedIterable<>( + listByCapacityReservationGroupAsync(resourceGroupName, capacityReservationGroupName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list capacity reservation operation response along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByCapacityReservationGroupNextSinglePageAsync( + String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service.listByCapacityReservationGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list capacity reservation operation response along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByCapacityReservationGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByCapacityReservationGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CapacityReservationsImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CapacityReservationsImpl.java new file mode 100644 index 0000000000000..a996afa46e917 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CapacityReservationsImpl.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.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.CapacityReservationsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.CapacityReservationInner; +import com.azure.resourcemanager.compute.generated.models.CapacityReservation; +import com.azure.resourcemanager.compute.generated.models.CapacityReservationInstanceViewTypes; +import com.azure.resourcemanager.compute.generated.models.CapacityReservations; + +public final class CapacityReservationsImpl implements CapacityReservations { + private static final ClientLogger LOGGER = new ClientLogger(CapacityReservationsImpl.class); + + private final CapacityReservationsClient innerClient; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + public CapacityReservationsImpl( + CapacityReservationsClient innerClient, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void delete(String resourceGroupName, String capacityReservationGroupName, String capacityReservationName) { + this.serviceClient().delete(resourceGroupName, capacityReservationGroupName, capacityReservationName); + } + + public void delete( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + Context context) { + this.serviceClient().delete(resourceGroupName, capacityReservationGroupName, capacityReservationName, context); + } + + public Response getWithResponse( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + CapacityReservationInstanceViewTypes expand, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse( + resourceGroupName, capacityReservationGroupName, capacityReservationName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CapacityReservationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CapacityReservation get( + String resourceGroupName, String capacityReservationGroupName, String capacityReservationName) { + CapacityReservationInner inner = + this.serviceClient().get(resourceGroupName, capacityReservationGroupName, capacityReservationName); + if (inner != null) { + return new CapacityReservationImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listByCapacityReservationGroup( + String resourceGroupName, String capacityReservationGroupName) { + PagedIterable inner = + this.serviceClient().listByCapacityReservationGroup(resourceGroupName, capacityReservationGroupName); + return Utils.mapPage(inner, inner1 -> new CapacityReservationImpl(inner1, this.manager())); + } + + public PagedIterable listByCapacityReservationGroup( + String resourceGroupName, String capacityReservationGroupName, Context context) { + PagedIterable inner = + this + .serviceClient() + .listByCapacityReservationGroup(resourceGroupName, capacityReservationGroupName, context); + return Utils.mapPage(inner, inner1 -> new CapacityReservationImpl(inner1, this.manager())); + } + + public CapacityReservation getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String capacityReservationGroupName = Utils.getValueFromIdByName(id, "capacityReservationGroups"); + if (capacityReservationGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'capacityReservationGroups'.", + id))); + } + String capacityReservationName = Utils.getValueFromIdByName(id, "capacityReservations"); + if (capacityReservationName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'capacityReservations'.", + id))); + } + CapacityReservationInstanceViewTypes localExpand = null; + return this + .getWithResponse( + resourceGroupName, capacityReservationGroupName, capacityReservationName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse( + String id, CapacityReservationInstanceViewTypes expand, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String capacityReservationGroupName = Utils.getValueFromIdByName(id, "capacityReservationGroups"); + if (capacityReservationGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'capacityReservationGroups'.", + id))); + } + String capacityReservationName = Utils.getValueFromIdByName(id, "capacityReservations"); + if (capacityReservationName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'capacityReservations'.", + id))); + } + return this + .getWithResponse(resourceGroupName, capacityReservationGroupName, capacityReservationName, expand, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String capacityReservationGroupName = Utils.getValueFromIdByName(id, "capacityReservationGroups"); + if (capacityReservationGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'capacityReservationGroups'.", + id))); + } + String capacityReservationName = Utils.getValueFromIdByName(id, "capacityReservations"); + if (capacityReservationName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'capacityReservations'.", + id))); + } + this.delete(resourceGroupName, capacityReservationGroupName, capacityReservationName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String capacityReservationGroupName = Utils.getValueFromIdByName(id, "capacityReservationGroups"); + if (capacityReservationGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'capacityReservationGroups'.", + id))); + } + String capacityReservationName = Utils.getValueFromIdByName(id, "capacityReservations"); + if (capacityReservationName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'capacityReservations'.", + id))); + } + this.delete(resourceGroupName, capacityReservationGroupName, capacityReservationName, context); + } + + private CapacityReservationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } + + public CapacityReservationImpl define(String name) { + return new CapacityReservationImpl(name, this.manager()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceImpl.java new file mode 100644 index 0000000000000..a19b1bd17d5a7 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceImpl.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.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.CloudServiceInner; +import com.azure.resourcemanager.compute.generated.models.CloudService; +import com.azure.resourcemanager.compute.generated.models.CloudServiceProperties; +import com.azure.resourcemanager.compute.generated.models.CloudServiceUpdate; +import com.azure.resourcemanager.compute.generated.models.RoleInstances; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class CloudServiceImpl implements CloudService, CloudService.Definition, CloudService.Update { + private CloudServiceInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public CloudServiceProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public List zones() { + List inner = this.innerModel().zones(); + 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 String resourceGroupName() { + return resourceGroupName; + } + + public CloudServiceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String cloudServiceName; + + private CloudServiceUpdate updateParameters; + + public CloudServiceImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public CloudService create() { + this.innerObject = + serviceManager + .serviceClient() + .getCloudServices() + .createOrUpdate(resourceGroupName, cloudServiceName, this.innerModel(), Context.NONE); + return this; + } + + public CloudService create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getCloudServices() + .createOrUpdate(resourceGroupName, cloudServiceName, this.innerModel(), context); + return this; + } + + CloudServiceImpl(String name, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = new CloudServiceInner(); + this.serviceManager = serviceManager; + this.cloudServiceName = name; + } + + public CloudServiceImpl update() { + this.updateParameters = new CloudServiceUpdate(); + return this; + } + + public CloudService apply() { + this.innerObject = + serviceManager + .serviceClient() + .getCloudServices() + .update(resourceGroupName, cloudServiceName, updateParameters, Context.NONE); + return this; + } + + public CloudService apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getCloudServices() + .update(resourceGroupName, cloudServiceName, updateParameters, context); + return this; + } + + CloudServiceImpl( + CloudServiceInner innerObject, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.cloudServiceName = Utils.getValueFromIdByName(innerObject.id(), "cloudServices"); + } + + public CloudService refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getCloudServices() + .getByResourceGroupWithResponse(resourceGroupName, cloudServiceName, Context.NONE) + .getValue(); + return this; + } + + public CloudService refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getCloudServices() + .getByResourceGroupWithResponse(resourceGroupName, cloudServiceName, context) + .getValue(); + return this; + } + + public void start() { + serviceManager.cloudServices().start(resourceGroupName, cloudServiceName); + } + + public void start(Context context) { + serviceManager.cloudServices().start(resourceGroupName, cloudServiceName, context); + } + + public void powerOff() { + serviceManager.cloudServices().powerOff(resourceGroupName, cloudServiceName); + } + + public void powerOff(Context context) { + serviceManager.cloudServices().powerOff(resourceGroupName, cloudServiceName, context); + } + + public void restart() { + serviceManager.cloudServices().restart(resourceGroupName, cloudServiceName); + } + + public void restart(RoleInstances parameters, Context context) { + serviceManager.cloudServices().restart(resourceGroupName, cloudServiceName, parameters, context); + } + + public void reimage() { + serviceManager.cloudServices().reimage(resourceGroupName, cloudServiceName); + } + + public void reimage(RoleInstances parameters, Context context) { + serviceManager.cloudServices().reimage(resourceGroupName, cloudServiceName, parameters, context); + } + + public void rebuild() { + serviceManager.cloudServices().rebuild(resourceGroupName, cloudServiceName); + } + + public void rebuild(RoleInstances parameters, Context context) { + serviceManager.cloudServices().rebuild(resourceGroupName, cloudServiceName, parameters, context); + } + + public void deleteInstances() { + serviceManager.cloudServices().deleteInstances(resourceGroupName, cloudServiceName); + } + + public void deleteInstances(RoleInstances parameters, Context context) { + serviceManager.cloudServices().deleteInstances(resourceGroupName, cloudServiceName, parameters, context); + } + + public CloudServiceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public CloudServiceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public CloudServiceImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public CloudServiceImpl withProperties(CloudServiceProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + public CloudServiceImpl withSystemData(SystemData systemData) { + this.innerModel().withSystemData(systemData); + return this; + } + + public CloudServiceImpl withZones(List zones) { + this.innerModel().withZones(zones); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceInstanceViewImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceInstanceViewImpl.java new file mode 100644 index 0000000000000..c4ad3630d182a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceInstanceViewImpl.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.resourcemanager.compute.generated.fluent.models.CloudServiceInstanceViewInner; +import com.azure.resourcemanager.compute.generated.models.CloudServiceInstanceView; +import com.azure.resourcemanager.compute.generated.models.InstanceViewStatusesSummary; +import com.azure.resourcemanager.compute.generated.models.ResourceInstanceViewStatus; +import java.util.Collections; +import java.util.List; + +public final class CloudServiceInstanceViewImpl implements CloudServiceInstanceView { + private CloudServiceInstanceViewInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + CloudServiceInstanceViewImpl( + CloudServiceInstanceViewInner innerObject, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public InstanceViewStatusesSummary roleInstance() { + return this.innerModel().roleInstance(); + } + + public String sdkVersion() { + return this.innerModel().sdkVersion(); + } + + public List privateIds() { + List inner = this.innerModel().privateIds(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List statuses() { + List inner = this.innerModel().statuses(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public CloudServiceInstanceViewInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceOperatingSystemsClientImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceOperatingSystemsClientImpl.java new file mode 100644 index 0000000000000..20e5e0d45a99d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceOperatingSystemsClientImpl.java @@ -0,0 +1,927 @@ +// Copyright (c) Microsoft Corporation. All rights 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.resourcemanager.compute.generated.fluent.CloudServiceOperatingSystemsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.OSFamilyInner; +import com.azure.resourcemanager.compute.generated.fluent.models.OSVersionInner; +import com.azure.resourcemanager.compute.generated.models.ApiErrorException; +import com.azure.resourcemanager.compute.generated.models.OSFamilyListResult; +import com.azure.resourcemanager.compute.generated.models.OSVersionListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in CloudServiceOperatingSystemsClient. */ +public final class CloudServiceOperatingSystemsClientImpl implements CloudServiceOperatingSystemsClient { + /** The proxy service used to perform REST calls. */ + private final CloudServiceOperatingSystemsService service; + + /** The service client containing this operation class. */ + private final ComputeManagementClientImpl client; + + /** + * Initializes an instance of CloudServiceOperatingSystemsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CloudServiceOperatingSystemsClientImpl(ComputeManagementClientImpl client) { + this.service = + RestProxy + .create( + CloudServiceOperatingSystemsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ComputeManagementClientCloudServiceOperatingSystems to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ComputeManagementCli") + public interface CloudServiceOperatingSystemsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/cloudServiceOsVersions/{osVersionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> getOSVersion( + @HostParam("$host") String endpoint, + @PathParam("location") String location, + @PathParam("osVersionName") String osVersionName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/cloudServiceOsVersions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> listOSVersions( + @HostParam("$host") String endpoint, + @PathParam("location") String location, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/cloudServiceOsFamilies/{osFamilyName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> getOSFamily( + @HostParam("$host") String endpoint, + @PathParam("location") String location, + @PathParam("osFamilyName") String osFamilyName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/cloudServiceOsFamilies") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> listOSFamilies( + @HostParam("$host") String endpoint, + @PathParam("location") String location, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> listOSVersionsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> listOSFamiliesNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets properties of a guest operating system version that can be specified in the XML service configuration + * (.cscfg) for a cloud service. + * + * @param location Name of the location that the OS version pertains to. + * @param osVersionName Name of the OS version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a guest operating system version that can be specified in the XML service configuration + * (.cscfg) for a cloud service along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getOSVersionWithResponseAsync(String location, String osVersionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (osVersionName == null) { + return Mono.error(new IllegalArgumentException("Parameter osVersionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2022-09-04"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getOSVersion( + this.client.getEndpoint(), + location, + osVersionName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets properties of a guest operating system version that can be specified in the XML service configuration + * (.cscfg) for a cloud service. + * + * @param location Name of the location that the OS version pertains to. + * @param osVersionName Name of the OS version. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a guest operating system version that can be specified in the XML service configuration + * (.cscfg) for a cloud service along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getOSVersionWithResponseAsync( + String location, String osVersionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (osVersionName == null) { + return Mono.error(new IllegalArgumentException("Parameter osVersionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2022-09-04"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getOSVersion( + this.client.getEndpoint(), + location, + osVersionName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context); + } + + /** + * Gets properties of a guest operating system version that can be specified in the XML service configuration + * (.cscfg) for a cloud service. + * + * @param location Name of the location that the OS version pertains to. + * @param osVersionName Name of the OS version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a guest operating system version that can be specified in the XML service configuration + * (.cscfg) for a cloud service on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getOSVersionAsync(String location, String osVersionName) { + return getOSVersionWithResponseAsync(location, osVersionName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets properties of a guest operating system version that can be specified in the XML service configuration + * (.cscfg) for a cloud service. + * + * @param location Name of the location that the OS version pertains to. + * @param osVersionName Name of the OS version. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a guest operating system version that can be specified in the XML service configuration + * (.cscfg) for a cloud service along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getOSVersionWithResponse(String location, String osVersionName, Context context) { + return getOSVersionWithResponseAsync(location, osVersionName, context).block(); + } + + /** + * Gets properties of a guest operating system version that can be specified in the XML service configuration + * (.cscfg) for a cloud service. + * + * @param location Name of the location that the OS version pertains to. + * @param osVersionName Name of the OS version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a guest operating system version that can be specified in the XML service configuration + * (.cscfg) for a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OSVersionInner getOSVersion(String location, String osVersionName) { + return getOSVersionWithResponse(location, osVersionName, Context.NONE).getValue(); + } + + /** + * Gets a list of all guest operating system versions available to be specified in the XML service configuration + * (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS versions. Do this + * till nextLink is null to fetch all the OS versions. + * + * @param location Name of the location that the OS versions pertain to. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all guest operating system versions available to be specified in the XML service configuration + * (.cscfg) for a cloud service along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listOSVersionsSinglePageAsync(String location) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2022-09-04"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listOSVersions( + this.client.getEndpoint(), + location, + this.client.getSubscriptionId(), + apiVersion, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of all guest operating system versions available to be specified in the XML service configuration + * (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS versions. Do this + * till nextLink is null to fetch all the OS versions. + * + * @param location Name of the location that the OS versions pertain to. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all guest operating system versions available to be specified in the XML service configuration + * (.cscfg) for a cloud service along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listOSVersionsSinglePageAsync(String location, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2022-09-04"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listOSVersions( + this.client.getEndpoint(), location, this.client.getSubscriptionId(), apiVersion, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets a list of all guest operating system versions available to be specified in the XML service configuration + * (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS versions. Do this + * till nextLink is null to fetch all the OS versions. + * + * @param location Name of the location that the OS versions pertain to. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all guest operating system versions available to be specified in the XML service configuration + * (.cscfg) for a cloud service as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listOSVersionsAsync(String location) { + return new PagedFlux<>( + () -> listOSVersionsSinglePageAsync(location), nextLink -> listOSVersionsNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of all guest operating system versions available to be specified in the XML service configuration + * (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS versions. Do this + * till nextLink is null to fetch all the OS versions. + * + * @param location Name of the location that the OS versions pertain to. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all guest operating system versions available to be specified in the XML service configuration + * (.cscfg) for a cloud service as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listOSVersionsAsync(String location, Context context) { + return new PagedFlux<>( + () -> listOSVersionsSinglePageAsync(location, context), + nextLink -> listOSVersionsNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets a list of all guest operating system versions available to be specified in the XML service configuration + * (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS versions. Do this + * till nextLink is null to fetch all the OS versions. + * + * @param location Name of the location that the OS versions pertain to. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all guest operating system versions available to be specified in the XML service configuration + * (.cscfg) for a cloud service as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listOSVersions(String location) { + return new PagedIterable<>(listOSVersionsAsync(location)); + } + + /** + * Gets a list of all guest operating system versions available to be specified in the XML service configuration + * (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS versions. Do this + * till nextLink is null to fetch all the OS versions. + * + * @param location Name of the location that the OS versions pertain to. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all guest operating system versions available to be specified in the XML service configuration + * (.cscfg) for a cloud service as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listOSVersions(String location, Context context) { + return new PagedIterable<>(listOSVersionsAsync(location, context)); + } + + /** + * Gets properties of a guest operating system family that can be specified in the XML service configuration + * (.cscfg) for a cloud service. + * + * @param location Name of the location that the OS family pertains to. + * @param osFamilyName Name of the OS family. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a guest operating system family that can be specified in the XML service configuration + * (.cscfg) for a cloud service along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getOSFamilyWithResponseAsync(String location, String osFamilyName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (osFamilyName == null) { + return Mono.error(new IllegalArgumentException("Parameter osFamilyName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2022-09-04"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getOSFamily( + this.client.getEndpoint(), + location, + osFamilyName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets properties of a guest operating system family that can be specified in the XML service configuration + * (.cscfg) for a cloud service. + * + * @param location Name of the location that the OS family pertains to. + * @param osFamilyName Name of the OS family. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a guest operating system family that can be specified in the XML service configuration + * (.cscfg) for a cloud service along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getOSFamilyWithResponseAsync( + String location, String osFamilyName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (osFamilyName == null) { + return Mono.error(new IllegalArgumentException("Parameter osFamilyName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2022-09-04"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getOSFamily( + this.client.getEndpoint(), + location, + osFamilyName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context); + } + + /** + * Gets properties of a guest operating system family that can be specified in the XML service configuration + * (.cscfg) for a cloud service. + * + * @param location Name of the location that the OS family pertains to. + * @param osFamilyName Name of the OS family. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a guest operating system family that can be specified in the XML service configuration + * (.cscfg) for a cloud service on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getOSFamilyAsync(String location, String osFamilyName) { + return getOSFamilyWithResponseAsync(location, osFamilyName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets properties of a guest operating system family that can be specified in the XML service configuration + * (.cscfg) for a cloud service. + * + * @param location Name of the location that the OS family pertains to. + * @param osFamilyName Name of the OS family. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a guest operating system family that can be specified in the XML service configuration + * (.cscfg) for a cloud service along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getOSFamilyWithResponse(String location, String osFamilyName, Context context) { + return getOSFamilyWithResponseAsync(location, osFamilyName, context).block(); + } + + /** + * Gets properties of a guest operating system family that can be specified in the XML service configuration + * (.cscfg) for a cloud service. + * + * @param location Name of the location that the OS family pertains to. + * @param osFamilyName Name of the OS family. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a guest operating system family that can be specified in the XML service configuration + * (.cscfg) for a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OSFamilyInner getOSFamily(String location, String osFamilyName) { + return getOSFamilyWithResponse(location, osFamilyName, Context.NONE).getValue(); + } + + /** + * Gets a list of all guest operating system families available to be specified in the XML service configuration + * (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS Families. Do this + * till nextLink is null to fetch all the OS Families. + * + * @param location Name of the location that the OS families pertain to. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all guest operating system families available to be specified in the XML service configuration + * (.cscfg) for a cloud service along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listOSFamiliesSinglePageAsync(String location) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2022-09-04"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listOSFamilies( + this.client.getEndpoint(), + location, + this.client.getSubscriptionId(), + apiVersion, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of all guest operating system families available to be specified in the XML service configuration + * (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS Families. Do this + * till nextLink is null to fetch all the OS Families. + * + * @param location Name of the location that the OS families pertain to. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all guest operating system families available to be specified in the XML service configuration + * (.cscfg) for a cloud service along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listOSFamiliesSinglePageAsync(String location, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2022-09-04"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listOSFamilies( + this.client.getEndpoint(), location, this.client.getSubscriptionId(), apiVersion, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets a list of all guest operating system families available to be specified in the XML service configuration + * (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS Families. Do this + * till nextLink is null to fetch all the OS Families. + * + * @param location Name of the location that the OS families pertain to. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all guest operating system families available to be specified in the XML service configuration + * (.cscfg) for a cloud service as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listOSFamiliesAsync(String location) { + return new PagedFlux<>( + () -> listOSFamiliesSinglePageAsync(location), nextLink -> listOSFamiliesNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of all guest operating system families available to be specified in the XML service configuration + * (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS Families. Do this + * till nextLink is null to fetch all the OS Families. + * + * @param location Name of the location that the OS families pertain to. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all guest operating system families available to be specified in the XML service configuration + * (.cscfg) for a cloud service as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listOSFamiliesAsync(String location, Context context) { + return new PagedFlux<>( + () -> listOSFamiliesSinglePageAsync(location, context), + nextLink -> listOSFamiliesNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets a list of all guest operating system families available to be specified in the XML service configuration + * (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS Families. Do this + * till nextLink is null to fetch all the OS Families. + * + * @param location Name of the location that the OS families pertain to. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all guest operating system families available to be specified in the XML service configuration + * (.cscfg) for a cloud service as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listOSFamilies(String location) { + return new PagedIterable<>(listOSFamiliesAsync(location)); + } + + /** + * Gets a list of all guest operating system families available to be specified in the XML service configuration + * (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS Families. Do this + * till nextLink is null to fetch all the OS Families. + * + * @param location Name of the location that the OS families pertain to. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all guest operating system families available to be specified in the XML service configuration + * (.cscfg) for a cloud service as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listOSFamilies(String location, Context context) { + return new PagedIterable<>(listOSFamiliesAsync(location, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 operation result along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listOSVersionsNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listOSVersionsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list operation result along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listOSVersionsNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listOSVersionsNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 operation result along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listOSFamiliesNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listOSFamiliesNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list operation result along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listOSFamiliesNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listOSFamiliesNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceOperatingSystemsImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceOperatingSystemsImpl.java new file mode 100644 index 0000000000000..a47675c933849 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceOperatingSystemsImpl.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.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.CloudServiceOperatingSystemsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.OSFamilyInner; +import com.azure.resourcemanager.compute.generated.fluent.models.OSVersionInner; +import com.azure.resourcemanager.compute.generated.models.CloudServiceOperatingSystems; +import com.azure.resourcemanager.compute.generated.models.OSFamily; +import com.azure.resourcemanager.compute.generated.models.OSVersion; + +public final class CloudServiceOperatingSystemsImpl implements CloudServiceOperatingSystems { + private static final ClientLogger LOGGER = new ClientLogger(CloudServiceOperatingSystemsImpl.class); + + private final CloudServiceOperatingSystemsClient innerClient; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + public CloudServiceOperatingSystemsImpl( + CloudServiceOperatingSystemsClient innerClient, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getOSVersionWithResponse(String location, String osVersionName, Context context) { + Response inner = + this.serviceClient().getOSVersionWithResponse(location, osVersionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new OSVersionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public OSVersion getOSVersion(String location, String osVersionName) { + OSVersionInner inner = this.serviceClient().getOSVersion(location, osVersionName); + if (inner != null) { + return new OSVersionImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listOSVersions(String location) { + PagedIterable inner = this.serviceClient().listOSVersions(location); + return Utils.mapPage(inner, inner1 -> new OSVersionImpl(inner1, this.manager())); + } + + public PagedIterable listOSVersions(String location, Context context) { + PagedIterable inner = this.serviceClient().listOSVersions(location, context); + return Utils.mapPage(inner, inner1 -> new OSVersionImpl(inner1, this.manager())); + } + + public Response getOSFamilyWithResponse(String location, String osFamilyName, Context context) { + Response inner = this.serviceClient().getOSFamilyWithResponse(location, osFamilyName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new OSFamilyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public OSFamily getOSFamily(String location, String osFamilyName) { + OSFamilyInner inner = this.serviceClient().getOSFamily(location, osFamilyName); + if (inner != null) { + return new OSFamilyImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listOSFamilies(String location) { + PagedIterable inner = this.serviceClient().listOSFamilies(location); + return Utils.mapPage(inner, inner1 -> new OSFamilyImpl(inner1, this.manager())); + } + + public PagedIterable listOSFamilies(String location, Context context) { + PagedIterable inner = this.serviceClient().listOSFamilies(location, context); + return Utils.mapPage(inner, inner1 -> new OSFamilyImpl(inner1, this.manager())); + } + + private CloudServiceOperatingSystemsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceRoleImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceRoleImpl.java new file mode 100644 index 0000000000000..cd6057c90628f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceRoleImpl.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.resourcemanager.compute.generated.fluent.models.CloudServiceRoleInner; +import com.azure.resourcemanager.compute.generated.models.CloudServiceRole; +import com.azure.resourcemanager.compute.generated.models.CloudServiceRoleProperties; +import com.azure.resourcemanager.compute.generated.models.CloudServiceRoleSku; + +public final class CloudServiceRoleImpl implements CloudServiceRole { + private CloudServiceRoleInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + CloudServiceRoleImpl( + CloudServiceRoleInner innerObject, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public CloudServiceRoleSku sku() { + return this.innerModel().sku(); + } + + public CloudServiceRoleProperties properties() { + return this.innerModel().properties(); + } + + public CloudServiceRoleInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceRoleInstancesClientImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceRoleInstancesClientImpl.java new file mode 100644 index 0000000000000..d256e96987c01 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceRoleInstancesClientImpl.java @@ -0,0 +1,2073 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.compute.generated.fluent.CloudServiceRoleInstancesClient; +import com.azure.resourcemanager.compute.generated.fluent.models.RoleInstanceInner; +import com.azure.resourcemanager.compute.generated.fluent.models.RoleInstanceViewInner; +import com.azure.resourcemanager.compute.generated.models.ApiErrorException; +import com.azure.resourcemanager.compute.generated.models.InstanceViewTypes; +import com.azure.resourcemanager.compute.generated.models.RoleInstanceListResult; +import 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 CloudServiceRoleInstancesClient. */ +public final class CloudServiceRoleInstancesClientImpl implements CloudServiceRoleInstancesClient { + /** The proxy service used to perform REST calls. */ + private final CloudServiceRoleInstancesService service; + + /** The service client containing this operation class. */ + private final ComputeManagementClientImpl client; + + /** + * Initializes an instance of CloudServiceRoleInstancesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CloudServiceRoleInstancesClientImpl(ComputeManagementClientImpl client) { + this.service = + RestProxy + .create( + CloudServiceRoleInstancesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ComputeManagementClientCloudServiceRoleInstances to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ComputeManagementCli") + public interface CloudServiceRoleInstancesService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("roleInstanceName") String roleInstanceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudServiceName") String cloudServiceName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("roleInstanceName") String roleInstanceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudServiceName") String cloudServiceName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @QueryParam("$expand") InstanceViewTypes expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/instanceView") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> getInstanceView( + @HostParam("$host") String endpoint, + @PathParam("roleInstanceName") String roleInstanceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudServiceName") String cloudServiceName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudServiceName") String cloudServiceName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @QueryParam("$expand") InstanceViewTypes expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/restart") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> restart( + @HostParam("$host") String endpoint, + @PathParam("roleInstanceName") String roleInstanceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudServiceName") String cloudServiceName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/reimage") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> reimage( + @HostParam("$host") String endpoint, + @PathParam("roleInstanceName") String roleInstanceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudServiceName") String cloudServiceName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/rebuild") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> rebuild( + @HostParam("$host") String endpoint, + @PathParam("roleInstanceName") String roleInstanceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudServiceName") String cloudServiceName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/remoteDesktopFile") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getRemoteDesktopFile( + @HostParam("$host") String endpoint, + @PathParam("roleInstanceName") String roleInstanceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudServiceName") String cloudServiceName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes a role instance from a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String roleInstanceName, String resourceGroupName, String cloudServiceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (roleInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleInstanceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2022-09-04"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + roleInstanceName, + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a role instance from a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (roleInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleInstanceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2022-09-04"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + roleInstanceName, + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context); + } + + /** + * Deletes a role instance from a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String roleInstanceName, String resourceGroupName, String cloudServiceName) { + Mono>> mono = + deleteWithResponseAsync(roleInstanceName, resourceGroupName, cloudServiceName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes a role instance from a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(roleInstanceName, resourceGroupName, cloudServiceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a role instance from a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String roleInstanceName, String resourceGroupName, String cloudServiceName) { + return this.beginDeleteAsync(roleInstanceName, resourceGroupName, cloudServiceName).getSyncPoller(); + } + + /** + * Deletes a role instance from a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context) { + return this.beginDeleteAsync(roleInstanceName, resourceGroupName, cloudServiceName, context).getSyncPoller(); + } + + /** + * Deletes a role instance from a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String roleInstanceName, String resourceGroupName, String cloudServiceName) { + return beginDeleteAsync(roleInstanceName, resourceGroupName, cloudServiceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a role instance from a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context) { + return beginDeleteAsync(roleInstanceName, resourceGroupName, cloudServiceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a role instance from a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String roleInstanceName, String resourceGroupName, String cloudServiceName) { + deleteAsync(roleInstanceName, resourceGroupName, cloudServiceName).block(); + } + + /** + * Deletes a role instance from a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context) { + deleteAsync(roleInstanceName, resourceGroupName, cloudServiceName, context).block(); + } + + /** + * Gets a role instance from a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param expand The expand expression to apply to the operation. 'UserData' is not supported for cloud services. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a role instance from a cloud service along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String roleInstanceName, String resourceGroupName, String cloudServiceName, InstanceViewTypes expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (roleInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleInstanceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2022-09-04"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + roleInstanceName, + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + expand, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a role instance from a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param expand The expand expression to apply to the operation. 'UserData' is not supported for cloud services. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a role instance from a cloud service along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String roleInstanceName, + String resourceGroupName, + String cloudServiceName, + InstanceViewTypes expand, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (roleInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleInstanceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2022-09-04"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + roleInstanceName, + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + expand, + accept, + context); + } + + /** + * Gets a role instance from a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a role instance from a cloud service on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String roleInstanceName, String resourceGroupName, String cloudServiceName) { + final InstanceViewTypes expand = null; + return getWithResponseAsync(roleInstanceName, resourceGroupName, cloudServiceName, expand) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a role instance from a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param expand The expand expression to apply to the operation. 'UserData' is not supported for cloud services. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a role instance from a cloud service along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String roleInstanceName, + String resourceGroupName, + String cloudServiceName, + InstanceViewTypes expand, + Context context) { + return getWithResponseAsync(roleInstanceName, resourceGroupName, cloudServiceName, expand, context).block(); + } + + /** + * Gets a role instance from a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a role instance from a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RoleInstanceInner get(String roleInstanceName, String resourceGroupName, String cloudServiceName) { + final InstanceViewTypes expand = null; + return getWithResponse(roleInstanceName, resourceGroupName, cloudServiceName, expand, Context.NONE).getValue(); + } + + /** + * Retrieves information about the run-time state of a role instance in a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the instance view of the role instance along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getInstanceViewWithResponseAsync( + String roleInstanceName, String resourceGroupName, String cloudServiceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (roleInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleInstanceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2022-09-04"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getInstanceView( + this.client.getEndpoint(), + roleInstanceName, + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves information about the run-time state of a role instance in a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the instance view of the role instance along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getInstanceViewWithResponseAsync( + String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (roleInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleInstanceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2022-09-04"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getInstanceView( + this.client.getEndpoint(), + roleInstanceName, + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context); + } + + /** + * Retrieves information about the run-time state of a role instance in a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the instance view of the role instance on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getInstanceViewAsync( + String roleInstanceName, String resourceGroupName, String cloudServiceName) { + return getInstanceViewWithResponseAsync(roleInstanceName, resourceGroupName, cloudServiceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieves information about the run-time state of a role instance in a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the instance view of the role instance along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getInstanceViewWithResponse( + String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context) { + return getInstanceViewWithResponseAsync(roleInstanceName, resourceGroupName, cloudServiceName, context).block(); + } + + /** + * Retrieves information about the run-time state of a role instance in a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the instance view of the role instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RoleInstanceViewInner getInstanceView( + String roleInstanceName, String resourceGroupName, String cloudServiceName) { + return getInstanceViewWithResponse(roleInstanceName, resourceGroupName, cloudServiceName, Context.NONE) + .getValue(); + } + + /** + * Gets the list of all role instances in a cloud service. Use nextLink property in the response to get the next + * page of role instances. Do this till nextLink is null to fetch all the role instances. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param expand The expand expression to apply to the operation. 'UserData' is not supported for cloud services. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of all role instances in a cloud service along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String cloudServiceName, InstanceViewTypes expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2022-09-04"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + expand, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the list of all role instances in a cloud service. Use nextLink property in the response to get the next + * page of role instances. Do this till nextLink is null to fetch all the role instances. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param expand The expand expression to apply to the operation. 'UserData' is not supported for cloud services. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of all role instances in a cloud service along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String cloudServiceName, InstanceViewTypes expand, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2022-09-04"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + expand, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets the list of all role instances in a cloud service. Use nextLink property in the response to get the next + * page of role instances. Do this till nextLink is null to fetch all the role instances. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param expand The expand expression to apply to the operation. 'UserData' is not supported for cloud services. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of all role instances in a cloud service as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String cloudServiceName, InstanceViewTypes expand) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, cloudServiceName, expand), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets the list of all role instances in a cloud service. Use nextLink property in the response to get the next + * page of role instances. Do this till nextLink is null to fetch all the role instances. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of all role instances in a cloud service as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String cloudServiceName) { + final InstanceViewTypes expand = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, cloudServiceName, expand), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets the list of all role instances in a cloud service. Use nextLink property in the response to get the next + * page of role instances. Do this till nextLink is null to fetch all the role instances. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param expand The expand expression to apply to the operation. 'UserData' is not supported for cloud services. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of all role instances in a cloud service as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String cloudServiceName, InstanceViewTypes expand, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, cloudServiceName, expand, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the list of all role instances in a cloud service. Use nextLink property in the response to get the next + * page of role instances. Do this till nextLink is null to fetch all the role instances. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of all role instances in a cloud service as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String cloudServiceName) { + final InstanceViewTypes expand = null; + return new PagedIterable<>(listAsync(resourceGroupName, cloudServiceName, expand)); + } + + /** + * Gets the list of all role instances in a cloud service. Use nextLink property in the response to get the next + * page of role instances. Do this till nextLink is null to fetch all the role instances. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param expand The expand expression to apply to the operation. 'UserData' is not supported for cloud services. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of all role instances in a cloud service as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String cloudServiceName, InstanceViewTypes expand, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, cloudServiceName, expand, context)); + } + + /** + * The Reboot Role Instance asynchronous operation requests a reboot of a role instance in the cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> restartWithResponseAsync( + String roleInstanceName, String resourceGroupName, String cloudServiceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (roleInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleInstanceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2022-09-04"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .restart( + this.client.getEndpoint(), + roleInstanceName, + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The Reboot Role Instance asynchronous operation requests a reboot of a role instance in the cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> restartWithResponseAsync( + String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (roleInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleInstanceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2022-09-04"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .restart( + this.client.getEndpoint(), + roleInstanceName, + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context); + } + + /** + * The Reboot Role Instance asynchronous operation requests a reboot of a role instance in the cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginRestartAsync( + String roleInstanceName, String resourceGroupName, String cloudServiceName) { + Mono>> mono = + restartWithResponseAsync(roleInstanceName, resourceGroupName, cloudServiceName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * The Reboot Role Instance asynchronous operation requests a reboot of a role instance in the cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginRestartAsync( + String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + restartWithResponseAsync(roleInstanceName, resourceGroupName, cloudServiceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * The Reboot Role Instance asynchronous operation requests a reboot of a role instance in the cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRestart( + String roleInstanceName, String resourceGroupName, String cloudServiceName) { + return this.beginRestartAsync(roleInstanceName, resourceGroupName, cloudServiceName).getSyncPoller(); + } + + /** + * The Reboot Role Instance asynchronous operation requests a reboot of a role instance in the cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRestart( + String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context) { + return this.beginRestartAsync(roleInstanceName, resourceGroupName, cloudServiceName, context).getSyncPoller(); + } + + /** + * The Reboot Role Instance asynchronous operation requests a reboot of a role instance in the cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restartAsync(String roleInstanceName, String resourceGroupName, String cloudServiceName) { + return beginRestartAsync(roleInstanceName, resourceGroupName, cloudServiceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The Reboot Role Instance asynchronous operation requests a reboot of a role instance in the cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restartAsync( + String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context) { + return beginRestartAsync(roleInstanceName, resourceGroupName, cloudServiceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The Reboot Role Instance asynchronous operation requests a reboot of a role instance in the cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void restart(String roleInstanceName, String resourceGroupName, String cloudServiceName) { + restartAsync(roleInstanceName, resourceGroupName, cloudServiceName).block(); + } + + /** + * The Reboot Role Instance asynchronous operation requests a reboot of a role instance in the cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void restart(String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context) { + restartAsync(roleInstanceName, resourceGroupName, cloudServiceName, context).block(); + } + + /** + * The Reimage Role Instance asynchronous operation reinstalls the operating system on instances of web roles or + * worker roles. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> reimageWithResponseAsync( + String roleInstanceName, String resourceGroupName, String cloudServiceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (roleInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleInstanceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2022-09-04"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .reimage( + this.client.getEndpoint(), + roleInstanceName, + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The Reimage Role Instance asynchronous operation reinstalls the operating system on instances of web roles or + * worker roles. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> reimageWithResponseAsync( + String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (roleInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleInstanceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2022-09-04"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .reimage( + this.client.getEndpoint(), + roleInstanceName, + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context); + } + + /** + * The Reimage Role Instance asynchronous operation reinstalls the operating system on instances of web roles or + * worker roles. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginReimageAsync( + String roleInstanceName, String resourceGroupName, String cloudServiceName) { + Mono>> mono = + reimageWithResponseAsync(roleInstanceName, resourceGroupName, cloudServiceName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * The Reimage Role Instance asynchronous operation reinstalls the operating system on instances of web roles or + * worker roles. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginReimageAsync( + String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + reimageWithResponseAsync(roleInstanceName, resourceGroupName, cloudServiceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * The Reimage Role Instance asynchronous operation reinstalls the operating system on instances of web roles or + * worker roles. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginReimage( + String roleInstanceName, String resourceGroupName, String cloudServiceName) { + return this.beginReimageAsync(roleInstanceName, resourceGroupName, cloudServiceName).getSyncPoller(); + } + + /** + * The Reimage Role Instance asynchronous operation reinstalls the operating system on instances of web roles or + * worker roles. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginReimage( + String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context) { + return this.beginReimageAsync(roleInstanceName, resourceGroupName, cloudServiceName, context).getSyncPoller(); + } + + /** + * The Reimage Role Instance asynchronous operation reinstalls the operating system on instances of web roles or + * worker roles. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono reimageAsync(String roleInstanceName, String resourceGroupName, String cloudServiceName) { + return beginReimageAsync(roleInstanceName, resourceGroupName, cloudServiceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The Reimage Role Instance asynchronous operation reinstalls the operating system on instances of web roles or + * worker roles. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono reimageAsync( + String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context) { + return beginReimageAsync(roleInstanceName, resourceGroupName, cloudServiceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The Reimage Role Instance asynchronous operation reinstalls the operating system on instances of web roles or + * worker roles. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void reimage(String roleInstanceName, String resourceGroupName, String cloudServiceName) { + reimageAsync(roleInstanceName, resourceGroupName, cloudServiceName).block(); + } + + /** + * The Reimage Role Instance asynchronous operation reinstalls the operating system on instances of web roles or + * worker roles. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void reimage(String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context) { + reimageAsync(roleInstanceName, resourceGroupName, cloudServiceName, context).block(); + } + + /** + * The Rebuild Role Instance asynchronous operation reinstalls the operating system on instances of web roles or + * worker roles and initializes the storage resources that are used by them. If you do not want to initialize + * storage resources, you can use Reimage Role Instance. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> rebuildWithResponseAsync( + String roleInstanceName, String resourceGroupName, String cloudServiceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (roleInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleInstanceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2022-09-04"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .rebuild( + this.client.getEndpoint(), + roleInstanceName, + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The Rebuild Role Instance asynchronous operation reinstalls the operating system on instances of web roles or + * worker roles and initializes the storage resources that are used by them. If you do not want to initialize + * storage resources, you can use Reimage Role Instance. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> rebuildWithResponseAsync( + String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (roleInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleInstanceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2022-09-04"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .rebuild( + this.client.getEndpoint(), + roleInstanceName, + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context); + } + + /** + * The Rebuild Role Instance asynchronous operation reinstalls the operating system on instances of web roles or + * worker roles and initializes the storage resources that are used by them. If you do not want to initialize + * storage resources, you can use Reimage Role Instance. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginRebuildAsync( + String roleInstanceName, String resourceGroupName, String cloudServiceName) { + Mono>> mono = + rebuildWithResponseAsync(roleInstanceName, resourceGroupName, cloudServiceName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * The Rebuild Role Instance asynchronous operation reinstalls the operating system on instances of web roles or + * worker roles and initializes the storage resources that are used by them. If you do not want to initialize + * storage resources, you can use Reimage Role Instance. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginRebuildAsync( + String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + rebuildWithResponseAsync(roleInstanceName, resourceGroupName, cloudServiceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * The Rebuild Role Instance asynchronous operation reinstalls the operating system on instances of web roles or + * worker roles and initializes the storage resources that are used by them. If you do not want to initialize + * storage resources, you can use Reimage Role Instance. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRebuild( + String roleInstanceName, String resourceGroupName, String cloudServiceName) { + return this.beginRebuildAsync(roleInstanceName, resourceGroupName, cloudServiceName).getSyncPoller(); + } + + /** + * The Rebuild Role Instance asynchronous operation reinstalls the operating system on instances of web roles or + * worker roles and initializes the storage resources that are used by them. If you do not want to initialize + * storage resources, you can use Reimage Role Instance. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRebuild( + String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context) { + return this.beginRebuildAsync(roleInstanceName, resourceGroupName, cloudServiceName, context).getSyncPoller(); + } + + /** + * The Rebuild Role Instance asynchronous operation reinstalls the operating system on instances of web roles or + * worker roles and initializes the storage resources that are used by them. If you do not want to initialize + * storage resources, you can use Reimage Role Instance. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono rebuildAsync(String roleInstanceName, String resourceGroupName, String cloudServiceName) { + return beginRebuildAsync(roleInstanceName, resourceGroupName, cloudServiceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The Rebuild Role Instance asynchronous operation reinstalls the operating system on instances of web roles or + * worker roles and initializes the storage resources that are used by them. If you do not want to initialize + * storage resources, you can use Reimage Role Instance. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono rebuildAsync( + String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context) { + return beginRebuildAsync(roleInstanceName, resourceGroupName, cloudServiceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The Rebuild Role Instance asynchronous operation reinstalls the operating system on instances of web roles or + * worker roles and initializes the storage resources that are used by them. If you do not want to initialize + * storage resources, you can use Reimage Role Instance. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void rebuild(String roleInstanceName, String resourceGroupName, String cloudServiceName) { + rebuildAsync(roleInstanceName, resourceGroupName, cloudServiceName).block(); + } + + /** + * The Rebuild Role Instance asynchronous operation reinstalls the operating system on instances of web roles or + * worker roles and initializes the storage resources that are used by them. If you do not want to initialize + * storage resources, you can use Reimage Role Instance. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void rebuild(String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context) { + rebuildAsync(roleInstanceName, resourceGroupName, cloudServiceName, context).block(); + } + + /** + * Gets a remote desktop file for a role instance in a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a remote desktop file for a role instance in a cloud service along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getRemoteDesktopFileWithResponseAsync( + String roleInstanceName, String resourceGroupName, String cloudServiceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (roleInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleInstanceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2022-09-04"; + final String accept = "application/x-rdp"; + return FluxUtil + .withContext( + context -> + service + .getRemoteDesktopFile( + this.client.getEndpoint(), + roleInstanceName, + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a remote desktop file for a role instance in a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a remote desktop file for a role instance in a cloud service along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getRemoteDesktopFileWithResponseAsync( + String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (roleInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleInstanceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2022-09-04"; + final String accept = "application/x-rdp"; + context = this.client.mergeContext(context); + return service + .getRemoteDesktopFile( + this.client.getEndpoint(), + roleInstanceName, + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context); + } + + /** + * Gets a remote desktop file for a role instance in a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a remote desktop file for a role instance in a cloud service on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getRemoteDesktopFileAsync( + String roleInstanceName, String resourceGroupName, String cloudServiceName) { + return getRemoteDesktopFileWithResponseAsync(roleInstanceName, resourceGroupName, cloudServiceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a remote desktop file for a role instance in a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a remote desktop file for a role instance in a cloud service along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getRemoteDesktopFileWithResponse( + String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context) { + return getRemoteDesktopFileWithResponseAsync(roleInstanceName, resourceGroupName, cloudServiceName, context) + .block(); + } + + /** + * Gets a remote desktop file for a role instance in a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a remote desktop file for a role instance in a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BinaryData getRemoteDesktopFile(String roleInstanceName, String resourceGroupName, String cloudServiceName) { + return getRemoteDesktopFileWithResponse(roleInstanceName, resourceGroupName, cloudServiceName, Context.NONE) + .getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list operation result along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list operation result along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceRoleInstancesImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceRoleInstancesImpl.java new file mode 100644 index 0000000000000..adfe122d192fe --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceRoleInstancesImpl.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.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.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.CloudServiceRoleInstancesClient; +import com.azure.resourcemanager.compute.generated.fluent.models.RoleInstanceInner; +import com.azure.resourcemanager.compute.generated.fluent.models.RoleInstanceViewInner; +import com.azure.resourcemanager.compute.generated.models.CloudServiceRoleInstances; +import com.azure.resourcemanager.compute.generated.models.InstanceViewTypes; +import com.azure.resourcemanager.compute.generated.models.RoleInstance; +import com.azure.resourcemanager.compute.generated.models.RoleInstanceView; + +public final class CloudServiceRoleInstancesImpl implements CloudServiceRoleInstances { + private static final ClientLogger LOGGER = new ClientLogger(CloudServiceRoleInstancesImpl.class); + + private final CloudServiceRoleInstancesClient innerClient; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + public CloudServiceRoleInstancesImpl( + CloudServiceRoleInstancesClient innerClient, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void delete(String roleInstanceName, String resourceGroupName, String cloudServiceName) { + this.serviceClient().delete(roleInstanceName, resourceGroupName, cloudServiceName); + } + + public void delete(String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context) { + this.serviceClient().delete(roleInstanceName, resourceGroupName, cloudServiceName, context); + } + + public Response getWithResponse( + String roleInstanceName, + String resourceGroupName, + String cloudServiceName, + InstanceViewTypes expand, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(roleInstanceName, resourceGroupName, cloudServiceName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RoleInstanceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RoleInstance get(String roleInstanceName, String resourceGroupName, String cloudServiceName) { + RoleInstanceInner inner = this.serviceClient().get(roleInstanceName, resourceGroupName, cloudServiceName); + if (inner != null) { + return new RoleInstanceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getInstanceViewWithResponse( + String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context) { + Response inner = + this + .serviceClient() + .getInstanceViewWithResponse(roleInstanceName, resourceGroupName, cloudServiceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RoleInstanceViewImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RoleInstanceView getInstanceView( + String roleInstanceName, String resourceGroupName, String cloudServiceName) { + RoleInstanceViewInner inner = + this.serviceClient().getInstanceView(roleInstanceName, resourceGroupName, cloudServiceName); + if (inner != null) { + return new RoleInstanceViewImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String cloudServiceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, cloudServiceName); + return Utils.mapPage(inner, inner1 -> new RoleInstanceImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String cloudServiceName, InstanceViewTypes expand, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, cloudServiceName, expand, context); + return Utils.mapPage(inner, inner1 -> new RoleInstanceImpl(inner1, this.manager())); + } + + public void restart(String roleInstanceName, String resourceGroupName, String cloudServiceName) { + this.serviceClient().restart(roleInstanceName, resourceGroupName, cloudServiceName); + } + + public void restart(String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context) { + this.serviceClient().restart(roleInstanceName, resourceGroupName, cloudServiceName, context); + } + + public void reimage(String roleInstanceName, String resourceGroupName, String cloudServiceName) { + this.serviceClient().reimage(roleInstanceName, resourceGroupName, cloudServiceName); + } + + public void reimage(String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context) { + this.serviceClient().reimage(roleInstanceName, resourceGroupName, cloudServiceName, context); + } + + public void rebuild(String roleInstanceName, String resourceGroupName, String cloudServiceName) { + this.serviceClient().rebuild(roleInstanceName, resourceGroupName, cloudServiceName); + } + + public void rebuild(String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context) { + this.serviceClient().rebuild(roleInstanceName, resourceGroupName, cloudServiceName, context); + } + + public Response getRemoteDesktopFileWithResponse( + String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context) { + return this + .serviceClient() + .getRemoteDesktopFileWithResponse(roleInstanceName, resourceGroupName, cloudServiceName, context); + } + + public BinaryData getRemoteDesktopFile(String roleInstanceName, String resourceGroupName, String cloudServiceName) { + return this.serviceClient().getRemoteDesktopFile(roleInstanceName, resourceGroupName, cloudServiceName); + } + + private CloudServiceRoleInstancesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceRolesClientImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceRolesClientImpl.java new file mode 100644 index 0000000000000..9a2e1864d8669 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceRolesClientImpl.java @@ -0,0 +1,522 @@ +// Copyright (c) Microsoft Corporation. All rights 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.resourcemanager.compute.generated.fluent.CloudServiceRolesClient; +import com.azure.resourcemanager.compute.generated.fluent.models.CloudServiceRoleInner; +import com.azure.resourcemanager.compute.generated.models.ApiErrorException; +import com.azure.resourcemanager.compute.generated.models.CloudServiceRoleListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in CloudServiceRolesClient. */ +public final class CloudServiceRolesClientImpl implements CloudServiceRolesClient { + /** The proxy service used to perform REST calls. */ + private final CloudServiceRolesService service; + + /** The service client containing this operation class. */ + private final ComputeManagementClientImpl client; + + /** + * Initializes an instance of CloudServiceRolesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CloudServiceRolesClientImpl(ComputeManagementClientImpl client) { + this.service = + RestProxy.create(CloudServiceRolesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ComputeManagementClientCloudServiceRoles to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ComputeManagementCli") + public interface CloudServiceRolesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roles/{roleName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("roleName") String roleName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudServiceName") String cloudServiceName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roles") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudServiceName") String cloudServiceName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets a role from a cloud service. + * + * @param roleName Name of the role. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a role from a cloud service along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String roleName, String resourceGroupName, String cloudServiceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (roleName == null) { + return Mono.error(new IllegalArgumentException("Parameter roleName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2022-09-04"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + roleName, + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a role from a cloud service. + * + * @param roleName Name of the role. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a role from a cloud service along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String roleName, String resourceGroupName, String cloudServiceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (roleName == null) { + return Mono.error(new IllegalArgumentException("Parameter roleName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2022-09-04"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + roleName, + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context); + } + + /** + * Gets a role from a cloud service. + * + * @param roleName Name of the role. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a role from a cloud service on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String roleName, String resourceGroupName, String cloudServiceName) { + return getWithResponseAsync(roleName, resourceGroupName, cloudServiceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a role from a cloud service. + * + * @param roleName Name of the role. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a role from a cloud service along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String roleName, String resourceGroupName, String cloudServiceName, Context context) { + return getWithResponseAsync(roleName, resourceGroupName, cloudServiceName, context).block(); + } + + /** + * Gets a role from a cloud service. + * + * @param roleName Name of the role. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a role from a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CloudServiceRoleInner get(String roleName, String resourceGroupName, String cloudServiceName) { + return getWithResponse(roleName, resourceGroupName, cloudServiceName, Context.NONE).getValue(); + } + + /** + * Gets a list of all roles in a cloud service. Use nextLink property in the response to get the next page of roles. + * Do this till nextLink is null to fetch all the roles. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all roles in a cloud service along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String cloudServiceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2022-09-04"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of all roles in a cloud service. Use nextLink property in the response to get the next page of roles. + * Do this till nextLink is null to fetch all the roles. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all roles in a cloud service along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String cloudServiceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2022-09-04"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets a list of all roles in a cloud service. Use nextLink property in the response to get the next page of roles. + * Do this till nextLink is null to fetch all the roles. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all roles in a cloud service as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String cloudServiceName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, cloudServiceName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of all roles in a cloud service. Use nextLink property in the response to get the next page of roles. + * Do this till nextLink is null to fetch all the roles. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all roles in a cloud service as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String cloudServiceName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, cloudServiceName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets a list of all roles in a cloud service. Use nextLink property in the response to get the next page of roles. + * Do this till nextLink is null to fetch all the roles. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all roles in a cloud service as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String cloudServiceName) { + return new PagedIterable<>(listAsync(resourceGroupName, cloudServiceName)); + } + + /** + * Gets a list of all roles in a cloud service. Use nextLink property in the response to get the next page of roles. + * Do this till nextLink is null to fetch all the roles. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all roles in a cloud service as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String cloudServiceName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, cloudServiceName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 operation result along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list operation result along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceRolesImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceRolesImpl.java new file mode 100644 index 0000000000000..606a06bff8e69 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceRolesImpl.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.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.CloudServiceRolesClient; +import com.azure.resourcemanager.compute.generated.fluent.models.CloudServiceRoleInner; +import com.azure.resourcemanager.compute.generated.models.CloudServiceRole; +import com.azure.resourcemanager.compute.generated.models.CloudServiceRoles; + +public final class CloudServiceRolesImpl implements CloudServiceRoles { + private static final ClientLogger LOGGER = new ClientLogger(CloudServiceRolesImpl.class); + + private final CloudServiceRolesClient innerClient; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + public CloudServiceRolesImpl( + CloudServiceRolesClient innerClient, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String roleName, String resourceGroupName, String cloudServiceName, Context context) { + Response inner = + this.serviceClient().getWithResponse(roleName, resourceGroupName, cloudServiceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CloudServiceRoleImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CloudServiceRole get(String roleName, String resourceGroupName, String cloudServiceName) { + CloudServiceRoleInner inner = this.serviceClient().get(roleName, resourceGroupName, cloudServiceName); + if (inner != null) { + return new CloudServiceRoleImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String cloudServiceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, cloudServiceName); + return Utils.mapPage(inner, inner1 -> new CloudServiceRoleImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String cloudServiceName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, cloudServiceName, context); + return Utils.mapPage(inner, inner1 -> new CloudServiceRoleImpl(inner1, this.manager())); + } + + private CloudServiceRolesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServicesClientImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServicesClientImpl.java new file mode 100644 index 0000000000000..74bf8d119f3fb --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServicesClientImpl.java @@ -0,0 +1,3575 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.compute.generated.fluent.CloudServicesClient; +import com.azure.resourcemanager.compute.generated.fluent.models.CloudServiceInner; +import com.azure.resourcemanager.compute.generated.fluent.models.CloudServiceInstanceViewInner; +import com.azure.resourcemanager.compute.generated.models.ApiErrorException; +import com.azure.resourcemanager.compute.generated.models.CloudServiceListResult; +import com.azure.resourcemanager.compute.generated.models.CloudServiceUpdate; +import com.azure.resourcemanager.compute.generated.models.RoleInstances; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in CloudServicesClient. */ +public final class CloudServicesClientImpl implements CloudServicesClient { + /** The proxy service used to perform REST calls. */ + private final CloudServicesService service; + + /** The service client containing this operation class. */ + private final ComputeManagementClientImpl client; + + /** + * Initializes an instance of CloudServicesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CloudServicesClientImpl(ComputeManagementClientImpl client) { + this.service = + RestProxy.create(CloudServicesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ComputeManagementClientCloudServices to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ComputeManagementCli") + public interface CloudServicesService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudServiceName") String cloudServiceName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") CloudServiceInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudServiceName") String cloudServiceName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") CloudServiceUpdate parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudServiceName") String cloudServiceName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudServiceName") String cloudServiceName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/instanceView") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> getInstanceView( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudServiceName") String cloudServiceName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/cloudServices") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/start") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> start( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudServiceName") String cloudServiceName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/poweroff") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> powerOff( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudServiceName") String cloudServiceName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/restart") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> restart( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudServiceName") String cloudServiceName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") RoleInstances parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/reimage") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> reimage( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudServiceName") String cloudServiceName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") RoleInstances parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/rebuild") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> rebuild( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudServiceName") String cloudServiceName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") RoleInstances parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/delete") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> deleteInstances( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudServiceName") String cloudServiceName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") RoleInstances parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> listAllNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Create or update a cloud service. Please note some properties can be set only during cloud service creation. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters The cloud service object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String cloudServiceName, CloudServiceInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String apiVersion = "2022-09-04"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a cloud service. Please note some properties can be set only during cloud service creation. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters The cloud service object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String cloudServiceName, CloudServiceInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String apiVersion = "2022-09-04"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + parameters, + accept, + context); + } + + /** + * Create or update a cloud service. Please note some properties can be set only during cloud service creation. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters The cloud service object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of describes the cloud service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CloudServiceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String cloudServiceName, CloudServiceInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, cloudServiceName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + CloudServiceInner.class, + CloudServiceInner.class, + this.client.getContext()); + } + + /** + * Create or update a cloud service. Please note some properties can be set only during cloud service creation. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of describes the cloud service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CloudServiceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String cloudServiceName) { + final CloudServiceInner parameters = null; + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, cloudServiceName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + CloudServiceInner.class, + CloudServiceInner.class, + this.client.getContext()); + } + + /** + * Create or update a cloud service. Please note some properties can be set only during cloud service creation. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters The cloud service object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of describes the cloud service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CloudServiceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String cloudServiceName, CloudServiceInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, cloudServiceName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), CloudServiceInner.class, CloudServiceInner.class, context); + } + + /** + * Create or update a cloud service. Please note some properties can be set only during cloud service creation. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes the cloud service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CloudServiceInner> beginCreateOrUpdate( + String resourceGroupName, String cloudServiceName) { + final CloudServiceInner parameters = null; + return this.beginCreateOrUpdateAsync(resourceGroupName, cloudServiceName, parameters).getSyncPoller(); + } + + /** + * Create or update a cloud service. Please note some properties can be set only during cloud service creation. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters The cloud service object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes the cloud service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CloudServiceInner> beginCreateOrUpdate( + String resourceGroupName, String cloudServiceName, CloudServiceInner parameters, Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, cloudServiceName, parameters, context).getSyncPoller(); + } + + /** + * Create or update a cloud service. Please note some properties can be set only during cloud service creation. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters The cloud service object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String cloudServiceName, CloudServiceInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, cloudServiceName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a cloud service. Please note some properties can be set only during cloud service creation. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String cloudServiceName) { + final CloudServiceInner parameters = null; + return beginCreateOrUpdateAsync(resourceGroupName, cloudServiceName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a cloud service. Please note some properties can be set only during cloud service creation. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters The cloud service object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String cloudServiceName, CloudServiceInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, cloudServiceName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a cloud service. Please note some properties can be set only during cloud service creation. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CloudServiceInner createOrUpdate(String resourceGroupName, String cloudServiceName) { + final CloudServiceInner parameters = null; + return createOrUpdateAsync(resourceGroupName, cloudServiceName, parameters).block(); + } + + /** + * Create or update a cloud service. Please note some properties can be set only during cloud service creation. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters The cloud service object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CloudServiceInner createOrUpdate( + String resourceGroupName, String cloudServiceName, CloudServiceInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, cloudServiceName, parameters, context).block(); + } + + /** + * Update a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters The cloud service object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String cloudServiceName, CloudServiceUpdate parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String apiVersion = "2022-09-04"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters The cloud service object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String cloudServiceName, CloudServiceUpdate parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String apiVersion = "2022-09-04"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + parameters, + accept, + context); + } + + /** + * Update a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters The cloud service object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of describes the cloud service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CloudServiceInner> beginUpdateAsync( + String resourceGroupName, String cloudServiceName, CloudServiceUpdate parameters) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, cloudServiceName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + CloudServiceInner.class, + CloudServiceInner.class, + this.client.getContext()); + } + + /** + * Update a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of describes the cloud service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CloudServiceInner> beginUpdateAsync( + String resourceGroupName, String cloudServiceName) { + final CloudServiceUpdate parameters = null; + Mono>> mono = + updateWithResponseAsync(resourceGroupName, cloudServiceName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + CloudServiceInner.class, + CloudServiceInner.class, + this.client.getContext()); + } + + /** + * Update a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters The cloud service object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of describes the cloud service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CloudServiceInner> beginUpdateAsync( + String resourceGroupName, String cloudServiceName, CloudServiceUpdate parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, cloudServiceName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), CloudServiceInner.class, CloudServiceInner.class, context); + } + + /** + * Update a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes the cloud service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CloudServiceInner> beginUpdate( + String resourceGroupName, String cloudServiceName) { + final CloudServiceUpdate parameters = null; + return this.beginUpdateAsync(resourceGroupName, cloudServiceName, parameters).getSyncPoller(); + } + + /** + * Update a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters The cloud service object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes the cloud service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CloudServiceInner> beginUpdate( + String resourceGroupName, String cloudServiceName, CloudServiceUpdate parameters, Context context) { + return this.beginUpdateAsync(resourceGroupName, cloudServiceName, parameters, context).getSyncPoller(); + } + + /** + * Update a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters The cloud service object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String cloudServiceName, CloudServiceUpdate parameters) { + return beginUpdateAsync(resourceGroupName, cloudServiceName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String cloudServiceName) { + final CloudServiceUpdate parameters = null; + return beginUpdateAsync(resourceGroupName, cloudServiceName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters The cloud service object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String cloudServiceName, CloudServiceUpdate parameters, Context context) { + return beginUpdateAsync(resourceGroupName, cloudServiceName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CloudServiceInner update(String resourceGroupName, String cloudServiceName) { + final CloudServiceUpdate parameters = null; + return updateAsync(resourceGroupName, cloudServiceName, parameters).block(); + } + + /** + * Update a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters The cloud service object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CloudServiceInner update( + String resourceGroupName, String cloudServiceName, CloudServiceUpdate parameters, Context context) { + return updateAsync(resourceGroupName, cloudServiceName, parameters, context).block(); + } + + /** + * Deletes a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String cloudServiceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2022-09-04"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String cloudServiceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2022-09-04"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context); + } + + /** + * Deletes a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String cloudServiceName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, cloudServiceName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String cloudServiceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, cloudServiceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String cloudServiceName) { + return this.beginDeleteAsync(resourceGroupName, cloudServiceName).getSyncPoller(); + } + + /** + * Deletes a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String cloudServiceName, Context context) { + return this.beginDeleteAsync(resourceGroupName, cloudServiceName, context).getSyncPoller(); + } + + /** + * Deletes a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String cloudServiceName) { + return beginDeleteAsync(resourceGroupName, cloudServiceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String cloudServiceName, Context context) { + return beginDeleteAsync(resourceGroupName, cloudServiceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String cloudServiceName) { + deleteAsync(resourceGroupName, cloudServiceName).block(); + } + + /** + * Deletes a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String cloudServiceName, Context context) { + deleteAsync(resourceGroupName, cloudServiceName, context).block(); + } + + /** + * Display information about a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String cloudServiceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2022-09-04"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Display information about a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String cloudServiceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2022-09-04"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context); + } + + /** + * Display information about a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String cloudServiceName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, cloudServiceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Display information about a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String cloudServiceName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, cloudServiceName, context).block(); + } + + /** + * Display information about a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CloudServiceInner getByResourceGroup(String resourceGroupName, String cloudServiceName) { + return getByResourceGroupWithResponse(resourceGroupName, cloudServiceName, Context.NONE).getValue(); + } + + /** + * Gets the status of a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a cloud service along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getInstanceViewWithResponseAsync( + String resourceGroupName, String cloudServiceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2022-09-04"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getInstanceView( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the status of a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a cloud service along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getInstanceViewWithResponseAsync( + String resourceGroupName, String cloudServiceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2022-09-04"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getInstanceView( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context); + } + + /** + * Gets the status of a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a cloud service on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getInstanceViewAsync( + String resourceGroupName, String cloudServiceName) { + return getInstanceViewWithResponseAsync(resourceGroupName, cloudServiceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the status of a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a cloud service along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getInstanceViewWithResponse( + String resourceGroupName, String cloudServiceName, Context context) { + return getInstanceViewWithResponseAsync(resourceGroupName, cloudServiceName, context).block(); + } + + /** + * Gets the status of a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CloudServiceInstanceViewInner getInstanceView(String resourceGroupName, String cloudServiceName) { + return getInstanceViewWithResponse(resourceGroupName, cloudServiceName, Context.NONE).getValue(); + } + + /** + * Gets a list of all cloud services in the subscription, regardless of the associated resource group. Use nextLink + * property in the response to get the next page of Cloud Services. Do this till nextLink is null to fetch all the + * Cloud Services. + * + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all cloud services in the subscription, regardless of the associated resource group along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2022-09-04"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of all cloud services in the subscription, regardless of the associated resource group. Use nextLink + * property in the response to get the next page of Cloud Services. Do this till nextLink is null to fetch all the + * Cloud Services. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all cloud services in the subscription, regardless of the associated resource group along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2022-09-04"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets a list of all cloud services in the subscription, regardless of the associated resource group. Use nextLink + * property in the response to get the next page of Cloud Services. Do this till nextLink is null to fetch all the + * Cloud Services. + * + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all cloud services in the subscription, regardless of the associated resource group as + * paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of all cloud services in the subscription, regardless of the associated resource group. Use nextLink + * property in the response to get the next page of Cloud Services. Do this till nextLink is null to fetch all the + * Cloud Services. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all cloud services in the subscription, regardless of the associated resource group as + * paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets a list of all cloud services in the subscription, regardless of the associated resource group. Use nextLink + * property in the response to get the next page of Cloud Services. Do this till nextLink is null to fetch all the + * Cloud Services. + * + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all cloud services in the subscription, regardless of the associated resource group as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets a list of all cloud services in the subscription, regardless of the associated resource group. Use nextLink + * property in the response to get the next page of Cloud Services. Do this till nextLink is null to fetch all the + * Cloud Services. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all cloud services in the subscription, regardless of the associated resource group as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Gets a list of all cloud services under a resource group. Use nextLink property in the response to get the next + * page of Cloud Services. Do this till nextLink is null to fetch all the Cloud Services. + * + * @param resourceGroupName Name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all cloud services under a resource group along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2022-09-04"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of all cloud services under a resource group. Use nextLink property in the response to get the next + * page of Cloud Services. Do this till nextLink is null to fetch all the Cloud Services. + * + * @param resourceGroupName Name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all cloud services under a resource group along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2022-09-04"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets a list of all cloud services under a resource group. Use nextLink property in the response to get the next + * page of Cloud Services. Do this till nextLink is null to fetch all the Cloud Services. + * + * @param resourceGroupName Name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all cloud services under a resource group as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of all cloud services under a resource group. Use nextLink property in the response to get the next + * page of Cloud Services. Do this till nextLink is null to fetch all the Cloud Services. + * + * @param resourceGroupName Name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all cloud services under a resource group as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets a list of all cloud services under a resource group. Use nextLink property in the response to get the next + * page of Cloud Services. Do this till nextLink is null to fetch all the Cloud Services. + * + * @param resourceGroupName Name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all cloud services under a resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets a list of all cloud services under a resource group. Use nextLink property in the response to get the next + * page of Cloud Services. Do this till nextLink is null to fetch all the Cloud Services. + * + * @param resourceGroupName Name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all cloud services under a resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Starts the cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startWithResponseAsync(String resourceGroupName, String cloudServiceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2022-09-04"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .start( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Starts the cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startWithResponseAsync( + String resourceGroupName, String cloudServiceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2022-09-04"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .start( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context); + } + + /** + * Starts the cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginStartAsync(String resourceGroupName, String cloudServiceName) { + Mono>> mono = startWithResponseAsync(resourceGroupName, cloudServiceName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Starts the cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginStartAsync( + String resourceGroupName, String cloudServiceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = startWithResponseAsync(resourceGroupName, cloudServiceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Starts the cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStart(String resourceGroupName, String cloudServiceName) { + return this.beginStartAsync(resourceGroupName, cloudServiceName).getSyncPoller(); + } + + /** + * Starts the cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStart( + String resourceGroupName, String cloudServiceName, Context context) { + return this.beginStartAsync(resourceGroupName, cloudServiceName, context).getSyncPoller(); + } + + /** + * Starts the cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startAsync(String resourceGroupName, String cloudServiceName) { + return beginStartAsync(resourceGroupName, cloudServiceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts the cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startAsync(String resourceGroupName, String cloudServiceName, Context context) { + return beginStartAsync(resourceGroupName, cloudServiceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts the cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void start(String resourceGroupName, String cloudServiceName) { + startAsync(resourceGroupName, cloudServiceName).block(); + } + + /** + * Starts the cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void start(String resourceGroupName, String cloudServiceName, Context context) { + startAsync(resourceGroupName, cloudServiceName, context).block(); + } + + /** + * Power off the cloud service. Note that resources are still attached and you are getting charged for the + * resources. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> powerOffWithResponseAsync( + String resourceGroupName, String cloudServiceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2022-09-04"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .powerOff( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Power off the cloud service. Note that resources are still attached and you are getting charged for the + * resources. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> powerOffWithResponseAsync( + String resourceGroupName, String cloudServiceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2022-09-04"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .powerOff( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context); + } + + /** + * Power off the cloud service. Note that resources are still attached and you are getting charged for the + * resources. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginPowerOffAsync(String resourceGroupName, String cloudServiceName) { + Mono>> mono = powerOffWithResponseAsync(resourceGroupName, cloudServiceName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Power off the cloud service. Note that resources are still attached and you are getting charged for the + * resources. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginPowerOffAsync( + String resourceGroupName, String cloudServiceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = powerOffWithResponseAsync(resourceGroupName, cloudServiceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Power off the cloud service. Note that resources are still attached and you are getting charged for the + * resources. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginPowerOff(String resourceGroupName, String cloudServiceName) { + return this.beginPowerOffAsync(resourceGroupName, cloudServiceName).getSyncPoller(); + } + + /** + * Power off the cloud service. Note that resources are still attached and you are getting charged for the + * resources. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginPowerOff( + String resourceGroupName, String cloudServiceName, Context context) { + return this.beginPowerOffAsync(resourceGroupName, cloudServiceName, context).getSyncPoller(); + } + + /** + * Power off the cloud service. Note that resources are still attached and you are getting charged for the + * resources. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono powerOffAsync(String resourceGroupName, String cloudServiceName) { + return beginPowerOffAsync(resourceGroupName, cloudServiceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Power off the cloud service. Note that resources are still attached and you are getting charged for the + * resources. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono powerOffAsync(String resourceGroupName, String cloudServiceName, Context context) { + return beginPowerOffAsync(resourceGroupName, cloudServiceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Power off the cloud service. Note that resources are still attached and you are getting charged for the + * resources. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void powerOff(String resourceGroupName, String cloudServiceName) { + powerOffAsync(resourceGroupName, cloudServiceName).block(); + } + + /** + * Power off the cloud service. Note that resources are still attached and you are getting charged for the + * resources. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void powerOff(String resourceGroupName, String cloudServiceName, Context context) { + powerOffAsync(resourceGroupName, cloudServiceName, context).block(); + } + + /** + * Restarts one or more role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> restartWithResponseAsync( + String resourceGroupName, String cloudServiceName, RoleInstances parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String apiVersion = "2022-09-04"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .restart( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Restarts one or more role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> restartWithResponseAsync( + String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String apiVersion = "2022-09-04"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .restart( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + parameters, + accept, + context); + } + + /** + * Restarts one or more role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginRestartAsync( + String resourceGroupName, String cloudServiceName, RoleInstances parameters) { + Mono>> mono = + restartWithResponseAsync(resourceGroupName, cloudServiceName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Restarts one or more role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginRestartAsync(String resourceGroupName, String cloudServiceName) { + final RoleInstances parameters = null; + Mono>> mono = + restartWithResponseAsync(resourceGroupName, cloudServiceName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Restarts one or more role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginRestartAsync( + String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + restartWithResponseAsync(resourceGroupName, cloudServiceName, parameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Restarts one or more role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRestart(String resourceGroupName, String cloudServiceName) { + final RoleInstances parameters = null; + return this.beginRestartAsync(resourceGroupName, cloudServiceName, parameters).getSyncPoller(); + } + + /** + * Restarts one or more role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRestart( + String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context) { + return this.beginRestartAsync(resourceGroupName, cloudServiceName, parameters, context).getSyncPoller(); + } + + /** + * Restarts one or more role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restartAsync(String resourceGroupName, String cloudServiceName, RoleInstances parameters) { + return beginRestartAsync(resourceGroupName, cloudServiceName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restarts one or more role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restartAsync(String resourceGroupName, String cloudServiceName) { + final RoleInstances parameters = null; + return beginRestartAsync(resourceGroupName, cloudServiceName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restarts one or more role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restartAsync( + String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context) { + return beginRestartAsync(resourceGroupName, cloudServiceName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restarts one or more role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void restart(String resourceGroupName, String cloudServiceName) { + final RoleInstances parameters = null; + restartAsync(resourceGroupName, cloudServiceName, parameters).block(); + } + + /** + * Restarts one or more role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void restart(String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context) { + restartAsync(resourceGroupName, cloudServiceName, parameters, context).block(); + } + + /** + * Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> reimageWithResponseAsync( + String resourceGroupName, String cloudServiceName, RoleInstances parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String apiVersion = "2022-09-04"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .reimage( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> reimageWithResponseAsync( + String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String apiVersion = "2022-09-04"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .reimage( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + parameters, + accept, + context); + } + + /** + * Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginReimageAsync( + String resourceGroupName, String cloudServiceName, RoleInstances parameters) { + Mono>> mono = + reimageWithResponseAsync(resourceGroupName, cloudServiceName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginReimageAsync(String resourceGroupName, String cloudServiceName) { + final RoleInstances parameters = null; + Mono>> mono = + reimageWithResponseAsync(resourceGroupName, cloudServiceName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginReimageAsync( + String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + reimageWithResponseAsync(resourceGroupName, cloudServiceName, parameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginReimage(String resourceGroupName, String cloudServiceName) { + final RoleInstances parameters = null; + return this.beginReimageAsync(resourceGroupName, cloudServiceName, parameters).getSyncPoller(); + } + + /** + * Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginReimage( + String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context) { + return this.beginReimageAsync(resourceGroupName, cloudServiceName, parameters, context).getSyncPoller(); + } + + /** + * Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono reimageAsync(String resourceGroupName, String cloudServiceName, RoleInstances parameters) { + return beginReimageAsync(resourceGroupName, cloudServiceName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono reimageAsync(String resourceGroupName, String cloudServiceName) { + final RoleInstances parameters = null; + return beginReimageAsync(resourceGroupName, cloudServiceName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono reimageAsync( + String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context) { + return beginReimageAsync(resourceGroupName, cloudServiceName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void reimage(String resourceGroupName, String cloudServiceName) { + final RoleInstances parameters = null; + reimageAsync(resourceGroupName, cloudServiceName, parameters).block(); + } + + /** + * Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void reimage(String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context) { + reimageAsync(resourceGroupName, cloudServiceName, parameters, context).block(); + } + + /** + * Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes + * the storage resources that are used by them. If you do not want to initialize storage resources, you can use + * Reimage Role Instances. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> rebuildWithResponseAsync( + String resourceGroupName, String cloudServiceName, RoleInstances parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String apiVersion = "2022-09-04"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .rebuild( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes + * the storage resources that are used by them. If you do not want to initialize storage resources, you can use + * Reimage Role Instances. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> rebuildWithResponseAsync( + String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String apiVersion = "2022-09-04"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .rebuild( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + parameters, + accept, + context); + } + + /** + * Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes + * the storage resources that are used by them. If you do not want to initialize storage resources, you can use + * Reimage Role Instances. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginRebuildAsync( + String resourceGroupName, String cloudServiceName, RoleInstances parameters) { + Mono>> mono = + rebuildWithResponseAsync(resourceGroupName, cloudServiceName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes + * the storage resources that are used by them. If you do not want to initialize storage resources, you can use + * Reimage Role Instances. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginRebuildAsync(String resourceGroupName, String cloudServiceName) { + final RoleInstances parameters = null; + Mono>> mono = + rebuildWithResponseAsync(resourceGroupName, cloudServiceName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes + * the storage resources that are used by them. If you do not want to initialize storage resources, you can use + * Reimage Role Instances. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginRebuildAsync( + String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + rebuildWithResponseAsync(resourceGroupName, cloudServiceName, parameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes + * the storage resources that are used by them. If you do not want to initialize storage resources, you can use + * Reimage Role Instances. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRebuild(String resourceGroupName, String cloudServiceName) { + final RoleInstances parameters = null; + return this.beginRebuildAsync(resourceGroupName, cloudServiceName, parameters).getSyncPoller(); + } + + /** + * Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes + * the storage resources that are used by them. If you do not want to initialize storage resources, you can use + * Reimage Role Instances. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRebuild( + String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context) { + return this.beginRebuildAsync(resourceGroupName, cloudServiceName, parameters, context).getSyncPoller(); + } + + /** + * Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes + * the storage resources that are used by them. If you do not want to initialize storage resources, you can use + * Reimage Role Instances. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono rebuildAsync(String resourceGroupName, String cloudServiceName, RoleInstances parameters) { + return beginRebuildAsync(resourceGroupName, cloudServiceName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes + * the storage resources that are used by them. If you do not want to initialize storage resources, you can use + * Reimage Role Instances. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono rebuildAsync(String resourceGroupName, String cloudServiceName) { + final RoleInstances parameters = null; + return beginRebuildAsync(resourceGroupName, cloudServiceName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes + * the storage resources that are used by them. If you do not want to initialize storage resources, you can use + * Reimage Role Instances. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono rebuildAsync( + String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context) { + return beginRebuildAsync(resourceGroupName, cloudServiceName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes + * the storage resources that are used by them. If you do not want to initialize storage resources, you can use + * Reimage Role Instances. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void rebuild(String resourceGroupName, String cloudServiceName) { + final RoleInstances parameters = null; + rebuildAsync(resourceGroupName, cloudServiceName, parameters).block(); + } + + /** + * Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes + * the storage resources that are used by them. If you do not want to initialize storage resources, you can use + * Reimage Role Instances. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void rebuild(String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context) { + rebuildAsync(resourceGroupName, cloudServiceName, parameters, context).block(); + } + + /** + * Deletes role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteInstancesWithResponseAsync( + String resourceGroupName, String cloudServiceName, RoleInstances parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String apiVersion = "2022-09-04"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .deleteInstances( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteInstancesWithResponseAsync( + String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String apiVersion = "2022-09-04"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .deleteInstances( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + parameters, + accept, + context); + } + + /** + * Deletes role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteInstancesAsync( + String resourceGroupName, String cloudServiceName, RoleInstances parameters) { + Mono>> mono = + deleteInstancesWithResponseAsync(resourceGroupName, cloudServiceName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteInstancesAsync( + String resourceGroupName, String cloudServiceName) { + final RoleInstances parameters = null; + Mono>> mono = + deleteInstancesWithResponseAsync(resourceGroupName, cloudServiceName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteInstancesAsync( + String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteInstancesWithResponseAsync(resourceGroupName, cloudServiceName, parameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDeleteInstances(String resourceGroupName, String cloudServiceName) { + final RoleInstances parameters = null; + return this.beginDeleteInstancesAsync(resourceGroupName, cloudServiceName, parameters).getSyncPoller(); + } + + /** + * Deletes role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDeleteInstances( + String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context) { + return this.beginDeleteInstancesAsync(resourceGroupName, cloudServiceName, parameters, context).getSyncPoller(); + } + + /** + * Deletes role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteInstancesAsync( + String resourceGroupName, String cloudServiceName, RoleInstances parameters) { + return beginDeleteInstancesAsync(resourceGroupName, cloudServiceName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteInstancesAsync(String resourceGroupName, String cloudServiceName) { + final RoleInstances parameters = null; + return beginDeleteInstancesAsync(resourceGroupName, cloudServiceName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteInstancesAsync( + String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context) { + return beginDeleteInstancesAsync(resourceGroupName, cloudServiceName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteInstances(String resourceGroupName, String cloudServiceName) { + final RoleInstances parameters = null; + deleteInstancesAsync(resourceGroupName, cloudServiceName, parameters).block(); + } + + /** + * Deletes role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteInstances( + String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context) { + deleteInstancesAsync(resourceGroupName, cloudServiceName, parameters, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 operation result along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listAllNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list operation result along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 URL to get the next list of items + *

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 operation result along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list operation result along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServicesImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServicesImpl.java new file mode 100644 index 0000000000000..e3ed768a1c5f0 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServicesImpl.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.CloudServicesClient; +import com.azure.resourcemanager.compute.generated.fluent.models.CloudServiceInner; +import com.azure.resourcemanager.compute.generated.fluent.models.CloudServiceInstanceViewInner; +import com.azure.resourcemanager.compute.generated.models.CloudService; +import com.azure.resourcemanager.compute.generated.models.CloudServiceInstanceView; +import com.azure.resourcemanager.compute.generated.models.CloudServices; +import com.azure.resourcemanager.compute.generated.models.RoleInstances; + +public final class CloudServicesImpl implements CloudServices { + private static final ClientLogger LOGGER = new ClientLogger(CloudServicesImpl.class); + + private final CloudServicesClient innerClient; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + public CloudServicesImpl( + CloudServicesClient innerClient, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String cloudServiceName) { + this.serviceClient().delete(resourceGroupName, cloudServiceName); + } + + public void delete(String resourceGroupName, String cloudServiceName, Context context) { + this.serviceClient().delete(resourceGroupName, cloudServiceName, context); + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String cloudServiceName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, cloudServiceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CloudServiceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CloudService getByResourceGroup(String resourceGroupName, String cloudServiceName) { + CloudServiceInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, cloudServiceName); + if (inner != null) { + return new CloudServiceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getInstanceViewWithResponse( + String resourceGroupName, String cloudServiceName, Context context) { + Response inner = + this.serviceClient().getInstanceViewWithResponse(resourceGroupName, cloudServiceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CloudServiceInstanceViewImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CloudServiceInstanceView getInstanceView(String resourceGroupName, String cloudServiceName) { + CloudServiceInstanceViewInner inner = this.serviceClient().getInstanceView(resourceGroupName, cloudServiceName); + if (inner != null) { + return new CloudServiceInstanceViewImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new CloudServiceImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new CloudServiceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new CloudServiceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new CloudServiceImpl(inner1, this.manager())); + } + + public void start(String resourceGroupName, String cloudServiceName) { + this.serviceClient().start(resourceGroupName, cloudServiceName); + } + + public void start(String resourceGroupName, String cloudServiceName, Context context) { + this.serviceClient().start(resourceGroupName, cloudServiceName, context); + } + + public void powerOff(String resourceGroupName, String cloudServiceName) { + this.serviceClient().powerOff(resourceGroupName, cloudServiceName); + } + + public void powerOff(String resourceGroupName, String cloudServiceName, Context context) { + this.serviceClient().powerOff(resourceGroupName, cloudServiceName, context); + } + + public void restart(String resourceGroupName, String cloudServiceName) { + this.serviceClient().restart(resourceGroupName, cloudServiceName); + } + + public void restart(String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context) { + this.serviceClient().restart(resourceGroupName, cloudServiceName, parameters, context); + } + + public void reimage(String resourceGroupName, String cloudServiceName) { + this.serviceClient().reimage(resourceGroupName, cloudServiceName); + } + + public void reimage(String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context) { + this.serviceClient().reimage(resourceGroupName, cloudServiceName, parameters, context); + } + + public void rebuild(String resourceGroupName, String cloudServiceName) { + this.serviceClient().rebuild(resourceGroupName, cloudServiceName); + } + + public void rebuild(String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context) { + this.serviceClient().rebuild(resourceGroupName, cloudServiceName, parameters, context); + } + + public void deleteInstances(String resourceGroupName, String cloudServiceName) { + this.serviceClient().deleteInstances(resourceGroupName, cloudServiceName); + } + + public void deleteInstances( + String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context) { + this.serviceClient().deleteInstances(resourceGroupName, cloudServiceName, parameters, context); + } + + public CloudService getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String cloudServiceName = Utils.getValueFromIdByName(id, "cloudServices"); + if (cloudServiceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'cloudServices'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, cloudServiceName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String cloudServiceName = Utils.getValueFromIdByName(id, "cloudServices"); + if (cloudServiceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'cloudServices'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, cloudServiceName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String cloudServiceName = Utils.getValueFromIdByName(id, "cloudServices"); + if (cloudServiceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'cloudServices'.", id))); + } + this.delete(resourceGroupName, cloudServiceName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String cloudServiceName = Utils.getValueFromIdByName(id, "cloudServices"); + if (cloudServiceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'cloudServices'.", id))); + } + this.delete(resourceGroupName, cloudServiceName, context); + } + + private CloudServicesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } + + public CloudServiceImpl define(String name) { + return new CloudServiceImpl(name, this.manager()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServicesUpdateDomainsClientImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServicesUpdateDomainsClientImpl.java new file mode 100644 index 0000000000000..eb427e367768d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServicesUpdateDomainsClientImpl.java @@ -0,0 +1,898 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.compute.generated.fluent.CloudServicesUpdateDomainsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.UpdateDomainInner; +import com.azure.resourcemanager.compute.generated.models.ApiErrorException; +import com.azure.resourcemanager.compute.generated.models.UpdateDomainListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in CloudServicesUpdateDomainsClient. */ +public final class CloudServicesUpdateDomainsClientImpl implements CloudServicesUpdateDomainsClient { + /** The proxy service used to perform REST calls. */ + private final CloudServicesUpdateDomainsService service; + + /** The service client containing this operation class. */ + private final ComputeManagementClientImpl client; + + /** + * Initializes an instance of CloudServicesUpdateDomainsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CloudServicesUpdateDomainsClientImpl(ComputeManagementClientImpl client) { + this.service = + RestProxy + .create( + CloudServicesUpdateDomainsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ComputeManagementClientCloudServicesUpdateDomains to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ComputeManagementCli") + public interface CloudServicesUpdateDomainsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/updateDomains/{updateDomain}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> walkUpdateDomain( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudServiceName") String cloudServiceName, + @PathParam("updateDomain") int updateDomain, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") UpdateDomainInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/updateDomains/{updateDomain}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> getUpdateDomain( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudServiceName") String cloudServiceName, + @PathParam("updateDomain") int updateDomain, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/updateDomains") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> listUpdateDomains( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudServiceName") String cloudServiceName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> listUpdateDomainsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Updates the role instances in the specified update domain. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param updateDomain Specifies an integer value that identifies the update domain. Update domains are identified + * with a zero-based index: the first update domain has an ID of 0, the second has an ID of 1, and so on. + * @param parameters The update domain object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> walkUpdateDomainWithResponseAsync( + String resourceGroupName, String cloudServiceName, int updateDomain, UpdateDomainInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String apiVersion = "2022-09-04"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .walkUpdateDomain( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + updateDomain, + this.client.getSubscriptionId(), + apiVersion, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates the role instances in the specified update domain. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param updateDomain Specifies an integer value that identifies the update domain. Update domains are identified + * with a zero-based index: the first update domain has an ID of 0, the second has an ID of 1, and so on. + * @param parameters The update domain object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> walkUpdateDomainWithResponseAsync( + String resourceGroupName, + String cloudServiceName, + int updateDomain, + UpdateDomainInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String apiVersion = "2022-09-04"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .walkUpdateDomain( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + updateDomain, + this.client.getSubscriptionId(), + apiVersion, + parameters, + accept, + context); + } + + /** + * Updates the role instances in the specified update domain. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param updateDomain Specifies an integer value that identifies the update domain. Update domains are identified + * with a zero-based index: the first update domain has an ID of 0, the second has an ID of 1, and so on. + * @param parameters The update domain object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginWalkUpdateDomainAsync( + String resourceGroupName, String cloudServiceName, int updateDomain, UpdateDomainInner parameters) { + Mono>> mono = + walkUpdateDomainWithResponseAsync(resourceGroupName, cloudServiceName, updateDomain, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Updates the role instances in the specified update domain. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param updateDomain Specifies an integer value that identifies the update domain. Update domains are identified + * with a zero-based index: the first update domain has an ID of 0, the second has an ID of 1, and so on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginWalkUpdateDomainAsync( + String resourceGroupName, String cloudServiceName, int updateDomain) { + final UpdateDomainInner parameters = null; + Mono>> mono = + walkUpdateDomainWithResponseAsync(resourceGroupName, cloudServiceName, updateDomain, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Updates the role instances in the specified update domain. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param updateDomain Specifies an integer value that identifies the update domain. Update domains are identified + * with a zero-based index: the first update domain has an ID of 0, the second has an ID of 1, and so on. + * @param parameters The update domain object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginWalkUpdateDomainAsync( + String resourceGroupName, + String cloudServiceName, + int updateDomain, + UpdateDomainInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + walkUpdateDomainWithResponseAsync(resourceGroupName, cloudServiceName, updateDomain, parameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Updates the role instances in the specified update domain. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param updateDomain Specifies an integer value that identifies the update domain. Update domains are identified + * with a zero-based index: the first update domain has an ID of 0, the second has an ID of 1, and so on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginWalkUpdateDomain( + String resourceGroupName, String cloudServiceName, int updateDomain) { + final UpdateDomainInner parameters = null; + return this + .beginWalkUpdateDomainAsync(resourceGroupName, cloudServiceName, updateDomain, parameters) + .getSyncPoller(); + } + + /** + * Updates the role instances in the specified update domain. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param updateDomain Specifies an integer value that identifies the update domain. Update domains are identified + * with a zero-based index: the first update domain has an ID of 0, the second has an ID of 1, and so on. + * @param parameters The update domain object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginWalkUpdateDomain( + String resourceGroupName, + String cloudServiceName, + int updateDomain, + UpdateDomainInner parameters, + Context context) { + return this + .beginWalkUpdateDomainAsync(resourceGroupName, cloudServiceName, updateDomain, parameters, context) + .getSyncPoller(); + } + + /** + * Updates the role instances in the specified update domain. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param updateDomain Specifies an integer value that identifies the update domain. Update domains are identified + * with a zero-based index: the first update domain has an ID of 0, the second has an ID of 1, and so on. + * @param parameters The update domain object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono walkUpdateDomainAsync( + String resourceGroupName, String cloudServiceName, int updateDomain, UpdateDomainInner parameters) { + return beginWalkUpdateDomainAsync(resourceGroupName, cloudServiceName, updateDomain, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the role instances in the specified update domain. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param updateDomain Specifies an integer value that identifies the update domain. Update domains are identified + * with a zero-based index: the first update domain has an ID of 0, the second has an ID of 1, and so on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono walkUpdateDomainAsync(String resourceGroupName, String cloudServiceName, int updateDomain) { + final UpdateDomainInner parameters = null; + return beginWalkUpdateDomainAsync(resourceGroupName, cloudServiceName, updateDomain, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the role instances in the specified update domain. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param updateDomain Specifies an integer value that identifies the update domain. Update domains are identified + * with a zero-based index: the first update domain has an ID of 0, the second has an ID of 1, and so on. + * @param parameters The update domain object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono walkUpdateDomainAsync( + String resourceGroupName, + String cloudServiceName, + int updateDomain, + UpdateDomainInner parameters, + Context context) { + return beginWalkUpdateDomainAsync(resourceGroupName, cloudServiceName, updateDomain, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the role instances in the specified update domain. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param updateDomain Specifies an integer value that identifies the update domain. Update domains are identified + * with a zero-based index: the first update domain has an ID of 0, the second has an ID of 1, and so on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void walkUpdateDomain(String resourceGroupName, String cloudServiceName, int updateDomain) { + final UpdateDomainInner parameters = null; + walkUpdateDomainAsync(resourceGroupName, cloudServiceName, updateDomain, parameters).block(); + } + + /** + * Updates the role instances in the specified update domain. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param updateDomain Specifies an integer value that identifies the update domain. Update domains are identified + * with a zero-based index: the first update domain has an ID of 0, the second has an ID of 1, and so on. + * @param parameters The update domain object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void walkUpdateDomain( + String resourceGroupName, + String cloudServiceName, + int updateDomain, + UpdateDomainInner parameters, + Context context) { + walkUpdateDomainAsync(resourceGroupName, cloudServiceName, updateDomain, parameters, context).block(); + } + + /** + * Gets the specified update domain of a cloud service. Use nextLink property in the response to get the next page + * of update domains. Do this till nextLink is null to fetch all the update domains. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param updateDomain Specifies an integer value that identifies the update domain. Update domains are identified + * with a zero-based index: the first update domain has an ID of 0, the second has an ID of 1, and so on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified update domain of a cloud service along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getUpdateDomainWithResponseAsync( + String resourceGroupName, String cloudServiceName, int updateDomain) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2022-09-04"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getUpdateDomain( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + updateDomain, + this.client.getSubscriptionId(), + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified update domain of a cloud service. Use nextLink property in the response to get the next page + * of update domains. Do this till nextLink is null to fetch all the update domains. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param updateDomain Specifies an integer value that identifies the update domain. Update domains are identified + * with a zero-based index: the first update domain has an ID of 0, the second has an ID of 1, and so on. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified update domain of a cloud service along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getUpdateDomainWithResponseAsync( + String resourceGroupName, String cloudServiceName, int updateDomain, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2022-09-04"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getUpdateDomain( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + updateDomain, + this.client.getSubscriptionId(), + apiVersion, + accept, + context); + } + + /** + * Gets the specified update domain of a cloud service. Use nextLink property in the response to get the next page + * of update domains. Do this till nextLink is null to fetch all the update domains. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param updateDomain Specifies an integer value that identifies the update domain. Update domains are identified + * with a zero-based index: the first update domain has an ID of 0, the second has an ID of 1, and so on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified update domain of a cloud service on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getUpdateDomainAsync( + String resourceGroupName, String cloudServiceName, int updateDomain) { + return getUpdateDomainWithResponseAsync(resourceGroupName, cloudServiceName, updateDomain) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the specified update domain of a cloud service. Use nextLink property in the response to get the next page + * of update domains. Do this till nextLink is null to fetch all the update domains. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param updateDomain Specifies an integer value that identifies the update domain. Update domains are identified + * with a zero-based index: the first update domain has an ID of 0, the second has an ID of 1, and so on. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified update domain of a cloud service along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getUpdateDomainWithResponse( + String resourceGroupName, String cloudServiceName, int updateDomain, Context context) { + return getUpdateDomainWithResponseAsync(resourceGroupName, cloudServiceName, updateDomain, context).block(); + } + + /** + * Gets the specified update domain of a cloud service. Use nextLink property in the response to get the next page + * of update domains. Do this till nextLink is null to fetch all the update domains. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param updateDomain Specifies an integer value that identifies the update domain. Update domains are identified + * with a zero-based index: the first update domain has an ID of 0, the second has an ID of 1, and so on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified update domain of a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public UpdateDomainInner getUpdateDomain(String resourceGroupName, String cloudServiceName, int updateDomain) { + return getUpdateDomainWithResponse(resourceGroupName, cloudServiceName, updateDomain, Context.NONE).getValue(); + } + + /** + * Gets a list of all update domains in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all update domains in a cloud service along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listUpdateDomainsSinglePageAsync( + String resourceGroupName, String cloudServiceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2022-09-04"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listUpdateDomains( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of all update domains in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all update domains in a cloud service along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listUpdateDomainsSinglePageAsync( + String resourceGroupName, String cloudServiceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2022-09-04"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listUpdateDomains( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets a list of all update domains in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all update domains in a cloud service as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listUpdateDomainsAsync(String resourceGroupName, String cloudServiceName) { + return new PagedFlux<>( + () -> listUpdateDomainsSinglePageAsync(resourceGroupName, cloudServiceName), + nextLink -> listUpdateDomainsNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of all update domains in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all update domains in a cloud service as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listUpdateDomainsAsync( + String resourceGroupName, String cloudServiceName, Context context) { + return new PagedFlux<>( + () -> listUpdateDomainsSinglePageAsync(resourceGroupName, cloudServiceName, context), + nextLink -> listUpdateDomainsNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets a list of all update domains in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all update domains in a cloud service as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listUpdateDomains(String resourceGroupName, String cloudServiceName) { + return new PagedIterable<>(listUpdateDomainsAsync(resourceGroupName, cloudServiceName)); + } + + /** + * Gets a list of all update domains in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all update domains in a cloud service as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listUpdateDomains( + String resourceGroupName, String cloudServiceName, Context context) { + return new PagedIterable<>(listUpdateDomainsAsync(resourceGroupName, cloudServiceName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 operation result along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listUpdateDomainsNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listUpdateDomainsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list operation result along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listUpdateDomainsNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listUpdateDomainsNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServicesUpdateDomainsImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServicesUpdateDomainsImpl.java new file mode 100644 index 0000000000000..c7201cf2b8012 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServicesUpdateDomainsImpl.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.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.CloudServicesUpdateDomainsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.UpdateDomainInner; +import com.azure.resourcemanager.compute.generated.models.CloudServicesUpdateDomains; +import com.azure.resourcemanager.compute.generated.models.UpdateDomain; + +public final class CloudServicesUpdateDomainsImpl implements CloudServicesUpdateDomains { + private static final ClientLogger LOGGER = new ClientLogger(CloudServicesUpdateDomainsImpl.class); + + private final CloudServicesUpdateDomainsClient innerClient; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + public CloudServicesUpdateDomainsImpl( + CloudServicesUpdateDomainsClient innerClient, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void walkUpdateDomain(String resourceGroupName, String cloudServiceName, int updateDomain) { + this.serviceClient().walkUpdateDomain(resourceGroupName, cloudServiceName, updateDomain); + } + + public void walkUpdateDomain( + String resourceGroupName, + String cloudServiceName, + int updateDomain, + UpdateDomainInner parameters, + Context context) { + this.serviceClient().walkUpdateDomain(resourceGroupName, cloudServiceName, updateDomain, parameters, context); + } + + public Response getUpdateDomainWithResponse( + String resourceGroupName, String cloudServiceName, int updateDomain, Context context) { + Response inner = + this + .serviceClient() + .getUpdateDomainWithResponse(resourceGroupName, cloudServiceName, updateDomain, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new UpdateDomainImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public UpdateDomain getUpdateDomain(String resourceGroupName, String cloudServiceName, int updateDomain) { + UpdateDomainInner inner = + this.serviceClient().getUpdateDomain(resourceGroupName, cloudServiceName, updateDomain); + if (inner != null) { + return new UpdateDomainImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listUpdateDomains(String resourceGroupName, String cloudServiceName) { + PagedIterable inner = + this.serviceClient().listUpdateDomains(resourceGroupName, cloudServiceName); + return Utils.mapPage(inner, inner1 -> new UpdateDomainImpl(inner1, this.manager())); + } + + public PagedIterable listUpdateDomains( + String resourceGroupName, String cloudServiceName, Context context) { + PagedIterable inner = + this.serviceClient().listUpdateDomains(resourceGroupName, cloudServiceName, context); + return Utils.mapPage(inner, inner1 -> new UpdateDomainImpl(inner1, this.manager())); + } + + private CloudServicesUpdateDomainsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CommunityGalleriesClientImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CommunityGalleriesClientImpl.java new file mode 100644 index 0000000000000..a942e8bd08d7c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CommunityGalleriesClientImpl.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.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.resourcemanager.compute.generated.fluent.CommunityGalleriesClient; +import com.azure.resourcemanager.compute.generated.fluent.models.CommunityGalleryInner; +import com.azure.resourcemanager.compute.generated.models.ApiErrorException; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in CommunityGalleriesClient. */ +public final class CommunityGalleriesClientImpl implements CommunityGalleriesClient { + /** The proxy service used to perform REST calls. */ + private final CommunityGalleriesService service; + + /** The service client containing this operation class. */ + private final ComputeManagementClientImpl client; + + /** + * Initializes an instance of CommunityGalleriesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CommunityGalleriesClientImpl(ComputeManagementClientImpl client) { + this.service = + RestProxy.create(CommunityGalleriesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ComputeManagementClientCommunityGalleries to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ComputeManagementCli") + public interface CommunityGalleriesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, + @PathParam("publicGalleryName") String publicGalleryName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get a community gallery by gallery public name. + * + * @param location Resource location. + * @param publicGalleryName The public name of the community 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 community gallery by gallery public name along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String location, String publicGalleryName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and 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 (publicGalleryName == null) { + return Mono + .error(new IllegalArgumentException("Parameter publicGalleryName is required and cannot be null.")); + } + final String apiVersion = "2022-03-03"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + publicGalleryName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a community gallery by gallery public name. + * + * @param location Resource location. + * @param publicGalleryName The public name of the community 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 community gallery by gallery public name along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String location, String publicGalleryName, 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 (publicGalleryName == null) { + return Mono + .error(new IllegalArgumentException("Parameter publicGalleryName is required and cannot be null.")); + } + final String apiVersion = "2022-03-03"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + publicGalleryName, + apiVersion, + accept, + context); + } + + /** + * Get a community gallery by gallery public name. + * + * @param location Resource location. + * @param publicGalleryName The public name of the community 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 community gallery by gallery public name on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String location, String publicGalleryName) { + return getWithResponseAsync(location, publicGalleryName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a community gallery by gallery public name. + * + * @param location Resource location. + * @param publicGalleryName The public name of the community 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 community gallery by gallery public name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String location, String publicGalleryName, Context context) { + return getWithResponseAsync(location, publicGalleryName, context).block(); + } + + /** + * Get a community gallery by gallery public name. + * + * @param location Resource location. + * @param publicGalleryName The public name of the community 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 community gallery by gallery public name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CommunityGalleryInner get(String location, String publicGalleryName) { + return getWithResponse(location, publicGalleryName, Context.NONE).getValue(); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CommunityGalleriesImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CommunityGalleriesImpl.java new file mode 100644 index 0000000000000..00e23bd387f54 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CommunityGalleriesImpl.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.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.CommunityGalleriesClient; +import com.azure.resourcemanager.compute.generated.fluent.models.CommunityGalleryInner; +import com.azure.resourcemanager.compute.generated.models.CommunityGalleries; +import com.azure.resourcemanager.compute.generated.models.CommunityGallery; + +public final class CommunityGalleriesImpl implements CommunityGalleries { + private static final ClientLogger LOGGER = new ClientLogger(CommunityGalleriesImpl.class); + + private final CommunityGalleriesClient innerClient; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + public CommunityGalleriesImpl( + CommunityGalleriesClient innerClient, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String location, String publicGalleryName, Context context) { + Response inner = + this.serviceClient().getWithResponse(location, publicGalleryName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CommunityGalleryImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CommunityGallery get(String location, String publicGalleryName) { + CommunityGalleryInner inner = this.serviceClient().get(location, publicGalleryName); + if (inner != null) { + return new CommunityGalleryImpl(inner, this.manager()); + } else { + return null; + } + } + + private CommunityGalleriesClient 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/CommunityGalleryImageImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CommunityGalleryImageImpl.java new file mode 100644 index 0000000000000..a51950b6d62bb --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CommunityGalleryImageImpl.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.implementation; + +import com.azure.resourcemanager.compute.generated.fluent.models.CommunityGalleryImageInner; +import com.azure.resourcemanager.compute.generated.models.Architecture; +import com.azure.resourcemanager.compute.generated.models.CommunityGalleryImage; +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 java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; + +public final class CommunityGalleryImageImpl implements CommunityGalleryImage { + private CommunityGalleryImageInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + CommunityGalleryImageImpl( + CommunityGalleryImageInner 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 type() { + return this.innerModel().type(); + } + + 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 Architecture architecture() { + return this.innerModel().architecture(); + } + + public String privacyStatementUri() { + return this.innerModel().privacyStatementUri(); + } + + public String eula() { + return this.innerModel().eula(); + } + + public CommunityGalleryImageInner 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/CommunityGalleryImageVersionImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CommunityGalleryImageVersionImpl.java new file mode 100644 index 0000000000000..a259f40c42b99 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CommunityGalleryImageVersionImpl.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.implementation; + +import com.azure.resourcemanager.compute.generated.fluent.models.CommunityGalleryImageVersionInner; +import com.azure.resourcemanager.compute.generated.models.CommunityGalleryImageVersion; +import com.azure.resourcemanager.compute.generated.models.SharedGalleryImageVersionStorageProfile; +import java.time.OffsetDateTime; + +public final class CommunityGalleryImageVersionImpl implements CommunityGalleryImageVersion { + private CommunityGalleryImageVersionInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + CommunityGalleryImageVersionImpl( + CommunityGalleryImageVersionInner 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 type() { + return this.innerModel().type(); + } + + public String uniqueId() { + return this.innerModel().uniqueId(); + } + + public OffsetDateTime publishedDate() { + return this.innerModel().publishedDate(); + } + + public OffsetDateTime endOfLifeDate() { + return this.innerModel().endOfLifeDate(); + } + + public Boolean excludeFromLatest() { + return this.innerModel().excludeFromLatest(); + } + + public SharedGalleryImageVersionStorageProfile storageProfile() { + return this.innerModel().storageProfile(); + } + + public CommunityGalleryImageVersionInner 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/CommunityGalleryImageVersionsClientImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CommunityGalleryImageVersionsClientImpl.java new file mode 100644 index 0000000000000..af8d90c4f717b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CommunityGalleryImageVersionsClientImpl.java @@ -0,0 +1,584 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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.resourcemanager.compute.generated.fluent.CommunityGalleryImageVersionsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.CommunityGalleryImageVersionInner; +import com.azure.resourcemanager.compute.generated.models.ApiErrorException; +import com.azure.resourcemanager.compute.generated.models.CommunityGalleryImageVersionList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in CommunityGalleryImageVersionsClient. */ +public final class CommunityGalleryImageVersionsClientImpl implements CommunityGalleryImageVersionsClient { + /** The proxy service used to perform REST calls. */ + private final CommunityGalleryImageVersionsService service; + + /** The service client containing this operation class. */ + private final ComputeManagementClientImpl client; + + /** + * Initializes an instance of CommunityGalleryImageVersionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CommunityGalleryImageVersionsClientImpl(ComputeManagementClientImpl client) { + this.service = + RestProxy + .create( + CommunityGalleryImageVersionsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ComputeManagementClientCommunityGalleryImageVersions to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ComputeManagementCli") + public interface CommunityGalleryImageVersionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}/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("publicGalleryName") String publicGalleryName, + @PathParam("galleryImageName") String galleryImageName, + @PathParam("galleryImageVersionName") String galleryImageVersionName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}/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("publicGalleryName") String publicGalleryName, + @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); + } + + /** + * Get a community gallery image version. + * + * @param location Resource location. + * @param publicGalleryName The public name of the community gallery. + * @param galleryImageName The name of the community gallery image definition. + * @param galleryImageVersionName The name of the community gallery image version. 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 community gallery image version along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String location, String publicGalleryName, 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 (publicGalleryName == null) { + return Mono + .error(new IllegalArgumentException("Parameter publicGalleryName 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 = "2022-03-03"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + apiVersion, + publicGalleryName, + galleryImageName, + galleryImageVersionName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a community gallery image version. + * + * @param location Resource location. + * @param publicGalleryName The public name of the community gallery. + * @param galleryImageName The name of the community gallery image definition. + * @param galleryImageVersionName The name of the community gallery image version. 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 community gallery image version along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String location, + String publicGalleryName, + 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 (publicGalleryName == null) { + return Mono + .error(new IllegalArgumentException("Parameter publicGalleryName 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 = "2022-03-03"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + apiVersion, + publicGalleryName, + galleryImageName, + galleryImageVersionName, + accept, + context); + } + + /** + * Get a community gallery image version. + * + * @param location Resource location. + * @param publicGalleryName The public name of the community gallery. + * @param galleryImageName The name of the community gallery image definition. + * @param galleryImageVersionName The name of the community gallery image version. 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 community gallery image version on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String location, String publicGalleryName, String galleryImageName, String galleryImageVersionName) { + return getWithResponseAsync(location, publicGalleryName, galleryImageName, galleryImageVersionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a community gallery image version. + * + * @param location Resource location. + * @param publicGalleryName The public name of the community gallery. + * @param galleryImageName The name of the community gallery image definition. + * @param galleryImageVersionName The name of the community gallery image version. 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 community gallery image version along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String location, + String publicGalleryName, + String galleryImageName, + String galleryImageVersionName, + Context context) { + return getWithResponseAsync(location, publicGalleryName, galleryImageName, galleryImageVersionName, context) + .block(); + } + + /** + * Get a community gallery image version. + * + * @param location Resource location. + * @param publicGalleryName The public name of the community gallery. + * @param galleryImageName The name of the community gallery image definition. + * @param galleryImageVersionName The name of the community gallery image version. 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 community gallery image version. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CommunityGalleryImageVersionInner get( + String location, String publicGalleryName, String galleryImageName, String galleryImageVersionName) { + return getWithResponse(location, publicGalleryName, galleryImageName, galleryImageVersionName, Context.NONE) + .getValue(); + } + + /** + * List community gallery image versions inside an image. + * + * @param location Resource location. + * @param publicGalleryName The public name of the community gallery. + * @param galleryImageName The name of the community gallery image definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Community Gallery Image versions operation response along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String location, String publicGalleryName, 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 (publicGalleryName == null) { + return Mono + .error(new IllegalArgumentException("Parameter publicGalleryName 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 = "2022-03-03"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + apiVersion, + publicGalleryName, + galleryImageName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List community gallery image versions inside an image. + * + * @param location Resource location. + * @param publicGalleryName The public name of the community gallery. + * @param galleryImageName The name of the community gallery image definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Community Gallery Image versions operation response along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String location, String publicGalleryName, 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 (publicGalleryName == null) { + return Mono + .error(new IllegalArgumentException("Parameter publicGalleryName 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 = "2022-03-03"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + apiVersion, + publicGalleryName, + galleryImageName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List community gallery image versions inside an image. + * + * @param location Resource location. + * @param publicGalleryName The public name of the community gallery. + * @param galleryImageName The name of the community gallery image definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Community Gallery Image versions operation response as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String location, String publicGalleryName, String galleryImageName) { + return new PagedFlux<>( + () -> listSinglePageAsync(location, publicGalleryName, galleryImageName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List community gallery image versions inside an image. + * + * @param location Resource location. + * @param publicGalleryName The public name of the community gallery. + * @param galleryImageName The name of the community gallery image definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Community Gallery Image versions operation response as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String location, String publicGalleryName, String galleryImageName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(location, publicGalleryName, galleryImageName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List community gallery image versions inside an image. + * + * @param location Resource location. + * @param publicGalleryName The public name of the community gallery. + * @param galleryImageName The name of the community gallery image definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Community Gallery Image versions operation response as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String location, String publicGalleryName, String galleryImageName) { + return new PagedIterable<>(listAsync(location, publicGalleryName, galleryImageName)); + } + + /** + * List community gallery image versions inside an image. + * + * @param location Resource location. + * @param publicGalleryName The public name of the community gallery. + * @param galleryImageName The name of the community gallery image definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Community Gallery Image versions operation response as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String location, String publicGalleryName, String galleryImageName, Context context) { + return new PagedIterable<>(listAsync(location, publicGalleryName, galleryImageName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Community Gallery Image versions operation response along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Community Gallery Image versions operation response along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CommunityGalleryImageVersionsImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CommunityGalleryImageVersionsImpl.java new file mode 100644 index 0000000000000..e67b37f41efa2 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CommunityGalleryImageVersionsImpl.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.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.CommunityGalleryImageVersionsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.CommunityGalleryImageVersionInner; +import com.azure.resourcemanager.compute.generated.models.CommunityGalleryImageVersion; +import com.azure.resourcemanager.compute.generated.models.CommunityGalleryImageVersions; + +public final class CommunityGalleryImageVersionsImpl implements CommunityGalleryImageVersions { + private static final ClientLogger LOGGER = new ClientLogger(CommunityGalleryImageVersionsImpl.class); + + private final CommunityGalleryImageVersionsClient innerClient; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + public CommunityGalleryImageVersionsImpl( + CommunityGalleryImageVersionsClient innerClient, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String location, + String publicGalleryName, + String galleryImageName, + String galleryImageVersionName, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(location, publicGalleryName, galleryImageName, galleryImageVersionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CommunityGalleryImageVersionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CommunityGalleryImageVersion get( + String location, String publicGalleryName, String galleryImageName, String galleryImageVersionName) { + CommunityGalleryImageVersionInner inner = + this.serviceClient().get(location, publicGalleryName, galleryImageName, galleryImageVersionName); + if (inner != null) { + return new CommunityGalleryImageVersionImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list( + String location, String publicGalleryName, String galleryImageName) { + PagedIterable inner = + this.serviceClient().list(location, publicGalleryName, galleryImageName); + return Utils.mapPage(inner, inner1 -> new CommunityGalleryImageVersionImpl(inner1, this.manager())); + } + + public PagedIterable list( + String location, String publicGalleryName, String galleryImageName, Context context) { + PagedIterable inner = + this.serviceClient().list(location, publicGalleryName, galleryImageName, context); + return Utils.mapPage(inner, inner1 -> new CommunityGalleryImageVersionImpl(inner1, this.manager())); + } + + private CommunityGalleryImageVersionsClient 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/CommunityGalleryImagesClientImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CommunityGalleryImagesClientImpl.java new file mode 100644 index 0000000000000..9b562fd210df8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CommunityGalleryImagesClientImpl.java @@ -0,0 +1,516 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.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.resourcemanager.compute.generated.fluent.CommunityGalleryImagesClient; +import com.azure.resourcemanager.compute.generated.fluent.models.CommunityGalleryImageInner; +import com.azure.resourcemanager.compute.generated.models.ApiErrorException; +import com.azure.resourcemanager.compute.generated.models.CommunityGalleryImageList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in CommunityGalleryImagesClient. */ +public final class CommunityGalleryImagesClientImpl implements CommunityGalleryImagesClient { + /** The proxy service used to perform REST calls. */ + private final CommunityGalleryImagesService service; + + /** The service client containing this operation class. */ + private final ComputeManagementClientImpl client; + + /** + * Initializes an instance of CommunityGalleryImagesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CommunityGalleryImagesClientImpl(ComputeManagementClientImpl client) { + this.service = + RestProxy + .create(CommunityGalleryImagesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ComputeManagementClientCommunityGalleryImages to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ComputeManagementCli") + public interface CommunityGalleryImagesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}/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("publicGalleryName") String publicGalleryName, + @PathParam("galleryImageName") String galleryImageName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}/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("publicGalleryName") String publicGalleryName, + @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); + } + + /** + * Get a community gallery image. + * + * @param location Resource location. + * @param publicGalleryName The public name of the community gallery. + * @param galleryImageName The name of the community gallery image definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a community gallery image along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String location, String publicGalleryName, 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 (publicGalleryName == null) { + return Mono + .error(new IllegalArgumentException("Parameter publicGalleryName 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 = "2022-03-03"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + apiVersion, + publicGalleryName, + galleryImageName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a community gallery image. + * + * @param location Resource location. + * @param publicGalleryName The public name of the community gallery. + * @param galleryImageName The name of the community gallery image definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a community gallery image along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String location, String publicGalleryName, 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 (publicGalleryName == null) { + return Mono + .error(new IllegalArgumentException("Parameter publicGalleryName 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 = "2022-03-03"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + apiVersion, + publicGalleryName, + galleryImageName, + accept, + context); + } + + /** + * Get a community gallery image. + * + * @param location Resource location. + * @param publicGalleryName The public name of the community gallery. + * @param galleryImageName The name of the community gallery image definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a community gallery image on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String location, String publicGalleryName, String galleryImageName) { + return getWithResponseAsync(location, publicGalleryName, galleryImageName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a community gallery image. + * + * @param location Resource location. + * @param publicGalleryName The public name of the community gallery. + * @param galleryImageName The name of the community gallery image definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a community gallery image along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String location, String publicGalleryName, String galleryImageName, Context context) { + return getWithResponseAsync(location, publicGalleryName, galleryImageName, context).block(); + } + + /** + * Get a community gallery image. + * + * @param location Resource location. + * @param publicGalleryName The public name of the community gallery. + * @param galleryImageName The name of the community gallery image definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a community gallery image. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CommunityGalleryImageInner get(String location, String publicGalleryName, String galleryImageName) { + return getWithResponse(location, publicGalleryName, galleryImageName, Context.NONE).getValue(); + } + + /** + * List community gallery images inside a gallery. + * + * @param location Resource location. + * @param publicGalleryName The public name of the community 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 Community Gallery Images operation response along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String location, String publicGalleryName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and 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 (publicGalleryName == null) { + return Mono + .error(new IllegalArgumentException("Parameter publicGalleryName is required and cannot be null.")); + } + final String apiVersion = "2022-03-03"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + apiVersion, + publicGalleryName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List community gallery images inside a gallery. + * + * @param location Resource location. + * @param publicGalleryName The public name of the community 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 the List Community Gallery Images operation response along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String location, String publicGalleryName, 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 (publicGalleryName == null) { + return Mono + .error(new IllegalArgumentException("Parameter publicGalleryName is required and cannot be null.")); + } + final String apiVersion = "2022-03-03"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + apiVersion, + publicGalleryName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List community gallery images inside a gallery. + * + * @param location Resource location. + * @param publicGalleryName The public name of the community 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 Community Gallery Images operation response as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String location, String publicGalleryName) { + return new PagedFlux<>( + () -> listSinglePageAsync(location, publicGalleryName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List community gallery images inside a gallery. + * + * @param location Resource location. + * @param publicGalleryName The public name of the community 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 the List Community Gallery Images operation response as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String location, String publicGalleryName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(location, publicGalleryName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List community gallery images inside a gallery. + * + * @param location Resource location. + * @param publicGalleryName The public name of the community 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 Community Gallery Images operation response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location, String publicGalleryName) { + return new PagedIterable<>(listAsync(location, publicGalleryName)); + } + + /** + * List community gallery images inside a gallery. + * + * @param location Resource location. + * @param publicGalleryName The public name of the community 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 the List Community Gallery Images operation response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location, String publicGalleryName, Context context) { + return new PagedIterable<>(listAsync(location, publicGalleryName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Community Gallery Images operation response along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Community Gallery Images operation response along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CommunityGalleryImagesImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CommunityGalleryImagesImpl.java new file mode 100644 index 0000000000000..0d1a5305aaf1f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CommunityGalleryImagesImpl.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.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.CommunityGalleryImagesClient; +import com.azure.resourcemanager.compute.generated.fluent.models.CommunityGalleryImageInner; +import com.azure.resourcemanager.compute.generated.models.CommunityGalleryImage; +import com.azure.resourcemanager.compute.generated.models.CommunityGalleryImages; + +public final class CommunityGalleryImagesImpl implements CommunityGalleryImages { + private static final ClientLogger LOGGER = new ClientLogger(CommunityGalleryImagesImpl.class); + + private final CommunityGalleryImagesClient innerClient; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + public CommunityGalleryImagesImpl( + CommunityGalleryImagesClient innerClient, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String location, String publicGalleryName, String galleryImageName, Context context) { + Response inner = + this.serviceClient().getWithResponse(location, publicGalleryName, galleryImageName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CommunityGalleryImageImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CommunityGalleryImage get(String location, String publicGalleryName, String galleryImageName) { + CommunityGalleryImageInner inner = this.serviceClient().get(location, publicGalleryName, galleryImageName); + if (inner != null) { + return new CommunityGalleryImageImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String location, String publicGalleryName) { + PagedIterable inner = this.serviceClient().list(location, publicGalleryName); + return Utils.mapPage(inner, inner1 -> new CommunityGalleryImageImpl(inner1, this.manager())); + } + + public PagedIterable list(String location, String publicGalleryName, Context context) { + PagedIterable inner = + this.serviceClient().list(location, publicGalleryName, context); + return Utils.mapPage(inner, inner1 -> new CommunityGalleryImageImpl(inner1, this.manager())); + } + + private CommunityGalleryImagesClient 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/CommunityGalleryImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CommunityGalleryImpl.java new file mode 100644 index 0000000000000..f8089acb8e2a8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CommunityGalleryImpl.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.CommunityGalleryInner; +import com.azure.resourcemanager.compute.generated.models.CommunityGallery; + +public final class CommunityGalleryImpl implements CommunityGallery { + private CommunityGalleryInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + CommunityGalleryImpl( + CommunityGalleryInner 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 type() { + return this.innerModel().type(); + } + + public String uniqueId() { + return this.innerModel().uniqueId(); + } + + public CommunityGalleryInner 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/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..1a06122629dfc --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ComputeManagementClientBuilder.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.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.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 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 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 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() { + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; + AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; + HttpPipeline localPipeline = + (pipeline != null) + ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval = + (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = + (serializerAdapter != null) + ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); + ComputeManagementClientImpl client = + new ComputeManagementClientImpl( + localPipeline, + localSerializerAdapter, + localDefaultPollInterval, + localEnvironment, + subscriptionId, + localEndpoint); + 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..35f05b309e97b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ComputeManagementClientImpl.java @@ -0,0 +1,954 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.compute.generated.fluent.AvailabilitySetsClient; +import com.azure.resourcemanager.compute.generated.fluent.CapacityReservationGroupsClient; +import com.azure.resourcemanager.compute.generated.fluent.CapacityReservationsClient; +import com.azure.resourcemanager.compute.generated.fluent.CloudServiceOperatingSystemsClient; +import com.azure.resourcemanager.compute.generated.fluent.CloudServiceRoleInstancesClient; +import com.azure.resourcemanager.compute.generated.fluent.CloudServiceRolesClient; +import com.azure.resourcemanager.compute.generated.fluent.CloudServicesClient; +import com.azure.resourcemanager.compute.generated.fluent.CloudServicesUpdateDomainsClient; +import com.azure.resourcemanager.compute.generated.fluent.CommunityGalleriesClient; +import com.azure.resourcemanager.compute.generated.fluent.CommunityGalleryImageVersionsClient; +import com.azure.resourcemanager.compute.generated.fluent.CommunityGalleryImagesClient; +import com.azure.resourcemanager.compute.generated.fluent.ComputeManagementClient; +import com.azure.resourcemanager.compute.generated.fluent.DedicatedHostGroupsClient; +import com.azure.resourcemanager.compute.generated.fluent.DedicatedHostsClient; +import com.azure.resourcemanager.compute.generated.fluent.DiskAccessesClient; +import com.azure.resourcemanager.compute.generated.fluent.DiskEncryptionSetsClient; +import com.azure.resourcemanager.compute.generated.fluent.DiskRestorePointsClient; +import com.azure.resourcemanager.compute.generated.fluent.DisksClient; +import com.azure.resourcemanager.compute.generated.fluent.GalleriesClient; +import com.azure.resourcemanager.compute.generated.fluent.GalleryApplicationVersionsClient; +import com.azure.resourcemanager.compute.generated.fluent.GalleryApplicationsClient; +import com.azure.resourcemanager.compute.generated.fluent.GalleryImageVersionsClient; +import com.azure.resourcemanager.compute.generated.fluent.GalleryImagesClient; +import com.azure.resourcemanager.compute.generated.fluent.GallerySharingProfilesClient; +import com.azure.resourcemanager.compute.generated.fluent.ImagesClient; +import com.azure.resourcemanager.compute.generated.fluent.LogAnalyticsClient; +import com.azure.resourcemanager.compute.generated.fluent.OperationsClient; +import com.azure.resourcemanager.compute.generated.fluent.ProximityPlacementGroupsClient; +import com.azure.resourcemanager.compute.generated.fluent.ResourceSkusClient; +import com.azure.resourcemanager.compute.generated.fluent.RestorePointCollectionsClient; +import com.azure.resourcemanager.compute.generated.fluent.RestorePointsClient; +import com.azure.resourcemanager.compute.generated.fluent.SharedGalleriesClient; +import com.azure.resourcemanager.compute.generated.fluent.SharedGalleryImageVersionsClient; +import com.azure.resourcemanager.compute.generated.fluent.SharedGalleryImagesClient; +import com.azure.resourcemanager.compute.generated.fluent.SnapshotsClient; +import com.azure.resourcemanager.compute.generated.fluent.SshPublicKeysClient; +import com.azure.resourcemanager.compute.generated.fluent.UsagesClient; +import com.azure.resourcemanager.compute.generated.fluent.VirtualMachineExtensionImagesClient; +import com.azure.resourcemanager.compute.generated.fluent.VirtualMachineExtensionsClient; +import com.azure.resourcemanager.compute.generated.fluent.VirtualMachineImagesClient; +import com.azure.resourcemanager.compute.generated.fluent.VirtualMachineImagesEdgeZonesClient; +import com.azure.resourcemanager.compute.generated.fluent.VirtualMachineRunCommandsClient; +import com.azure.resourcemanager.compute.generated.fluent.VirtualMachineScaleSetExtensionsClient; +import com.azure.resourcemanager.compute.generated.fluent.VirtualMachineScaleSetRollingUpgradesClient; +import com.azure.resourcemanager.compute.generated.fluent.VirtualMachineScaleSetVMExtensionsClient; +import com.azure.resourcemanager.compute.generated.fluent.VirtualMachineScaleSetVMRunCommandsClient; +import com.azure.resourcemanager.compute.generated.fluent.VirtualMachineScaleSetVMsClient; +import com.azure.resourcemanager.compute.generated.fluent.VirtualMachineScaleSetsClient; +import com.azure.resourcemanager.compute.generated.fluent.VirtualMachineSizesClient; +import com.azure.resourcemanager.compute.generated.fluent.VirtualMachinesClient; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import 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 { + /** + * 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 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 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 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 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 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 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 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 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 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 ImagesClient object to access its operations. */ + private final ImagesClient images; + + /** + * Gets the ImagesClient object to access its operations. + * + * @return the ImagesClient object. + */ + public ImagesClient getImages() { + return this.images; + } + + /** The RestorePointCollectionsClient object to access its operations. */ + private final RestorePointCollectionsClient restorePointCollections; + + /** + * Gets the RestorePointCollectionsClient object to access its operations. + * + * @return the RestorePointCollectionsClient object. + */ + public RestorePointCollectionsClient getRestorePointCollections() { + return this.restorePointCollections; + } + + /** The RestorePointsClient object to access its operations. */ + private final RestorePointsClient restorePoints; + + /** + * Gets the RestorePointsClient object to access its operations. + * + * @return the RestorePointsClient object. + */ + public RestorePointsClient getRestorePoints() { + return this.restorePoints; + } + + /** The CapacityReservationGroupsClient object to access its operations. */ + private final CapacityReservationGroupsClient capacityReservationGroups; + + /** + * Gets the CapacityReservationGroupsClient object to access its operations. + * + * @return the CapacityReservationGroupsClient object. + */ + public CapacityReservationGroupsClient getCapacityReservationGroups() { + return this.capacityReservationGroups; + } + + /** The CapacityReservationsClient object to access its operations. */ + private final CapacityReservationsClient capacityReservations; + + /** + * Gets the CapacityReservationsClient object to access its operations. + * + * @return the CapacityReservationsClient object. + */ + public CapacityReservationsClient getCapacityReservations() { + return this.capacityReservations; + } + + /** The 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 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 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 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 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 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 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 GalleriesClient object to access its operations. */ + private final GalleriesClient galleries; + + /** + * Gets the GalleriesClient object to access its operations. + * + * @return the GalleriesClient object. + */ + public GalleriesClient getGalleries() { + return this.galleries; + } + + /** The GalleryImagesClient object to access its operations. */ + private final GalleryImagesClient galleryImages; + + /** + * Gets the GalleryImagesClient object to access its operations. + * + * @return the GalleryImagesClient object. + */ + public GalleryImagesClient getGalleryImages() { + return this.galleryImages; + } + + /** The GalleryImageVersionsClient object to access its operations. */ + private final GalleryImageVersionsClient galleryImageVersions; + + /** + * Gets the GalleryImageVersionsClient object to access its operations. + * + * @return the GalleryImageVersionsClient object. + */ + public GalleryImageVersionsClient getGalleryImageVersions() { + return this.galleryImageVersions; + } + + /** The GalleryApplicationsClient object to access its operations. */ + private final GalleryApplicationsClient galleryApplications; + + /** + * Gets the GalleryApplicationsClient object to access its operations. + * + * @return the GalleryApplicationsClient object. + */ + public GalleryApplicationsClient getGalleryApplications() { + return this.galleryApplications; + } + + /** The GalleryApplicationVersionsClient object to access its operations. */ + private final GalleryApplicationVersionsClient galleryApplicationVersions; + + /** + * Gets the GalleryApplicationVersionsClient object to access its operations. + * + * @return the GalleryApplicationVersionsClient object. + */ + public GalleryApplicationVersionsClient getGalleryApplicationVersions() { + return this.galleryApplicationVersions; + } + + /** The GallerySharingProfilesClient object to access its operations. */ + private final GallerySharingProfilesClient gallerySharingProfiles; + + /** + * Gets the GallerySharingProfilesClient object to access its operations. + * + * @return the GallerySharingProfilesClient object. + */ + public GallerySharingProfilesClient getGallerySharingProfiles() { + return this.gallerySharingProfiles; + } + + /** The SharedGalleriesClient object to access its operations. */ + private final SharedGalleriesClient sharedGalleries; + + /** + * Gets the SharedGalleriesClient object to access its operations. + * + * @return the SharedGalleriesClient object. + */ + public SharedGalleriesClient getSharedGalleries() { + return this.sharedGalleries; + } + + /** The SharedGalleryImagesClient object to access its operations. */ + private final SharedGalleryImagesClient sharedGalleryImages; + + /** + * Gets the SharedGalleryImagesClient object to access its operations. + * + * @return the SharedGalleryImagesClient object. + */ + public SharedGalleryImagesClient getSharedGalleryImages() { + return this.sharedGalleryImages; + } + + /** The SharedGalleryImageVersionsClient object to access its operations. */ + private final SharedGalleryImageVersionsClient sharedGalleryImageVersions; + + /** + * Gets the SharedGalleryImageVersionsClient object to access its operations. + * + * @return the SharedGalleryImageVersionsClient object. + */ + public SharedGalleryImageVersionsClient getSharedGalleryImageVersions() { + return this.sharedGalleryImageVersions; + } + + /** The CommunityGalleriesClient object to access its operations. */ + private final CommunityGalleriesClient communityGalleries; + + /** + * Gets the CommunityGalleriesClient object to access its operations. + * + * @return the CommunityGalleriesClient object. + */ + public CommunityGalleriesClient getCommunityGalleries() { + return this.communityGalleries; + } + + /** The CommunityGalleryImagesClient object to access its operations. */ + private final CommunityGalleryImagesClient communityGalleryImages; + + /** + * Gets the CommunityGalleryImagesClient object to access its operations. + * + * @return the CommunityGalleryImagesClient object. + */ + public CommunityGalleryImagesClient getCommunityGalleryImages() { + return this.communityGalleryImages; + } + + /** The CommunityGalleryImageVersionsClient object to access its operations. */ + private final CommunityGalleryImageVersionsClient communityGalleryImageVersions; + + /** + * Gets the CommunityGalleryImageVersionsClient object to access its operations. + * + * @return the CommunityGalleryImageVersionsClient object. + */ + public CommunityGalleryImageVersionsClient getCommunityGalleryImageVersions() { + return this.communityGalleryImageVersions; + } + + /** The CloudServiceRoleInstancesClient object to access its operations. */ + private final CloudServiceRoleInstancesClient cloudServiceRoleInstances; + + /** + * Gets the CloudServiceRoleInstancesClient object to access its operations. + * + * @return the CloudServiceRoleInstancesClient object. + */ + public CloudServiceRoleInstancesClient getCloudServiceRoleInstances() { + return this.cloudServiceRoleInstances; + } + + /** The CloudServiceRolesClient object to access its operations. */ + private final CloudServiceRolesClient cloudServiceRoles; + + /** + * Gets the CloudServiceRolesClient object to access its operations. + * + * @return the CloudServiceRolesClient object. + */ + public CloudServiceRolesClient getCloudServiceRoles() { + return this.cloudServiceRoles; + } + + /** The CloudServicesClient object to access its operations. */ + private final CloudServicesClient cloudServices; + + /** + * Gets the CloudServicesClient object to access its operations. + * + * @return the CloudServicesClient object. + */ + public CloudServicesClient getCloudServices() { + return this.cloudServices; + } + + /** The CloudServicesUpdateDomainsClient object to access its operations. */ + private final CloudServicesUpdateDomainsClient cloudServicesUpdateDomains; + + /** + * Gets the CloudServicesUpdateDomainsClient object to access its operations. + * + * @return the CloudServicesUpdateDomainsClient object. + */ + public CloudServicesUpdateDomainsClient getCloudServicesUpdateDomains() { + return this.cloudServicesUpdateDomains; + } + + /** The CloudServiceOperatingSystemsClient object to access its operations. */ + private final CloudServiceOperatingSystemsClient cloudServiceOperatingSystems; + + /** + * Gets the CloudServiceOperatingSystemsClient object to access its operations. + * + * @return the CloudServiceOperatingSystemsClient object. + */ + public CloudServiceOperatingSystemsClient getCloudServiceOperatingSystems() { + return this.cloudServiceOperatingSystems; + } + + /** + * Initializes an instance of ComputeManagementClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param defaultPollInterval The default poll interval for long-running operation. + * @param environment The Azure environment. + * @param subscriptionId Subscription credentials which uniquely identify Microsoft Azure subscription. The + * subscription ID forms part of the URI for every service call. + * @param endpoint server parameter. + */ + ComputeManagementClientImpl( + HttpPipeline httpPipeline, + SerializerAdapter serializerAdapter, + Duration defaultPollInterval, + AzureEnvironment environment, + String subscriptionId, + String endpoint) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.operations = new OperationsClientImpl(this); + this.usages = new UsagesClientImpl(this); + this.virtualMachineSizes = new VirtualMachineSizesClientImpl(this); + this.virtualMachineScaleSets = new VirtualMachineScaleSetsClientImpl(this); + this.virtualMachineScaleSetExtensions = new VirtualMachineScaleSetExtensionsClientImpl(this); + this.virtualMachineScaleSetRollingUpgrades = new VirtualMachineScaleSetRollingUpgradesClientImpl(this); + this.virtualMachineScaleSetVMExtensions = new VirtualMachineScaleSetVMExtensionsClientImpl(this); + this.virtualMachineScaleSetVMs = new VirtualMachineScaleSetVMsClientImpl(this); + this.virtualMachineExtensions = new VirtualMachineExtensionsClientImpl(this); + this.virtualMachines = new VirtualMachinesClientImpl(this); + this.virtualMachineImages = new VirtualMachineImagesClientImpl(this); + this.virtualMachineImagesEdgeZones = new VirtualMachineImagesEdgeZonesClientImpl(this); + this.virtualMachineExtensionImages = new VirtualMachineExtensionImagesClientImpl(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.images = new ImagesClientImpl(this); + this.restorePointCollections = new RestorePointCollectionsClientImpl(this); + this.restorePoints = new RestorePointsClientImpl(this); + this.capacityReservationGroups = new CapacityReservationGroupsClientImpl(this); + this.capacityReservations = new CapacityReservationsClientImpl(this); + this.logAnalytics = new LogAnalyticsClientImpl(this); + this.virtualMachineRunCommands = new VirtualMachineRunCommandsClientImpl(this); + this.virtualMachineScaleSetVMRunCommands = new VirtualMachineScaleSetVMRunCommandsClientImpl(this); + this.disks = new DisksClientImpl(this); + this.diskAccesses = new DiskAccessesClientImpl(this); + this.diskEncryptionSets = new DiskEncryptionSetsClientImpl(this); + this.diskRestorePoints = new DiskRestorePointsClientImpl(this); + this.snapshots = new SnapshotsClientImpl(this); + this.resourceSkus = new ResourceSkusClientImpl(this); + this.galleries = new GalleriesClientImpl(this); + this.galleryImages = new GalleryImagesClientImpl(this); + this.galleryImageVersions = new GalleryImageVersionsClientImpl(this); + this.galleryApplications = new GalleryApplicationsClientImpl(this); + this.galleryApplicationVersions = new GalleryApplicationVersionsClientImpl(this); + this.gallerySharingProfiles = new GallerySharingProfilesClientImpl(this); + this.sharedGalleries = new SharedGalleriesClientImpl(this); + this.sharedGalleryImages = new SharedGalleryImagesClientImpl(this); + this.sharedGalleryImageVersions = new SharedGalleryImageVersionsClientImpl(this); + this.communityGalleries = new CommunityGalleriesClientImpl(this); + this.communityGalleryImages = new CommunityGalleryImagesClientImpl(this); + this.communityGalleryImageVersions = new CommunityGalleryImageVersionsClientImpl(this); + this.cloudServiceRoleInstances = new CloudServiceRoleInstancesClientImpl(this); + this.cloudServiceRoles = new CloudServiceRolesClientImpl(this); + this.cloudServices = new CloudServicesClientImpl(this); + this.cloudServicesUpdateDomains = new CloudServicesUpdateDomainsClientImpl(this); + this.cloudServiceOperatingSystems = new CloudServiceOperatingSystemsClientImpl(this); + } + + /** + * Gets default client context. + * + * @return the default client context. + */ + public Context getContext() { + return Context.NONE; + } + + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @return the merged context. + */ + public Context mergeContext(Context context) { + return CoreUtils.mergeContexts(this.getContext(), context); + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @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)); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ComputeManagementClientImpl.class); +} 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..8a6cc4818f7f4 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DedicatedHostGroupImpl.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.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.DedicatedHostGroupPropertiesAdditionalCapabilities; +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 int 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 DedicatedHostGroupPropertiesAdditionalCapabilities additionalCapabilities() { + return this.innerModel().additionalCapabilities(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + 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(int 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; + } + } + + public DedicatedHostGroupImpl withAdditionalCapabilities( + DedicatedHostGroupPropertiesAdditionalCapabilities additionalCapabilities) { + if (isInCreateMode()) { + this.innerModel().withAdditionalCapabilities(additionalCapabilities); + return this; + } else { + this.updateParameters.withAdditionalCapabilities(additionalCapabilities); + 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..6f1ce523cb6b2 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DedicatedHostGroupsClientImpl.java @@ -0,0 +1,1280 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.compute.generated.fluent.DedicatedHostGroupsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.DedicatedHostGroupInner; +import com.azure.resourcemanager.compute.generated.models.ApiErrorException; +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 { + /** 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") + public interface DedicatedHostGroupsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ApiErrorException.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(ApiErrorException.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({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> delete( + @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( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.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(ApiErrorException.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(ApiErrorException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * 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 ApiErrorException thrown if the 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 along + * with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + hostGroupName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see + * [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596). + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param parameters Parameters supplied to the Create Dedicated Host Group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the 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 along + * with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-03-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 ApiErrorException thrown if the 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 on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String hostGroupName, DedicatedHostGroupInner parameters) { + return createOrUpdateWithResponseAsync(resourceGroupName, hostGroupName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 ApiErrorException thrown if the 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 along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, String hostGroupName, DedicatedHostGroupInner parameters, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, hostGroupName, parameters, context).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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the 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 createOrUpdateWithResponse(resourceGroupName, hostGroupName, parameters, Context.NONE).getValue(); + } + + /** + * 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 ApiErrorException thrown if the 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 along + * with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + hostGroupName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update an dedicated host group. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param parameters Parameters supplied to the Update Dedicated Host Group operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the 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 along + * with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-03-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 ApiErrorException thrown if the 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 on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String hostGroupName, DedicatedHostGroupUpdate parameters) { + return updateWithResponseAsync(resourceGroupName, hostGroupName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 ApiErrorException thrown if the 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 along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, String hostGroupName, DedicatedHostGroupUpdate parameters, Context context) { + return updateWithResponseAsync(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 ApiErrorException thrown if the 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 updateWithResponse(resourceGroupName, hostGroupName, parameters, Context.NONE).getValue(); + } + + /** + * 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String 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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + hostGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a dedicated host group. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String 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 = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + hostGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String hostGroupName) { + return deleteWithResponseAsync(resourceGroupName, hostGroupName).flatMap(ignored -> Mono.empty()); + } + + /** + * 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String hostGroupName, Context context) { + return deleteWithResponseAsync(resourceGroupName, hostGroupName, 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 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 hostGroupName) { + deleteWithResponse(resourceGroupName, hostGroupName, Context.NONE); + } + + /** + * Retrieves information about a dedicated host group. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param expand The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance + * views of the dedicated hosts under the dedicated host group. 'UserData' is not supported for dedicated host + * group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the 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 along + * with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + hostGroupName, + expand, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves information about a dedicated host group. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param expand The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance + * views of the dedicated hosts under the dedicated host group. 'UserData' is not supported for dedicated host + * group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the 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 along + * with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-03-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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the 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 on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String hostGroupName) { + final InstanceViewTypes expand = null; + return getByResourceGroupWithResponseAsync(resourceGroupName, hostGroupName, expand) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieves information about a dedicated host group. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param expand The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance + * views of the dedicated hosts under the dedicated host group. 'UserData' is not supported for dedicated host + * group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the 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 along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String hostGroupName, InstanceViewTypes expand, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, hostGroupName, expand, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the 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 getByResourceGroupWithResponse(resourceGroupName, hostGroupName, expand, Context.NONE).getValue(); + } + + /** + * 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 ApiErrorException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response + * to get the next page of dedicated host groups. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2023-03-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 ApiErrorException thrown 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 as paginated response with {@link PagedFlux}. + */ + @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 ApiErrorException thrown 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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * 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 ApiErrorException thrown 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 as paginated response with {@link + * PagedIterable}. + */ + @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 ApiErrorException thrown 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 as paginated response with {@link + * PagedIterable}. + */ + @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 ApiErrorException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the + * next page of dedicated host groups. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2023-03-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 ApiErrorException thrown 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 as paginated response with {@link PagedFlux}. + */ + @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 ApiErrorException thrown 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 as paginated response with {@link PagedFlux}. + */ + @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 ApiErrorException thrown 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 as paginated response with {@link + * PagedIterable}. + */ + @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 ApiErrorException thrown 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 as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 Dedicated Host Group with resource group response along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 Dedicated Host Group with resource group response along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/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..bbc45a1a39c22 --- /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; + +public final class DedicatedHostGroupsImpl implements DedicatedHostGroups { + private static 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 Response deleteByResourceGroupWithResponse( + String resourceGroupName, String hostGroupName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, hostGroupName, context); + } + + public void deleteByResourceGroup(String resourceGroupName, String hostGroupName) { + this.serviceClient().delete(resourceGroupName, hostGroupName); + } + + 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 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 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.deleteByResourceGroupWithResponse(resourceGroupName, hostGroupName, Context.NONE); + } + + 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.deleteByResourceGroupWithResponse(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..e200b98a6c4d3 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DedicatedHostImpl.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.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 OffsetDateTime timeCreated() { + return this.innerModel().timeCreated(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + 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 void restart() { + serviceManager.dedicatedHosts().restart(resourceGroupName, hostGroupName, hostname); + } + + public void restart(Context context) { + serviceManager.dedicatedHosts().restart(resourceGroupName, hostGroupName, hostname, context); + } + + 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) { + if (isInCreateMode()) { + this.innerModel().withSku(sku); + return this; + } else { + this.updateParameters.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..750507a983b24 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DedicatedHostsClientImpl.java @@ -0,0 +1,1971 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.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.ApiErrorException; +import com.azure.resourcemanager.compute.generated.models.DedicatedHostListResult; +import com.azure.resourcemanager.compute.generated.models.DedicatedHostSizeListResult; +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 { + /** 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") + public interface DedicatedHostsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ApiErrorException.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(ApiErrorException.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({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ApiErrorException.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, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.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(ApiErrorException.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"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}/restart") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> restart( + @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, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}/hostSizes") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> listAvailableSizes( + @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, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.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 ApiErrorException thrown if the 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + hostGroupName, + hostname, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a dedicated host . + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host . + * @param parameters Parameters supplied to the Create Dedicated Host. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2023-03-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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of specifies information about the Dedicated host. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of specifies information about the Dedicated host. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of specifies information about the Dedicated host. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DedicatedHostInner> beginCreateOrUpdate( + String resourceGroupName, String hostGroupName, String hostname, DedicatedHostInner parameters) { + return this.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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of specifies information about the Dedicated host. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DedicatedHostInner> beginCreateOrUpdate( + String resourceGroupName, + String hostGroupName, + String hostname, + DedicatedHostInner parameters, + Context context) { + return this + .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 ApiErrorException thrown if the 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 on successful completion of {@link Mono}. + */ + @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 ApiErrorException thrown if the 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 on successful completion of {@link Mono}. + */ + @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 ApiErrorException thrown if the 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 ApiErrorException thrown if the 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 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 Update Dedicated Host operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + hostGroupName, + hostname, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update 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 Update Dedicated Host operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2023-03-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 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 Update Dedicated Host operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of specifies information about the Dedicated host. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 Update Dedicated Host operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of specifies information about the Dedicated host. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 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 Update Dedicated Host operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of specifies information about the Dedicated host. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DedicatedHostInner> beginUpdate( + String resourceGroupName, String hostGroupName, String hostname, DedicatedHostUpdate parameters) { + return this.beginUpdateAsync(resourceGroupName, hostGroupName, hostname, parameters).getSyncPoller(); + } + + /** + * 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 Update Dedicated Host operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of specifies information about the Dedicated host. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DedicatedHostInner> beginUpdate( + String resourceGroupName, + String hostGroupName, + String hostname, + DedicatedHostUpdate parameters, + Context context) { + return this.beginUpdateAsync(resourceGroupName, hostGroupName, hostname, parameters, context).getSyncPoller(); + } + + /** + * 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 Update Dedicated Host operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the 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 on successful completion of {@link Mono}. + */ + @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 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 Update Dedicated Host operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the 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 on successful completion of {@link Mono}. + */ + @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 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 Update Dedicated Host operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the 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 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 Update Dedicated Host operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String 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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + hostGroupName, + hostname, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a dedicated host. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String 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 = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + hostGroupName, + hostname, + apiVersion, + this.client.getSubscriptionId(), + accept, + 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String hostGroupName, String hostname) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, hostGroupName, hostname); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String hostGroupName, String hostname) { + return this.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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String hostGroupName, String hostname, Context context) { + return this.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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String 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 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 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 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 hostGroupName, String hostname, Context context) { + deleteAsync(resourceGroupName, hostGroupName, hostname, context).block(); + } + + /** + * Retrieves information about a dedicated host. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host. + * @param expand The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance + * views of the dedicated host. 'UserData' is not supported for dedicated host. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + hostGroupName, + hostname, + expand, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves information about a dedicated host. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host. + * @param expand The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance + * views of the dedicated host. 'UserData' is not supported for dedicated host. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2023-03-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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String hostGroupName, String hostname) { + final InstanceViewTypes expand = null; + return getWithResponseAsync(resourceGroupName, hostGroupName, hostname, expand) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieves information about a dedicated host. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host. + * @param expand The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance + * views of the dedicated host. 'UserData' is not supported for dedicated host. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the 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 along with {@link Response}. + */ + @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(); + } + + /** + * 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 ApiErrorException thrown if the 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 getWithResponse(resourceGroupName, hostGroupName, hostname, expand, Context.NONE).getValue(); + } + + /** + * 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 ApiErrorException thrown 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByHostGroup( + this.client.getEndpoint(), + resourceGroupName, + hostGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response + * to get the next page of dedicated hosts. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 = "2023-03-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 ApiErrorException thrown 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 as paginated response with {@link PagedFlux}. + */ + @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 ApiErrorException thrown 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 as paginated response with {@link PagedFlux}. + */ + @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 ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + @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 ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByHostGroup( + String resourceGroupName, String hostGroupName, Context context) { + return new PagedIterable<>(listByHostGroupAsync(resourceGroupName, hostGroupName, context)); + } + + /** + * Restart the dedicated host. The operation will complete successfully once the dedicated host has restarted and is + * running. To determine the health of VMs deployed on the dedicated host after the restart check the Resource + * Health Center in the Azure Portal. Please refer to + * https://docs.microsoft.com/azure/service-health/resource-health-overview for more details. + * + * @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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> restartWithResponseAsync( + String resourceGroupName, String 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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .restart( + this.client.getEndpoint(), + resourceGroupName, + hostGroupName, + hostname, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Restart the dedicated host. The operation will complete successfully once the dedicated host has restarted and is + * running. To determine the health of VMs deployed on the dedicated host after the restart check the Resource + * Health Center in the Azure Portal. Please refer to + * https://docs.microsoft.com/azure/service-health/resource-health-overview for more details. + * + * @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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> restartWithResponseAsync( + String resourceGroupName, String 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 = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .restart( + this.client.getEndpoint(), + resourceGroupName, + hostGroupName, + hostname, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Restart the dedicated host. The operation will complete successfully once the dedicated host has restarted and is + * running. To determine the health of VMs deployed on the dedicated host after the restart check the Resource + * Health Center in the Azure Portal. Please refer to + * https://docs.microsoft.com/azure/service-health/resource-health-overview for more details. + * + * @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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginRestartAsync( + String resourceGroupName, String hostGroupName, String hostname) { + Mono>> mono = restartWithResponseAsync(resourceGroupName, hostGroupName, hostname); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Restart the dedicated host. The operation will complete successfully once the dedicated host has restarted and is + * running. To determine the health of VMs deployed on the dedicated host after the restart check the Resource + * Health Center in the Azure Portal. Please refer to + * https://docs.microsoft.com/azure/service-health/resource-health-overview for more details. + * + * @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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginRestartAsync( + String resourceGroupName, String hostGroupName, String hostname, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + restartWithResponseAsync(resourceGroupName, hostGroupName, hostname, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Restart the dedicated host. The operation will complete successfully once the dedicated host has restarted and is + * running. To determine the health of VMs deployed on the dedicated host after the restart check the Resource + * Health Center in the Azure Portal. Please refer to + * https://docs.microsoft.com/azure/service-health/resource-health-overview for more details. + * + * @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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRestart( + String resourceGroupName, String hostGroupName, String hostname) { + return this.beginRestartAsync(resourceGroupName, hostGroupName, hostname).getSyncPoller(); + } + + /** + * Restart the dedicated host. The operation will complete successfully once the dedicated host has restarted and is + * running. To determine the health of VMs deployed on the dedicated host after the restart check the Resource + * Health Center in the Azure Portal. Please refer to + * https://docs.microsoft.com/azure/service-health/resource-health-overview for more details. + * + * @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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRestart( + String resourceGroupName, String hostGroupName, String hostname, Context context) { + return this.beginRestartAsync(resourceGroupName, hostGroupName, hostname, context).getSyncPoller(); + } + + /** + * Restart the dedicated host. The operation will complete successfully once the dedicated host has restarted and is + * running. To determine the health of VMs deployed on the dedicated host after the restart check the Resource + * Health Center in the Azure Portal. Please refer to + * https://docs.microsoft.com/azure/service-health/resource-health-overview for more details. + * + * @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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restartAsync(String resourceGroupName, String hostGroupName, String hostname) { + return beginRestartAsync(resourceGroupName, hostGroupName, hostname) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restart the dedicated host. The operation will complete successfully once the dedicated host has restarted and is + * running. To determine the health of VMs deployed on the dedicated host after the restart check the Resource + * Health Center in the Azure Portal. Please refer to + * https://docs.microsoft.com/azure/service-health/resource-health-overview for more details. + * + * @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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restartAsync(String resourceGroupName, String hostGroupName, String hostname, Context context) { + return beginRestartAsync(resourceGroupName, hostGroupName, hostname, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restart the dedicated host. The operation will complete successfully once the dedicated host has restarted and is + * running. To determine the health of VMs deployed on the dedicated host after the restart check the Resource + * Health Center in the Azure Portal. Please refer to + * https://docs.microsoft.com/azure/service-health/resource-health-overview for more details. + * + * @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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void restart(String resourceGroupName, String hostGroupName, String hostname) { + restartAsync(resourceGroupName, hostGroupName, hostname).block(); + } + + /** + * Restart the dedicated host. The operation will complete successfully once the dedicated host has restarted and is + * running. To determine the health of VMs deployed on the dedicated host after the restart check the Resource + * Health Center in the Azure Portal. Please refer to + * https://docs.microsoft.com/azure/service-health/resource-health-overview for more details. + * + * @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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void restart(String resourceGroupName, String hostGroupName, String hostname, Context context) { + restartAsync(resourceGroupName, hostGroupName, hostname, context).block(); + } + + /** + * Lists all available dedicated host sizes to which the specified dedicated host can be resized. NOTE: The + * dedicated host sizes provided can be used to only scale up the existing 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 ApiErrorException thrown 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 sizes operation response along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAvailableSizesSinglePageAsync( + 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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listAvailableSizes( + this.client.getEndpoint(), + resourceGroupName, + hostGroupName, + hostname, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all available dedicated host sizes to which the specified dedicated host can be resized. NOTE: The + * dedicated host sizes provided can be used to only scale up the existing 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 ApiErrorException thrown 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 sizes operation response along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAvailableSizesSinglePageAsync( + 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 = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listAvailableSizes( + this.client.getEndpoint(), + resourceGroupName, + hostGroupName, + hostname, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * Lists all available dedicated host sizes to which the specified dedicated host can be resized. NOTE: The + * dedicated host sizes provided can be used to only scale up the existing 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 ApiErrorException thrown 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 sizes operation response as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAvailableSizesAsync(String resourceGroupName, String hostGroupName, String hostname) { + return new PagedFlux<>(() -> listAvailableSizesSinglePageAsync(resourceGroupName, hostGroupName, hostname)); + } + + /** + * Lists all available dedicated host sizes to which the specified dedicated host can be resized. NOTE: The + * dedicated host sizes provided can be used to only scale up the existing 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 ApiErrorException thrown 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 sizes operation response as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAvailableSizesAsync( + String resourceGroupName, String hostGroupName, String hostname, Context context) { + return new PagedFlux<>( + () -> listAvailableSizesSinglePageAsync(resourceGroupName, hostGroupName, hostname, context)); + } + + /** + * Lists all available dedicated host sizes to which the specified dedicated host can be resized. NOTE: The + * dedicated host sizes provided can be used to only scale up the existing 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 ApiErrorException thrown 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 sizes operation response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAvailableSizes(String resourceGroupName, String hostGroupName, String hostname) { + return new PagedIterable<>(listAvailableSizesAsync(resourceGroupName, hostGroupName, hostname)); + } + + /** + * Lists all available dedicated host sizes to which the specified dedicated host can be resized. NOTE: The + * dedicated host sizes provided can be used to only scale up the existing 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 ApiErrorException thrown 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 sizes operation response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAvailableSizes( + String resourceGroupName, String hostGroupName, String hostname, Context context) { + return new PagedIterable<>(listAvailableSizesAsync(resourceGroupName, hostGroupName, hostname, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByHostGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByHostGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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..52bb350b56900 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DedicatedHostsImpl.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.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; + +public final class DedicatedHostsImpl implements DedicatedHosts { + private static 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 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 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 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 void restart(String resourceGroupName, String hostGroupName, String hostname) { + this.serviceClient().restart(resourceGroupName, hostGroupName, hostname); + } + + public void restart(String resourceGroupName, String hostGroupName, String hostname, Context context) { + this.serviceClient().restart(resourceGroupName, hostGroupName, hostname, context); + } + + public PagedIterable listAvailableSizes(String resourceGroupName, String hostGroupName, String hostname) { + return this.serviceClient().listAvailableSizes(resourceGroupName, hostGroupName, hostname); + } + + public PagedIterable listAvailableSizes( + String resourceGroupName, String hostGroupName, String hostname, Context context) { + return this.serviceClient().listAvailableSizes(resourceGroupName, hostGroupName, hostname, context); + } + + 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..b1241e3af2b20 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DiskAccessImpl.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.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.ExtendedLocation; +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 ExtendedLocation extendedLocation() { + return this.innerModel().extendedLocation(); + } + + 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 String resourceGroupName() { + return resourceGroupName; + } + + 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; + } + } + + public DiskAccessImpl withExtendedLocation(ExtendedLocation extendedLocation) { + this.innerModel().withExtendedLocation(extendedLocation); + 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..2788978087d25 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DiskAccessesClientImpl.java @@ -0,0 +1,3004 @@ +// Copyright (c) Microsoft Corporation. All rights 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.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 { + /** 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") + public 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-07-02"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskAccessName, + apiVersion, + diskAccess, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum + * name length is 80 characters. + * @param diskAccess disk access object supplied in the body of the Put disk access operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk access resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-07-02"; + 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 the {@link PollerFlux} for polling of disk access resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + 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 the {@link PollerFlux} for polling of disk access resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of disk access resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DiskAccessInner> beginCreateOrUpdate( + String resourceGroupName, String diskAccessName, DiskAccessInner diskAccess) { + return this.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 the {@link SyncPoller} for polling of disk access resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DiskAccessInner> beginCreateOrUpdate( + String resourceGroupName, String diskAccessName, DiskAccessInner diskAccess, Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-07-02"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskAccessName, + apiVersion, + diskAccess, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates (patches) a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum + * name length is 80 characters. + * @param diskAccess disk access object supplied in the body of the Patch disk access operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk access resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-07-02"; + 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 the {@link PollerFlux} for polling of disk access resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + 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 the {@link PollerFlux} for polling of disk access resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of disk access resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DiskAccessInner> beginUpdate( + String resourceGroupName, String diskAccessName, DiskAccessUpdate diskAccess) { + return this.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 the {@link SyncPoller} for polling of disk access resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DiskAccessInner> beginUpdate( + String resourceGroupName, String diskAccessName, DiskAccessUpdate diskAccess, Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 = "2022-07-02"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskAccessName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets information about a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum + * name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a disk access resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 = "2022-07-02"; + 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String diskAccessName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, diskAccessName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String diskAccessName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, diskAccessName, 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) + public DiskAccessInner getByResourceGroup(String resourceGroupName, String diskAccessName) { + return getByResourceGroupWithResponse(resourceGroupName, diskAccessName, Context.NONE).getValue(); + } + + /** + * 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-07-02"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskAccessName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum + * name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-07-02"; + 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String diskAccessName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String diskAccessName, Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String apiVersion = "2022-07-02"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the disk access resources under a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List disk access operation response along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String apiVersion = "2022-07-02"; + 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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2022-07-02"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the disk access resources under a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List disk access operation response along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2022-07-02"; + 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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2022-07-02"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getPrivateLinkResources( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskAccessName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the private link resources possible under disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum + * name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources possible under disk access resource along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2022-07-02"; + 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getPrivateLinkResourcesAsync( + String resourceGroupName, String diskAccessName) { + return getPrivateLinkResourcesWithResponseAsync(resourceGroupName, diskAccessName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getPrivateLinkResourcesWithResponse( + String resourceGroupName, String diskAccessName, Context context) { + return getPrivateLinkResourcesWithResponseAsync(resourceGroupName, diskAccessName, context).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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 getPrivateLinkResourcesWithResponse(resourceGroupName, diskAccessName, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 = "2022-07-02"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateAPrivateEndpointConnection( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskAccessName, + privateEndpointConnectionName, + apiVersion, + privateEndpointConnection, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Approve or reject a private endpoint connection under disk access resource, this can't be used to create a new + * private endpoint connection. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum + * name length is 80 characters. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection private endpoint connection object supplied in the body of the Put private + * endpoint connection operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 = "2022-07-02"; + 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 {@link PollerFlux} for polling of the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + 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 {@link PollerFlux} for polling of the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PrivateEndpointConnectionInner> + beginUpdateAPrivateEndpointConnection( + String resourceGroupName, + String diskAccessName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection) { + return this + .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 {@link SyncPoller} for polling of the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PrivateEndpointConnectionInner> + beginUpdateAPrivateEndpointConnection( + String resourceGroupName, + String diskAccessName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection, + Context context) { + return this + .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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} + * on successful completion of {@link Mono}. + */ + @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 = "2022-07-02"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getAPrivateEndpointConnection( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskAccessName, + privateEndpointConnectionName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets information about a private endpoint connection under a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum + * name length is 80 characters. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a private endpoint connection under a disk access resource along with {@link Response} + * on successful completion of {@link Mono}. + */ + @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 = "2022-07-02"; + 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 on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAPrivateEndpointConnectionAsync( + String resourceGroupName, String diskAccessName, String privateEndpointConnectionName) { + return getAPrivateEndpointConnectionWithResponseAsync( + resourceGroupName, diskAccessName, privateEndpointConnectionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getAPrivateEndpointConnectionWithResponse( + String resourceGroupName, String diskAccessName, String privateEndpointConnectionName, Context context) { + return getAPrivateEndpointConnectionWithResponseAsync( + resourceGroupName, diskAccessName, privateEndpointConnectionName, 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) + public PrivateEndpointConnectionInner getAPrivateEndpointConnection( + String resourceGroupName, String diskAccessName, String privateEndpointConnectionName) { + return getAPrivateEndpointConnectionWithResponse( + resourceGroupName, diskAccessName, privateEndpointConnectionName, Context.NONE) + .getValue(); + } + + /** + * 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-07-02"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .deleteAPrivateEndpointConnection( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskAccessName, + privateEndpointConnectionName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a private endpoint connection under a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum + * name length is 80 characters. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-07-02"; + 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDeleteAPrivateEndpointConnection( + String resourceGroupName, String diskAccessName, String privateEndpointConnectionName) { + return this + .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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDeleteAPrivateEndpointConnection( + String resourceGroupName, String diskAccessName, String privateEndpointConnectionName, Context context) { + return this + .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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @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 = "2022-07-02"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listPrivateEndpointConnections( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskAccessName, + apiVersion, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List information about private endpoint connections under a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum + * name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private link resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @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 = "2022-07-02"; + 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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 URL to get the next list of items + *

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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if 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 along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listPrivateEndpointConnectionsNextSinglePageAsync( + String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service.listPrivateEndpointConnectionsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if 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 along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @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..02d2bbe511b9d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DiskAccessesImpl.java @@ -0,0 +1,297 @@ +// Copyright (c) Microsoft Corporation. All rights 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; + +public final class DiskAccessesImpl implements DiskAccesses { + private static 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 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 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 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 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 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 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 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 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 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..94b114ef2b4e3 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DiskEncryptionSetImpl.java @@ -0,0 +1,272 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.ApiError; +import com.azure.resourcemanager.compute.generated.models.DiskEncryptionSet; +import com.azure.resourcemanager.compute.generated.models.DiskEncryptionSetType; +import com.azure.resourcemanager.compute.generated.models.DiskEncryptionSetUpdate; +import com.azure.resourcemanager.compute.generated.models.EncryptionSetIdentity; +import com.azure.resourcemanager.compute.generated.models.KeyForDiskEncryptionSet; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class DiskEncryptionSetImpl + implements DiskEncryptionSet, DiskEncryptionSet.Definition, DiskEncryptionSet.Update { + private DiskEncryptionSetInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public EncryptionSetIdentity identity() { + return this.innerModel().identity(); + } + + public DiskEncryptionSetType encryptionType() { + return this.innerModel().encryptionType(); + } + + public KeyForDiskEncryptionSet activeKey() { + return this.innerModel().activeKey(); + } + + public List previousKeys() { + List inner = this.innerModel().previousKeys(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public Boolean rotationToLatestKeyVersionEnabled() { + return this.innerModel().rotationToLatestKeyVersionEnabled(); + } + + public OffsetDateTime lastKeyRotationTimestamp() { + return this.innerModel().lastKeyRotationTimestamp(); + } + + public ApiError autoKeyRotationError() { + return this.innerModel().autoKeyRotationError(); + } + + public String federatedClientId() { + return this.innerModel().federatedClientId(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public DiskEncryptionSetInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String diskEncryptionSetName; + + private DiskEncryptionSetUpdate updateDiskEncryptionSet; + + public DiskEncryptionSetImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public DiskEncryptionSet create() { + this.innerObject = + serviceManager + .serviceClient() + .getDiskEncryptionSets() + .createOrUpdate(resourceGroupName, diskEncryptionSetName, this.innerModel(), Context.NONE); + return this; + } + + public DiskEncryptionSet create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDiskEncryptionSets() + .createOrUpdate(resourceGroupName, diskEncryptionSetName, this.innerModel(), context); + return this; + } + + DiskEncryptionSetImpl(String name, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = new DiskEncryptionSetInner(); + this.serviceManager = serviceManager; + this.diskEncryptionSetName = name; + } + + public DiskEncryptionSetImpl update() { + this.updateDiskEncryptionSet = new DiskEncryptionSetUpdate(); + return this; + } + + public DiskEncryptionSet apply() { + this.innerObject = + serviceManager + .serviceClient() + .getDiskEncryptionSets() + .update(resourceGroupName, diskEncryptionSetName, updateDiskEncryptionSet, Context.NONE); + return this; + } + + public DiskEncryptionSet apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDiskEncryptionSets() + .update(resourceGroupName, diskEncryptionSetName, updateDiskEncryptionSet, context); + return this; + } + + DiskEncryptionSetImpl( + DiskEncryptionSetInner innerObject, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.diskEncryptionSetName = Utils.getValueFromIdByName(innerObject.id(), "diskEncryptionSets"); + } + + public DiskEncryptionSet refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getDiskEncryptionSets() + .getByResourceGroupWithResponse(resourceGroupName, diskEncryptionSetName, Context.NONE) + .getValue(); + return this; + } + + public DiskEncryptionSet refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDiskEncryptionSets() + .getByResourceGroupWithResponse(resourceGroupName, diskEncryptionSetName, context) + .getValue(); + return this; + } + + public DiskEncryptionSetImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public DiskEncryptionSetImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public DiskEncryptionSetImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateDiskEncryptionSet.withTags(tags); + return this; + } + } + + public DiskEncryptionSetImpl withIdentity(EncryptionSetIdentity identity) { + if (isInCreateMode()) { + this.innerModel().withIdentity(identity); + return this; + } else { + this.updateDiskEncryptionSet.withIdentity(identity); + return this; + } + } + + public DiskEncryptionSetImpl withEncryptionType(DiskEncryptionSetType encryptionType) { + if (isInCreateMode()) { + this.innerModel().withEncryptionType(encryptionType); + return this; + } else { + this.updateDiskEncryptionSet.withEncryptionType(encryptionType); + return this; + } + } + + public DiskEncryptionSetImpl withActiveKey(KeyForDiskEncryptionSet activeKey) { + if (isInCreateMode()) { + this.innerModel().withActiveKey(activeKey); + return this; + } else { + this.updateDiskEncryptionSet.withActiveKey(activeKey); + return this; + } + } + + public DiskEncryptionSetImpl withRotationToLatestKeyVersionEnabled(Boolean rotationToLatestKeyVersionEnabled) { + if (isInCreateMode()) { + this.innerModel().withRotationToLatestKeyVersionEnabled(rotationToLatestKeyVersionEnabled); + return this; + } else { + this.updateDiskEncryptionSet.withRotationToLatestKeyVersionEnabled(rotationToLatestKeyVersionEnabled); + return this; + } + } + + public DiskEncryptionSetImpl withFederatedClientId(String federatedClientId) { + if (isInCreateMode()) { + this.innerModel().withFederatedClientId(federatedClientId); + return this; + } else { + this.updateDiskEncryptionSet.withFederatedClientId(federatedClientId); + 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..87449ddb029e5 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DiskEncryptionSetsClientImpl.java @@ -0,0 +1,1992 @@ +// Copyright (c) Microsoft Corporation. All rights 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.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 { + /** 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") + public 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-07-02"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskEncryptionSetName, + apiVersion, + diskEncryptionSet, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The + * maximum name length is 80 characters. + * @param diskEncryptionSet disk encryption set object supplied in the body of the Put disk encryption set + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk encryption set resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-07-02"; + 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 the {@link PollerFlux} for polling of disk encryption set resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + 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 the {@link PollerFlux} for polling of disk encryption set resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of disk encryption set resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DiskEncryptionSetInner> beginCreateOrUpdate( + String resourceGroupName, String diskEncryptionSetName, DiskEncryptionSetInner diskEncryptionSet) { + return this + .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 the {@link SyncPoller} for polling of disk encryption set resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DiskEncryptionSetInner> beginCreateOrUpdate( + String resourceGroupName, + String diskEncryptionSetName, + DiskEncryptionSetInner diskEncryptionSet, + Context context) { + return this + .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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-07-02"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskEncryptionSetName, + apiVersion, + diskEncryptionSet, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates (patches) a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The + * maximum name length is 80 characters. + * @param diskEncryptionSet disk encryption set object supplied in the body of the Patch disk encryption set + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk encryption set resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-07-02"; + 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 the {@link PollerFlux} for polling of disk encryption set resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + 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 the {@link PollerFlux} for polling of disk encryption set resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of disk encryption set resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DiskEncryptionSetInner> beginUpdate( + String resourceGroupName, String diskEncryptionSetName, DiskEncryptionSetUpdate diskEncryptionSet) { + return this.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 the {@link SyncPoller} for polling of disk encryption set resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DiskEncryptionSetInner> beginUpdate( + String resourceGroupName, + String diskEncryptionSetName, + DiskEncryptionSetUpdate diskEncryptionSet, + Context context) { + return this + .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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 = "2022-07-02"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskEncryptionSetName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets information about a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The + * maximum name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a disk encryption set along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 = "2022-07-02"; + 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String diskEncryptionSetName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, diskEncryptionSetName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String diskEncryptionSetName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, diskEncryptionSetName, 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) + public DiskEncryptionSetInner getByResourceGroup(String resourceGroupName, String diskEncryptionSetName) { + return getByResourceGroupWithResponse(resourceGroupName, diskEncryptionSetName, Context.NONE).getValue(); + } + + /** + * 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-07-02"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskEncryptionSetName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The + * maximum name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-07-02"; + 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String diskEncryptionSetName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String diskEncryptionSetName, Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String apiVersion = "2022-07-02"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the disk encryption sets under a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List disk encryption set operation response along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String apiVersion = "2022-07-02"; + 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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2022-07-02"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the disk encryption sets under a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List disk encryption set operation response along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2022-07-02"; + 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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 = "2022-07-02"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listAssociatedResources( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskEncryptionSetName, + apiVersion, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all resources that are encrypted with this disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The + * maximum name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List resources which are encrypted with the disk encryption set along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 = "2022-07-02"; + 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 as paginated response with {@link + * PagedFlux}. + */ + @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 as paginated response with {@link + * PagedFlux}. + */ + @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 as paginated response with {@link + * PagedIterable}. + */ + @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 as paginated response with {@link + * PagedIterable}. + */ + @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 URL to get the next list of items + *

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 along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAssociatedResourcesNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listAssociatedResourcesNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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..a6f20e40e9712 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DiskEncryptionSetsImpl.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.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; + +public final class DiskEncryptionSetsImpl implements DiskEncryptionSets { + private static 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 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 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 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..20e471bffa001 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DiskImpl.java @@ -0,0 +1,592 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.DiskInner; +import com.azure.resourcemanager.compute.generated.models.AccessUri; +import com.azure.resourcemanager.compute.generated.models.CreationData; +import com.azure.resourcemanager.compute.generated.models.DataAccessAuthMode; +import com.azure.resourcemanager.compute.generated.models.Disk; +import com.azure.resourcemanager.compute.generated.models.DiskSecurityProfile; +import com.azure.resourcemanager.compute.generated.models.DiskSku; +import com.azure.resourcemanager.compute.generated.models.DiskState; +import com.azure.resourcemanager.compute.generated.models.DiskUpdate; +import com.azure.resourcemanager.compute.generated.models.Encryption; +import com.azure.resourcemanager.compute.generated.models.EncryptionSettingsCollection; +import com.azure.resourcemanager.compute.generated.models.ExtendedLocation; +import com.azure.resourcemanager.compute.generated.models.GrantAccessData; +import com.azure.resourcemanager.compute.generated.models.HyperVGeneration; +import com.azure.resourcemanager.compute.generated.models.NetworkAccessPolicy; +import com.azure.resourcemanager.compute.generated.models.OperatingSystemTypes; +import com.azure.resourcemanager.compute.generated.models.PropertyUpdatesInProgress; +import com.azure.resourcemanager.compute.generated.models.PublicNetworkAccess; +import com.azure.resourcemanager.compute.generated.models.PurchasePlanAutoGenerated; +import com.azure.resourcemanager.compute.generated.models.ShareInfoElement; +import com.azure.resourcemanager.compute.generated.models.SupportedCapabilities; +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 SupportedCapabilities supportedCapabilities() { + return this.innerModel().supportedCapabilities(); + } + + 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 OffsetDateTime burstingEnabledTime() { + return this.innerModel().burstingEnabledTime(); + } + + public String tier() { + return this.innerModel().tier(); + } + + public Boolean burstingEnabled() { + return this.innerModel().burstingEnabled(); + } + + public PropertyUpdatesInProgress propertyUpdatesInProgress() { + return this.innerModel().propertyUpdatesInProgress(); + } + + public Boolean supportsHibernation() { + return this.innerModel().supportsHibernation(); + } + + public DiskSecurityProfile securityProfile() { + return this.innerModel().securityProfile(); + } + + public Float completionPercent() { + return this.innerModel().completionPercent(); + } + + public PublicNetworkAccess publicNetworkAccess() { + return this.innerModel().publicNetworkAccess(); + } + + public DataAccessAuthMode dataAccessAuthMode() { + return this.innerModel().dataAccessAuthMode(); + } + + public Boolean optimizedForFrequentAttach() { + return this.innerModel().optimizedForFrequentAttach(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public DiskInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String diskName; + + private DiskUpdate updateDisk; + + public DiskImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Disk create() { + this.innerObject = + serviceManager + .serviceClient() + .getDisks() + .createOrUpdate(resourceGroupName, diskName, this.innerModel(), Context.NONE); + return this; + } + + public Disk create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDisks() + .createOrUpdate(resourceGroupName, diskName, this.innerModel(), context); + return this; + } + + DiskImpl(String name, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = new DiskInner(); + this.serviceManager = serviceManager; + this.diskName = name; + } + + public DiskImpl update() { + this.updateDisk = new DiskUpdate(); + return this; + } + + public Disk apply() { + this.innerObject = + serviceManager.serviceClient().getDisks().update(resourceGroupName, diskName, updateDisk, Context.NONE); + return this; + } + + public Disk apply(Context context) { + this.innerObject = + serviceManager.serviceClient().getDisks().update(resourceGroupName, diskName, updateDisk, context); + return this; + } + + DiskImpl(DiskInner innerObject, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.diskName = Utils.getValueFromIdByName(innerObject.id(), "disks"); + } + + public Disk refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getDisks() + .getByResourceGroupWithResponse(resourceGroupName, diskName, Context.NONE) + .getValue(); + return this; + } + + public Disk refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDisks() + .getByResourceGroupWithResponse(resourceGroupName, diskName, context) + .getValue(); + return this; + } + + public AccessUri grantAccess(GrantAccessData grantAccessData) { + return serviceManager.disks().grantAccess(resourceGroupName, diskName, grantAccessData); + } + + public AccessUri grantAccess(GrantAccessData grantAccessData, Context context) { + return serviceManager.disks().grantAccess(resourceGroupName, diskName, grantAccessData, context); + } + + public void revokeAccess() { + serviceManager.disks().revokeAccess(resourceGroupName, diskName); + } + + public void revokeAccess(Context context) { + serviceManager.disks().revokeAccess(resourceGroupName, diskName, context); + } + + public DiskImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public DiskImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public DiskImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateDisk.withTags(tags); + return this; + } + } + + public DiskImpl withSku(DiskSku sku) { + if (isInCreateMode()) { + this.innerModel().withSku(sku); + return this; + } else { + this.updateDisk.withSku(sku); + return this; + } + } + + public DiskImpl withZones(List zones) { + this.innerModel().withZones(zones); + return this; + } + + public DiskImpl withExtendedLocation(ExtendedLocation extendedLocation) { + this.innerModel().withExtendedLocation(extendedLocation); + return this; + } + + public DiskImpl withOsType(OperatingSystemTypes osType) { + if (isInCreateMode()) { + this.innerModel().withOsType(osType); + return this; + } else { + this.updateDisk.withOsType(osType); + return this; + } + } + + public DiskImpl withHyperVGeneration(HyperVGeneration hyperVGeneration) { + this.innerModel().withHyperVGeneration(hyperVGeneration); + return this; + } + + public DiskImpl withPurchasePlan(PurchasePlanAutoGenerated purchasePlan) { + if (isInCreateMode()) { + this.innerModel().withPurchasePlan(purchasePlan); + return this; + } else { + this.updateDisk.withPurchasePlan(purchasePlan); + return this; + } + } + + public DiskImpl withSupportedCapabilities(SupportedCapabilities supportedCapabilities) { + if (isInCreateMode()) { + this.innerModel().withSupportedCapabilities(supportedCapabilities); + return this; + } else { + this.updateDisk.withSupportedCapabilities(supportedCapabilities); + return this; + } + } + + public DiskImpl withCreationData(CreationData creationData) { + this.innerModel().withCreationData(creationData); + return this; + } + + public DiskImpl withDiskSizeGB(Integer diskSizeGB) { + if (isInCreateMode()) { + this.innerModel().withDiskSizeGB(diskSizeGB); + return this; + } else { + this.updateDisk.withDiskSizeGB(diskSizeGB); + return this; + } + } + + public DiskImpl withEncryptionSettingsCollection(EncryptionSettingsCollection encryptionSettingsCollection) { + if (isInCreateMode()) { + this.innerModel().withEncryptionSettingsCollection(encryptionSettingsCollection); + return this; + } else { + this.updateDisk.withEncryptionSettingsCollection(encryptionSettingsCollection); + return this; + } + } + + public DiskImpl withDiskIopsReadWrite(Long diskIopsReadWrite) { + if (isInCreateMode()) { + this.innerModel().withDiskIopsReadWrite(diskIopsReadWrite); + return this; + } else { + this.updateDisk.withDiskIopsReadWrite(diskIopsReadWrite); + return this; + } + } + + public DiskImpl withDiskMBpsReadWrite(Long diskMBpsReadWrite) { + if (isInCreateMode()) { + this.innerModel().withDiskMBpsReadWrite(diskMBpsReadWrite); + return this; + } else { + this.updateDisk.withDiskMBpsReadWrite(diskMBpsReadWrite); + return this; + } + } + + public DiskImpl withDiskIopsReadOnly(Long diskIopsReadOnly) { + if (isInCreateMode()) { + this.innerModel().withDiskIopsReadOnly(diskIopsReadOnly); + return this; + } else { + this.updateDisk.withDiskIopsReadOnly(diskIopsReadOnly); + return this; + } + } + + public DiskImpl withDiskMBpsReadOnly(Long diskMBpsReadOnly) { + if (isInCreateMode()) { + this.innerModel().withDiskMBpsReadOnly(diskMBpsReadOnly); + return this; + } else { + this.updateDisk.withDiskMBpsReadOnly(diskMBpsReadOnly); + return this; + } + } + + public DiskImpl withEncryption(Encryption encryption) { + if (isInCreateMode()) { + this.innerModel().withEncryption(encryption); + return this; + } else { + this.updateDisk.withEncryption(encryption); + return this; + } + } + + public DiskImpl withMaxShares(Integer maxShares) { + if (isInCreateMode()) { + this.innerModel().withMaxShares(maxShares); + return this; + } else { + this.updateDisk.withMaxShares(maxShares); + return this; + } + } + + public DiskImpl withNetworkAccessPolicy(NetworkAccessPolicy networkAccessPolicy) { + if (isInCreateMode()) { + this.innerModel().withNetworkAccessPolicy(networkAccessPolicy); + return this; + } else { + this.updateDisk.withNetworkAccessPolicy(networkAccessPolicy); + return this; + } + } + + public DiskImpl withDiskAccessId(String diskAccessId) { + if (isInCreateMode()) { + this.innerModel().withDiskAccessId(diskAccessId); + return this; + } else { + this.updateDisk.withDiskAccessId(diskAccessId); + return this; + } + } + + public DiskImpl withTier(String tier) { + if (isInCreateMode()) { + this.innerModel().withTier(tier); + return this; + } else { + this.updateDisk.withTier(tier); + return this; + } + } + + public DiskImpl withBurstingEnabled(Boolean burstingEnabled) { + if (isInCreateMode()) { + this.innerModel().withBurstingEnabled(burstingEnabled); + return this; + } else { + this.updateDisk.withBurstingEnabled(burstingEnabled); + return this; + } + } + + public DiskImpl withSupportsHibernation(Boolean supportsHibernation) { + if (isInCreateMode()) { + this.innerModel().withSupportsHibernation(supportsHibernation); + return this; + } else { + this.updateDisk.withSupportsHibernation(supportsHibernation); + return this; + } + } + + public DiskImpl withSecurityProfile(DiskSecurityProfile securityProfile) { + this.innerModel().withSecurityProfile(securityProfile); + return this; + } + + public DiskImpl withCompletionPercent(Float completionPercent) { + this.innerModel().withCompletionPercent(completionPercent); + return this; + } + + public DiskImpl withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + if (isInCreateMode()) { + this.innerModel().withPublicNetworkAccess(publicNetworkAccess); + return this; + } else { + this.updateDisk.withPublicNetworkAccess(publicNetworkAccess); + return this; + } + } + + public DiskImpl withDataAccessAuthMode(DataAccessAuthMode dataAccessAuthMode) { + if (isInCreateMode()) { + this.innerModel().withDataAccessAuthMode(dataAccessAuthMode); + return this; + } else { + this.updateDisk.withDataAccessAuthMode(dataAccessAuthMode); + return this; + } + } + + public DiskImpl withOptimizedForFrequentAttach(Boolean optimizedForFrequentAttach) { + if (isInCreateMode()) { + this.innerModel().withOptimizedForFrequentAttach(optimizedForFrequentAttach); + return this; + } else { + this.updateDisk.withOptimizedForFrequentAttach(optimizedForFrequentAttach); + 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..fe6dc9c566b31 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DiskRestorePointImpl.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.DiskRestorePointInner; +import com.azure.resourcemanager.compute.generated.models.DiskRestorePoint; +import com.azure.resourcemanager.compute.generated.models.DiskSecurityProfile; +import com.azure.resourcemanager.compute.generated.models.Encryption; +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.PublicNetworkAccess; +import com.azure.resourcemanager.compute.generated.models.PurchasePlanAutoGenerated; +import com.azure.resourcemanager.compute.generated.models.SupportedCapabilities; +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 SupportedCapabilities supportedCapabilities() { + return this.innerModel().supportedCapabilities(); + } + + public String familyId() { + return this.innerModel().familyId(); + } + + public String sourceUniqueId() { + return this.innerModel().sourceUniqueId(); + } + + public Encryption encryption() { + return this.innerModel().encryption(); + } + + public Boolean supportsHibernation() { + return this.innerModel().supportsHibernation(); + } + + public NetworkAccessPolicy networkAccessPolicy() { + return this.innerModel().networkAccessPolicy(); + } + + public PublicNetworkAccess publicNetworkAccess() { + return this.innerModel().publicNetworkAccess(); + } + + public String diskAccessId() { + return this.innerModel().diskAccessId(); + } + + public Float completionPercent() { + return this.innerModel().completionPercent(); + } + + public String replicationState() { + return this.innerModel().replicationState(); + } + + public String sourceResourceLocation() { + return this.innerModel().sourceResourceLocation(); + } + + public DiskSecurityProfile securityProfile() { + return this.innerModel().securityProfile(); + } + + 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..ee9057500761b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DiskRestorePointsClientImpl.java @@ -0,0 +1,1381 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.compute.generated.fluent.DiskRestorePointsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.AccessUriInner; +import com.azure.resourcemanager.compute.generated.fluent.models.DiskRestorePointInner; +import com.azure.resourcemanager.compute.generated.models.ApiErrorException; +import com.azure.resourcemanager.compute.generated.models.DiskRestorePointList; +import com.azure.resourcemanager.compute.generated.models.GrantAccessData; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in DiskRestorePointsClient. */ +public final class DiskRestorePointsClientImpl implements DiskRestorePointsClient { + /** 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") + public interface DiskRestorePointsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints/{diskRestorePointName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("restorePointCollectionName") String restorePointCollectionName, + @PathParam("vmRestorePointName") String vmRestorePointName, + @PathParam("diskRestorePointName") String diskRestorePointName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> listByRestorePoint( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("restorePointCollectionName") String restorePointCollectionName, + @PathParam("vmRestorePointName") String vmRestorePointName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints/{diskRestorePointName}/beginGetAccess") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> grantAccess( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("restorePointCollectionName") String restorePointCollectionName, + @PathParam("vmRestorePointName") String vmRestorePointName, + @PathParam("diskRestorePointName") String diskRestorePointName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") GrantAccessData grantAccessData, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints/{diskRestorePointName}/endGetAccess") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> revokeAccess( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("restorePointCollectionName") String restorePointCollectionName, + @PathParam("vmRestorePointName") String vmRestorePointName, + @PathParam("diskRestorePointName") String diskRestorePointName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> listByRestorePointNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get disk restorePoint resource. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. + * @param diskRestorePointName The name of the disk restore point created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-07-02"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + diskRestorePointName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get disk restorePoint resource. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. + * @param diskRestorePointName The name of the disk restore point created. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-07-02"; + 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. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. + * @param diskRestorePointName The name of the disk restore point created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName) { + return getWithResponseAsync( + resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. + * @param diskRestorePointName The name of the disk restore point created. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link Response}. + */ + @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(); + } + + /** + * 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. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. + * @param diskRestorePointName The name of the disk restore point created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 getWithResponse( + resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName, Context.NONE) + .getValue(); + } + + /** + * 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. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @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 = "2022-07-02"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByRestorePoint( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + apiVersion, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists diskRestorePoints under a vmRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @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 = "2022-07-02"; + 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. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 as paginated response with {@link PagedFlux}. + */ + @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. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 as paginated response with {@link PagedFlux}. + */ + @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. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + @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. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByRestorePoint( + String resourceGroupName, String restorePointCollectionName, String vmRestorePointName, Context context) { + return new PagedIterable<>( + listByRestorePointAsync(resourceGroupName, restorePointCollectionName, vmRestorePointName, context)); + } + + /** + * Grants access to a diskRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. + * @param diskRestorePointName The name of the disk restore point created. + * @param grantAccessData Access data object supplied in the body of the get disk access operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a disk access SAS uri along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> grantAccessWithResponseAsync( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName, + GrantAccessData grantAccessData) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (restorePointCollectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter restorePointCollectionName is required and cannot be null.")); + } + if (vmRestorePointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter vmRestorePointName is required and cannot be null.")); + } + if (diskRestorePointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter diskRestorePointName is required and cannot be null.")); + } + if (grantAccessData == null) { + return Mono + .error(new IllegalArgumentException("Parameter grantAccessData is required and cannot be null.")); + } else { + grantAccessData.validate(); + } + final String apiVersion = "2022-07-02"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .grantAccess( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + diskRestorePointName, + apiVersion, + grantAccessData, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Grants access to a diskRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. + * @param diskRestorePointName The name of the disk restore point created. + * @param grantAccessData Access data object supplied in the body of the get disk access operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a disk access SAS uri along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> grantAccessWithResponseAsync( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName, + GrantAccessData grantAccessData, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (restorePointCollectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter restorePointCollectionName is required and cannot be null.")); + } + if (vmRestorePointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter vmRestorePointName is required and cannot be null.")); + } + if (diskRestorePointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter diskRestorePointName is required and cannot be null.")); + } + if (grantAccessData == null) { + return Mono + .error(new IllegalArgumentException("Parameter grantAccessData is required and cannot be null.")); + } else { + grantAccessData.validate(); + } + final String apiVersion = "2022-07-02"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .grantAccess( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + diskRestorePointName, + apiVersion, + grantAccessData, + accept, + context); + } + + /** + * Grants access to a diskRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. + * @param diskRestorePointName The name of the disk restore point created. + * @param grantAccessData Access data object supplied in the body of the get disk access operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AccessUriInner> beginGrantAccessAsync( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName, + GrantAccessData grantAccessData) { + Mono>> mono = + grantAccessWithResponseAsync( + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + diskRestorePointName, + grantAccessData); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + AccessUriInner.class, + AccessUriInner.class, + this.client.getContext()); + } + + /** + * Grants access to a diskRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. + * @param diskRestorePointName The name of the disk restore point created. + * @param grantAccessData Access data object supplied in the body of the get disk access operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AccessUriInner> beginGrantAccessAsync( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName, + GrantAccessData grantAccessData, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + grantAccessWithResponseAsync( + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + diskRestorePointName, + grantAccessData, + context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), AccessUriInner.class, AccessUriInner.class, context); + } + + /** + * Grants access to a diskRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. + * @param diskRestorePointName The name of the disk restore point created. + * @param grantAccessData Access data object supplied in the body of the get disk access operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AccessUriInner> beginGrantAccess( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName, + GrantAccessData grantAccessData) { + return this + .beginGrantAccessAsync( + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + diskRestorePointName, + grantAccessData) + .getSyncPoller(); + } + + /** + * Grants access to a diskRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. + * @param diskRestorePointName The name of the disk restore point created. + * @param grantAccessData Access data object supplied in the body of the get disk access operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AccessUriInner> beginGrantAccess( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName, + GrantAccessData grantAccessData, + Context context) { + return this + .beginGrantAccessAsync( + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + diskRestorePointName, + grantAccessData, + context) + .getSyncPoller(); + } + + /** + * Grants access to a diskRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. + * @param diskRestorePointName The name of the disk restore point created. + * @param grantAccessData Access data object supplied in the body of the get disk access operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a disk access SAS uri on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono grantAccessAsync( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName, + GrantAccessData grantAccessData) { + return beginGrantAccessAsync( + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + diskRestorePointName, + grantAccessData) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Grants access to a diskRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. + * @param diskRestorePointName The name of the disk restore point created. + * @param grantAccessData Access data object supplied in the body of the get disk access operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a disk access SAS uri on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono grantAccessAsync( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName, + GrantAccessData grantAccessData, + Context context) { + return beginGrantAccessAsync( + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + diskRestorePointName, + grantAccessData, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Grants access to a diskRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. + * @param diskRestorePointName The name of the disk restore point created. + * @param grantAccessData Access data object supplied in the body of the get disk access operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccessUriInner grantAccess( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName, + GrantAccessData grantAccessData) { + return grantAccessAsync( + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + diskRestorePointName, + grantAccessData) + .block(); + } + + /** + * Grants access to a diskRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. + * @param diskRestorePointName The name of the disk restore point created. + * @param grantAccessData Access data object supplied in the body of the get disk access operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccessUriInner grantAccess( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName, + GrantAccessData grantAccessData, + Context context) { + return grantAccessAsync( + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + diskRestorePointName, + grantAccessData, + context) + .block(); + } + + /** + * Revokes access to a diskRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. + * @param diskRestorePointName The name of the disk restore point created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> revokeAccessWithResponseAsync( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (restorePointCollectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter restorePointCollectionName is required and cannot be null.")); + } + if (vmRestorePointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter vmRestorePointName is required and cannot be null.")); + } + if (diskRestorePointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter diskRestorePointName is required and cannot be null.")); + } + final String apiVersion = "2022-07-02"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .revokeAccess( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + diskRestorePointName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Revokes access to a diskRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. + * @param diskRestorePointName The name of the disk restore point created. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> revokeAccessWithResponseAsync( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (restorePointCollectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter restorePointCollectionName is required and cannot be null.")); + } + if (vmRestorePointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter vmRestorePointName is required and cannot be null.")); + } + if (diskRestorePointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter diskRestorePointName is required and cannot be null.")); + } + final String apiVersion = "2022-07-02"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .revokeAccess( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + diskRestorePointName, + apiVersion, + accept, + context); + } + + /** + * Revokes access to a diskRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. + * @param diskRestorePointName The name of the disk restore point created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginRevokeAccessAsync( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName) { + Mono>> mono = + revokeAccessWithResponseAsync( + resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Revokes access to a diskRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. + * @param diskRestorePointName The name of the disk restore point created. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginRevokeAccessAsync( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + revokeAccessWithResponseAsync( + resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Revokes access to a diskRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. + * @param diskRestorePointName The name of the disk restore point created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRevokeAccess( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName) { + return this + .beginRevokeAccessAsync( + resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName) + .getSyncPoller(); + } + + /** + * Revokes access to a diskRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. + * @param diskRestorePointName The name of the disk restore point created. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRevokeAccess( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName, + Context context) { + return this + .beginRevokeAccessAsync( + resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName, context) + .getSyncPoller(); + } + + /** + * Revokes access to a diskRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. + * @param diskRestorePointName The name of the disk restore point created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono revokeAccessAsync( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName) { + return beginRevokeAccessAsync( + resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Revokes access to a diskRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. + * @param diskRestorePointName The name of the disk restore point created. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono revokeAccessAsync( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName, + Context context) { + return beginRevokeAccessAsync( + resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Revokes access to a diskRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. + * @param diskRestorePointName The name of the disk restore point created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void revokeAccess( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName) { + revokeAccessAsync(resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName) + .block(); + } + + /** + * Revokes access to a diskRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. + * @param diskRestorePointName The name of the disk restore point created. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void revokeAccess( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName, + Context context) { + revokeAccessAsync( + resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName, context) + .block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByRestorePointNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByRestorePointNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @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..d5bc49b613afb --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DiskRestorePointsImpl.java @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.DiskRestorePointsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.AccessUriInner; +import com.azure.resourcemanager.compute.generated.fluent.models.DiskRestorePointInner; +import com.azure.resourcemanager.compute.generated.models.AccessUri; +import com.azure.resourcemanager.compute.generated.models.DiskRestorePoint; +import com.azure.resourcemanager.compute.generated.models.DiskRestorePoints; +import com.azure.resourcemanager.compute.generated.models.GrantAccessData; + +public final class DiskRestorePointsImpl implements DiskRestorePoints { + private static 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 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 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 PagedIterable listByRestorePoint( + String resourceGroupName, String restorePointCollectionName, String vmRestorePointName) { + PagedIterable inner = + this.serviceClient().listByRestorePoint(resourceGroupName, restorePointCollectionName, vmRestorePointName); + return Utils.mapPage(inner, inner1 -> new DiskRestorePointImpl(inner1, this.manager())); + } + + public PagedIterable listByRestorePoint( + String resourceGroupName, String restorePointCollectionName, String vmRestorePointName, Context context) { + PagedIterable inner = + this + .serviceClient() + .listByRestorePoint(resourceGroupName, restorePointCollectionName, vmRestorePointName, context); + return Utils.mapPage(inner, inner1 -> new DiskRestorePointImpl(inner1, this.manager())); + } + + public AccessUri grantAccess( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName, + GrantAccessData grantAccessData) { + AccessUriInner inner = + this + .serviceClient() + .grantAccess( + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + diskRestorePointName, + grantAccessData); + if (inner != null) { + return new AccessUriImpl(inner, this.manager()); + } else { + return null; + } + } + + public AccessUri grantAccess( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName, + GrantAccessData grantAccessData, + Context context) { + AccessUriInner inner = + this + .serviceClient() + .grantAccess( + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + diskRestorePointName, + grantAccessData, + context); + if (inner != null) { + return new AccessUriImpl(inner, this.manager()); + } else { + return null; + } + } + + public void revokeAccess( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName) { + this + .serviceClient() + .revokeAccess(resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName); + } + + public void revokeAccess( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName, + Context context) { + this + .serviceClient() + .revokeAccess( + resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName, context); + } + + private DiskRestorePointsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DisksClientImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DisksClientImpl.java new file mode 100644 index 0000000000000..153525bdd38de --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DisksClientImpl.java @@ -0,0 +1,2145 @@ +// Copyright (c) Microsoft Corporation. All rights 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.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 { + /** 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") + public 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-07-02"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskName, + apiVersion, + disk, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + * characters. + * @param disk Disk object supplied in the body of the Put disk operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-07-02"; + 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 the {@link PollerFlux} for polling of disk resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, 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 the {@link PollerFlux} for polling of disk resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of disk resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DiskInner> beginCreateOrUpdate( + String resourceGroupName, String diskName, DiskInner disk) { + return this.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 the {@link SyncPoller} for polling of disk resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DiskInner> beginCreateOrUpdate( + String resourceGroupName, String diskName, DiskInner disk, Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-07-02"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskName, + apiVersion, + disk, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates (patches) a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + * characters. + * @param disk Disk object supplied in the body of the Patch disk operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-07-02"; + 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 the {@link PollerFlux} for polling of disk resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, 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 the {@link PollerFlux} for polling of disk resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of disk resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DiskInner> beginUpdate( + String resourceGroupName, String diskName, DiskUpdate disk) { + return this.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 the {@link SyncPoller} for polling of disk resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DiskInner> beginUpdate( + String resourceGroupName, String diskName, DiskUpdate disk, Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-07-02"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets information about a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + * characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a disk along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-07-02"; + 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String diskName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, diskName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String diskName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, diskName, 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) + public DiskInner getByResourceGroup(String resourceGroupName, String diskName) { + return getByResourceGroupWithResponse(resourceGroupName, diskName, Context.NONE).getValue(); + } + + /** + * 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-07-02"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskName, + apiVersion, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + * characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-07-02"; + 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String diskName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String diskName, Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String apiVersion = "2022-07-02"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the disks under a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Disks operation response along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String apiVersion = "2022-07-02"; + 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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2022-07-02"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the disks under a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Disks operation response along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2022-07-02"; + 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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-07-02"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .grantAccess( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskName, + apiVersion, + grantAccessData, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Grants access to a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + * characters. + * @param grantAccessData Access data object supplied in the body of the get disk access operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a disk access SAS uri along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-07-02"; + 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 the {@link PollerFlux} for polling of a disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + 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 the {@link PollerFlux} for polling of a disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of a disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AccessUriInner> beginGrantAccess( + String resourceGroupName, String diskName, GrantAccessData grantAccessData) { + return this.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 the {@link SyncPoller} for polling of a disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AccessUriInner> beginGrantAccess( + String resourceGroupName, String diskName, GrantAccessData grantAccessData, Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-07-02"; + return FluxUtil + .withContext( + context -> + service + .revokeAccess( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskName, + apiVersion, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Revokes access to a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + * characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-07-02"; + 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRevokeAccess(String resourceGroupName, String diskName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRevokeAccess( + String resourceGroupName, String diskName, Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Disks operation response along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Disks operation response along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Disks operation response along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Disks operation response along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/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..4788db1747d22 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DisksImpl.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.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; + +public final class DisksImpl implements Disks { + private static 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 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 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 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..cd255518b024f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleriesClientImpl.java @@ -0,0 +1,1585 @@ +// Copyright (c) Microsoft Corporation. All rights 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.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.GalleryExpandParams; +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 { + /** 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") + public 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, + @QueryParam("$expand") GalleryExpandParams expand, + @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 along with {@link + * Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-03"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + apiVersion, + gallery, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with + * dots and periods allowed in the middle. The maximum length is 80 characters. + * @param gallery Parameters supplied to the create or update Shared Image Gallery operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Shared Image Gallery that you want to create or update along with {@link + * Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-03"; + 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 the {@link PollerFlux} for polling of specifies information about the Shared Image Gallery that you want + * to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, 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 the {@link PollerFlux} for polling of specifies information about the Shared Image Gallery that you want + * to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of specifies information about the Shared Image Gallery that you want + * to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GalleryInner> beginCreateOrUpdate( + String resourceGroupName, String galleryName, GalleryInner gallery) { + return this.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 the {@link SyncPoller} for polling of specifies information about the Shared Image Gallery that you want + * to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GalleryInner> beginCreateOrUpdate( + String resourceGroupName, String galleryName, GalleryInner gallery, Context context) { + return this.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 on successful + * completion of {@link Mono}. + */ + @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 on successful + * completion of {@link Mono}. + */ + @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 along with {@link + * Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-03"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + apiVersion, + gallery, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with + * dots and periods allowed in the middle. The maximum length is 80 characters. + * @param gallery Parameters supplied to the update Shared Image Gallery operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Shared Image Gallery that you want to create or update along with {@link + * Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-03"; + 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 the {@link PollerFlux} for polling of specifies information about the Shared Image Gallery that you want + * to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, 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 the {@link PollerFlux} for polling of specifies information about the Shared Image Gallery that you want + * to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of specifies information about the Shared Image Gallery that you want + * to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GalleryInner> beginUpdate( + String resourceGroupName, String galleryName, GalleryUpdate gallery) { + return this.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 the {@link SyncPoller} for polling of specifies information about the Shared Image Gallery that you want + * to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GalleryInner> beginUpdate( + String resourceGroupName, String galleryName, GalleryUpdate gallery, Context context) { + return this.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 on successful + * completion of {@link Mono}. + */ + @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 on successful + * completion of {@link Mono}. + */ + @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. + * @param expand The expand query option 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 along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String galleryName, SelectPermissions select, GalleryExpandParams 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.")); + } + final String apiVersion = "2022-03-03"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + apiVersion, + select, + expand, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves information about a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. + * @param select The select expression to apply on the operation. + * @param expand The expand query option 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 along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, + String galleryName, + SelectPermissions select, + GalleryExpandParams 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.")); + } + final String apiVersion = "2022-03-03"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + apiVersion, + select, + expand, + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the 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 on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String galleryName) { + final SelectPermissions select = null; + final GalleryExpandParams expand = null; + return getByResourceGroupWithResponseAsync(resourceGroupName, galleryName, select, expand) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 expand The expand query option 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 along with {@link + * Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, + String galleryName, + SelectPermissions select, + GalleryExpandParams expand, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, galleryName, select, expand, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the 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; + final GalleryExpandParams expand = null; + return getByResourceGroupWithResponse(resourceGroupName, galleryName, select, expand, Context.NONE).getValue(); + } + + /** + * 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-03"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-03"; + 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String galleryName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String galleryName, Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String apiVersion = "2022-03-03"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List galleries under a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Galleries operation response along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String apiVersion = "2022-03-03"; + 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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2022-03-03"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List galleries under a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Galleries operation response along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2022-03-03"; + 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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/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..3d02a7050513f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleriesImpl.java @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.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.GalleryExpandParams; +import com.azure.resourcemanager.compute.generated.models.SelectPermissions; + +public final class GalleriesImpl implements Galleries { + private static 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 Response getByResourceGroupWithResponse( + String resourceGroupName, + String galleryName, + SelectPermissions select, + GalleryExpandParams expand, + Context context) { + Response inner = + this + .serviceClient() + .getByResourceGroupWithResponse(resourceGroupName, galleryName, select, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new GalleryImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + 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 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; + GalleryExpandParams localExpand = null; + return this + .getByResourceGroupWithResponse(resourceGroupName, galleryName, localSelect, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse( + String id, SelectPermissions select, GalleryExpandParams 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))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, galleryName, select, 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))); + } + 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..f3edc468a47fd --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryApplicationImpl.java @@ -0,0 +1,288 @@ +// Copyright (c) Microsoft Corporation. All rights 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.GalleryApplicationCustomAction; +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.List; +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 List customActions() { + List inner = this.innerModel().customActions(); + 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 String resourceGroupName() { + return resourceGroupName; + } + + 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; + } + } + + public GalleryApplicationImpl withCustomActions(List customActions) { + if (isInCreateMode()) { + this.innerModel().withCustomActions(customActions); + return this; + } else { + this.updateGalleryApplication.withCustomActions(customActions); + 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..ea805c8ea0a01 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryApplicationVersionImpl.java @@ -0,0 +1,266 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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.GalleryApplicationVersionPublishingProfile; +import com.azure.resourcemanager.compute.generated.models.GalleryApplicationVersionSafetyProfile; +import com.azure.resourcemanager.compute.generated.models.GalleryApplicationVersionUpdate; +import com.azure.resourcemanager.compute.generated.models.GalleryProvisioningState; +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 GalleryApplicationVersionSafetyProfile safetyProfile() { + return this.innerModel().safetyProfile(); + } + + public GalleryProvisioningState 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 String resourceGroupName() { + return resourceGroupName; + } + + 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; + } + } + + public GalleryApplicationVersionImpl withSafetyProfile(GalleryApplicationVersionSafetyProfile safetyProfile) { + if (isInCreateMode()) { + this.innerModel().withSafetyProfile(safetyProfile); + return this; + } else { + this.updateGalleryApplicationVersion.withSafetyProfile(safetyProfile); + 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..1ee735893b714 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryApplicationVersionsClientImpl.java @@ -0,0 +1,1952 @@ +// Copyright (c) Microsoft Corporation. All rights 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.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 { + /** 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") + public 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 along with + * {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-03"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + apiVersion, + galleryApplicationVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is + * to be created. + * @param galleryApplicationVersionName The name of the gallery Application Version to be created. Needs to follow + * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range + * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryApplicationVersion Parameters supplied to the create or update gallery Application Version + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Version that you want to create or update along with + * {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-03"; + 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 the {@link PollerFlux} for polling of specifies information about the gallery Application Version that + * you want to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + 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 the {@link PollerFlux} for polling of specifies information about the gallery Application Version that + * you want to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of specifies information about the gallery Application Version that + * you want to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GalleryApplicationVersionInner> beginCreateOrUpdate( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + GalleryApplicationVersionInner galleryApplicationVersion) { + return this + .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 the {@link SyncPoller} for polling of specifies information about the gallery Application Version that + * you want to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GalleryApplicationVersionInner> beginCreateOrUpdate( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + GalleryApplicationVersionInner galleryApplicationVersion, + Context context) { + return this + .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 on + * successful completion of {@link Mono}. + */ + @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 on + * successful completion of {@link Mono}. + */ + @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 along with + * {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-03"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + apiVersion, + galleryApplicationVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is + * to be updated. + * @param galleryApplicationVersionName The name of the gallery Application Version to be updated. Needs to follow + * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range + * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryApplicationVersion Parameters supplied to the update gallery Application Version operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Version that you want to create or update along with + * {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-03"; + 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 the {@link PollerFlux} for polling of specifies information about the gallery Application Version that + * you want to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + 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 the {@link PollerFlux} for polling of specifies information about the gallery Application Version that + * you want to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of specifies information about the gallery Application Version that + * you want to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GalleryApplicationVersionInner> beginUpdate( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + GalleryApplicationVersionUpdate galleryApplicationVersion) { + return this + .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 the {@link SyncPoller} for polling of specifies information about the gallery Application Version that + * you want to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GalleryApplicationVersionInner> beginUpdate( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + GalleryApplicationVersionUpdate galleryApplicationVersion, + Context context) { + return this + .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 on + * successful completion of {@link Mono}. + */ + @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 on + * successful completion of {@link Mono}. + */ + @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 along with + * {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-03"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + expand, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves information about a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version + * resides. + * @param galleryApplicationVersionName The name of the gallery Application Version to be retrieved. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Version that you want to create or update along with + * {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-03"; + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request 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 on + * successful completion of {@link Mono}. + */ + @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(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with + * {@link Response}. + */ + @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(); + } + + /** + * 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 getWithResponse( + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + expand, + Context.NONE) + .getValue(); + } + + /** + * 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-03"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version + * resides. + * @param galleryApplicationVersionName The name of the gallery Application Version to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-03"; + 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName) { + return this + .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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + Context context) { + return this + .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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 = "2022-03-03"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByGalleryApplication( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + galleryApplicationName, + apiVersion, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List gallery Application Versions in a gallery Application Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the Shared Application Gallery Application Definition from which the + * Application Versions are to be listed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Gallery Application version operation response along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 = "2022-03-03"; + 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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 URL to get the next list of items + *

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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByGalleryApplicationNextSinglePageAsync( + String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByGalleryApplicationNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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..f881a3de5a0e8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryApplicationVersionsImpl.java @@ -0,0 +1,270 @@ +// Copyright (c) Microsoft Corporation. All rights 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; + +public final class GalleryApplicationVersionsImpl implements GalleryApplicationVersions { + private static 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 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 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 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..7a9a80f87776e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryApplicationsClientImpl.java @@ -0,0 +1,1614 @@ +// Copyright (c) Microsoft Corporation. All rights 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.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 { + /** 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") + public 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 along + * with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-03"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + galleryApplicationName, + apiVersion, + galleryApplication, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a gallery Application Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be + * created. + * @param galleryApplicationName The name of the gallery Application Definition to be created or updated. The + * allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The + * maximum length is 80 characters. + * @param galleryApplication Parameters supplied to the create or update gallery Application operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Definition that you want to create or update along + * with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-03"; + 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 the {@link PollerFlux} for polling of specifies information about the gallery Application Definition that + * you want to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + 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 the {@link PollerFlux} for polling of specifies information about the gallery Application Definition that + * you want to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of specifies information about the gallery Application Definition that + * you want to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GalleryApplicationInner> beginCreateOrUpdate( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + GalleryApplicationInner galleryApplication) { + return this + .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 the {@link SyncPoller} for polling of specifies information about the gallery Application Definition that + * you want to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GalleryApplicationInner> beginCreateOrUpdate( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + GalleryApplicationInner galleryApplication, + Context context) { + return this + .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 on + * successful completion of {@link Mono}. + */ + @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 on + * successful completion of {@link Mono}. + */ + @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 along + * with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-03"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + galleryApplicationName, + apiVersion, + galleryApplication, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a gallery Application Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be + * updated. + * @param galleryApplicationName The name of the gallery Application Definition to be updated. The allowed + * characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length + * is 80 characters. + * @param galleryApplication Parameters supplied to the update gallery Application operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Definition that you want to create or update along + * with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-03"; + 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 the {@link PollerFlux} for polling of specifies information about the gallery Application Definition that + * you want to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + 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 the {@link PollerFlux} for polling of specifies information about the gallery Application Definition that + * you want to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of specifies information about the gallery Application Definition that + * you want to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GalleryApplicationInner> beginUpdate( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + GalleryApplicationUpdate galleryApplication) { + return this + .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 the {@link SyncPoller} for polling of specifies information about the gallery Application Definition that + * you want to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GalleryApplicationInner> beginUpdate( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + GalleryApplicationUpdate galleryApplication, + Context context) { + return this + .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 on + * successful completion of {@link Mono}. + */ + @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 on + * successful completion of {@link Mono}. + */ + @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 along + * with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-03"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + galleryApplicationName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves information about a gallery Application Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery from which the Application Definitions are to be + * retrieved. + * @param galleryApplicationName The name of the gallery Application Definition to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Definition that you want to create or update along + * with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-03"; + 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 on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String galleryName, String galleryApplicationName) { + return getWithResponseAsync(resourceGroupName, galleryName, galleryApplicationName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String galleryName, String galleryApplicationName, Context context) { + return getWithResponseAsync(resourceGroupName, galleryName, galleryApplicationName, 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) + public GalleryApplicationInner get(String resourceGroupName, String galleryName, String galleryApplicationName) { + return getWithResponse(resourceGroupName, galleryName, galleryApplicationName, Context.NONE).getValue(); + } + + /** + * 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-03"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + galleryApplicationName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a gallery Application. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be + * deleted. + * @param galleryApplicationName The name of the gallery Application Definition to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-03"; + 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String galleryName, String galleryApplicationName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String galleryName, String galleryApplicationName, Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 = "2022-03-03"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByGallery( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + apiVersion, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List gallery Application Definitions in a gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery from which Application Definitions are to be + * listed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Gallery Applications operation response along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 = "2022-03-03"; + 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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 URL to get the next list of items + *

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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByGalleryNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByGalleryNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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..4543034a7b018 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryApplicationsImpl.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights 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; + +public final class GalleryApplicationsImpl implements GalleryApplications { + private static 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 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 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 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..7cef6eedea4a0 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryImageImpl.java @@ -0,0 +1,395 @@ +// Copyright (c) Microsoft Corporation. All rights 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.Architecture; +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.GalleryImageUpdate; +import com.azure.resourcemanager.compute.generated.models.GalleryProvisioningState; +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 GalleryProvisioningState 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 Architecture architecture() { + return this.innerModel().architecture(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + 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; + } + } + + public GalleryImageImpl withArchitecture(Architecture architecture) { + if (isInCreateMode()) { + this.innerModel().withArchitecture(architecture); + return this; + } else { + this.updateGalleryImage.withArchitecture(architecture); + 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..d9f7a7c14546a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryImageVersionImpl.java @@ -0,0 +1,274 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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.GalleryImageVersionPublishingProfile; +import com.azure.resourcemanager.compute.generated.models.GalleryImageVersionSafetyProfile; +import com.azure.resourcemanager.compute.generated.models.GalleryImageVersionStorageProfile; +import com.azure.resourcemanager.compute.generated.models.GalleryImageVersionUpdate; +import com.azure.resourcemanager.compute.generated.models.GalleryProvisioningState; +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 GalleryProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public GalleryImageVersionStorageProfile storageProfile() { + return this.innerModel().storageProfile(); + } + + public GalleryImageVersionSafetyProfile safetyProfile() { + return this.innerModel().safetyProfile(); + } + + public ReplicationStatus replicationStatus() { + return this.innerModel().replicationStatus(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + 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; + } + } + + public GalleryImageVersionImpl withSafetyProfile(GalleryImageVersionSafetyProfile safetyProfile) { + if (isInCreateMode()) { + this.innerModel().withSafetyProfile(safetyProfile); + return this; + } else { + this.updateGalleryImageVersion.withSafetyProfile(safetyProfile); + 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..865170c5ec97b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryImageVersionsClientImpl.java @@ -0,0 +1,1779 @@ +// Copyright (c) Microsoft Corporation. All rights 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.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 { + /** 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") + public 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 along with {@link + * Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-03"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + apiVersion, + galleryImageVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery image definition in which the Image Version is to be created. + * @param galleryImageVersionName The name of the gallery image version to be created. Needs to follow semantic + * version name pattern: The allowed characters are digit and period. Digits must be within the range of a + * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryImageVersion Parameters supplied to the create or update gallery image version operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image version that you want to create or update along with {@link + * Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-03"; + 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 the {@link PollerFlux} for polling of specifies information about the gallery image version that you want + * to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + 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 the {@link PollerFlux} for polling of specifies information about the gallery image version that you want + * to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of specifies information about the gallery image version that you want + * to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GalleryImageVersionInner> beginCreateOrUpdate( + String resourceGroupName, + String galleryName, + String galleryImageName, + String galleryImageVersionName, + GalleryImageVersionInner galleryImageVersion) { + return this + .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 the {@link SyncPoller} for polling of specifies information about the gallery image version that you want + * to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GalleryImageVersionInner> beginCreateOrUpdate( + String resourceGroupName, + String galleryName, + String galleryImageName, + String galleryImageVersionName, + GalleryImageVersionInner galleryImageVersion, + Context context) { + return this + .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 on successful + * completion of {@link Mono}. + */ + @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 on successful + * completion of {@link Mono}. + */ + @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 along with {@link + * Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-03"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + apiVersion, + galleryImageVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery image definition in which the Image Version is to be updated. + * @param galleryImageVersionName The name of the gallery image version to be updated. Needs to follow semantic + * version name pattern: The allowed characters are digit and period. Digits must be within the range of a + * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryImageVersion Parameters supplied to the update gallery image version operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image version that you want to create or update along with {@link + * Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-03"; + 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 the {@link PollerFlux} for polling of specifies information about the gallery image version that you want + * to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + 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 the {@link PollerFlux} for polling of specifies information about the gallery image version that you want + * to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of specifies information about the gallery image version that you want + * to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GalleryImageVersionInner> beginUpdate( + String resourceGroupName, + String galleryName, + String galleryImageName, + String galleryImageVersionName, + GalleryImageVersionUpdate galleryImageVersion) { + return this + .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 the {@link SyncPoller} for polling of specifies information about the gallery image version that you want + * to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GalleryImageVersionInner> beginUpdate( + String resourceGroupName, + String galleryName, + String galleryImageName, + String galleryImageVersionName, + GalleryImageVersionUpdate galleryImageVersion, + Context context) { + return this + .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 on successful + * completion of {@link Mono}. + */ + @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 on successful + * completion of {@link Mono}. + */ + @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 along with {@link + * Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-03"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + expand, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves information about a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery image definition in which the Image Version resides. + * @param galleryImageVersionName The name of the gallery image version to be retrieved. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image version that you want to create or update along with {@link + * Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-03"; + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request 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 on successful + * completion of {@link Mono}. + */ + @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(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link + * Response}. + */ + @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(); + } + + /** + * 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 getWithResponse( + resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, expand, Context.NONE) + .getValue(); + } + + /** + * 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-03"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery image definition in which the Image Version resides. + * @param galleryImageVersionName The name of the gallery image version to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-03"; + 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName) { + return this + .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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, + String galleryName, + String galleryImageName, + String galleryImageVersionName, + Context context) { + return this + .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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 = "2022-03-03"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByGalleryImage( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + galleryImageName, + apiVersion, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List gallery image versions in a gallery image definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the Shared Image Gallery Image Definition from which the Image Versions are + * to be listed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Gallery Image version operation response along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 = "2022-03-03"; + 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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 URL to get the next list of items + *

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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByGalleryImageNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByGalleryImageNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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..a40d9d3a5bd05 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryImageVersionsImpl.java @@ -0,0 +1,244 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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; + +public final class GalleryImageVersionsImpl implements GalleryImageVersions { + private static 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 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 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 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..74240e179c221 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryImagesClientImpl.java @@ -0,0 +1,1514 @@ +// Copyright (c) Microsoft Corporation. All rights 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.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 { + /** 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") + public 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 along with + * {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-03"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + galleryImageName, + apiVersion, + galleryImage, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a gallery image definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be created. + * @param galleryImageName The name of the gallery image definition to be created or updated. The allowed characters + * are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 + * characters. + * @param galleryImage Parameters supplied to the create or update gallery image operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image definition that you want to create or update along with + * {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-03"; + 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 the {@link PollerFlux} for polling of specifies information about the gallery image definition that you + * want to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + 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 the {@link PollerFlux} for polling of specifies information about the gallery image definition that you + * want to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of specifies information about the gallery image definition that you + * want to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GalleryImageInner> beginCreateOrUpdate( + String resourceGroupName, String galleryName, String galleryImageName, GalleryImageInner galleryImage) { + return this + .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 the {@link SyncPoller} for polling of specifies information about the gallery image definition that you + * want to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GalleryImageInner> beginCreateOrUpdate( + String resourceGroupName, + String galleryName, + String galleryImageName, + GalleryImageInner galleryImage, + Context context) { + return this + .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 on successful + * completion of {@link Mono}. + */ + @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 on successful + * completion of {@link Mono}. + */ + @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 along with + * {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-03"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + galleryImageName, + apiVersion, + galleryImage, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a gallery image definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be updated. + * @param galleryImageName The name of the gallery image definition to be updated. The allowed characters are + * alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 + * characters. + * @param galleryImage Parameters supplied to the update gallery image operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image definition that you want to create or update along with + * {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-03"; + 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 the {@link PollerFlux} for polling of specifies information about the gallery image definition that you + * want to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + 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 the {@link PollerFlux} for polling of specifies information about the gallery image definition that you + * want to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of specifies information about the gallery image definition that you + * want to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GalleryImageInner> beginUpdate( + String resourceGroupName, String galleryName, String galleryImageName, GalleryImageUpdate galleryImage) { + return this.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 the {@link SyncPoller} for polling of specifies information about the gallery image definition that you + * want to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GalleryImageInner> beginUpdate( + String resourceGroupName, + String galleryName, + String galleryImageName, + GalleryImageUpdate galleryImage, + Context context) { + return this + .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 on successful + * completion of {@link Mono}. + */ + @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 on successful + * completion of {@link Mono}. + */ + @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 along with + * {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-03"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + galleryImageName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves information about a gallery image definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery from which the Image Definitions are to be retrieved. + * @param galleryImageName The name of the gallery image definition to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image definition that you want to create or update along with + * {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-03"; + 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 on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String galleryName, String galleryImageName) { + return getWithResponseAsync(resourceGroupName, galleryName, galleryImageName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String galleryName, String galleryImageName, Context context) { + return getWithResponseAsync(resourceGroupName, galleryName, galleryImageName, 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) + public GalleryImageInner get(String resourceGroupName, String galleryName, String galleryImageName) { + return getWithResponse(resourceGroupName, galleryName, galleryImageName, Context.NONE).getValue(); + } + + /** + * 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-03"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + galleryImageName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a gallery image. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be deleted. + * @param galleryImageName The name of the gallery image definition to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-03"; + 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String galleryName, String galleryImageName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String galleryName, String galleryImageName, Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 = "2022-03-03"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByGallery( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + apiVersion, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List gallery image definitions in a gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery from which Image Definitions are to be listed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Gallery Images operation response along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 = "2022-03-03"; + 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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 URL to get the next list of items + *

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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByGalleryNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByGalleryNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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..66773f7d65af5 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryImagesImpl.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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; + +public final class GalleryImagesImpl implements GalleryImages { + private static 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 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 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 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..9ef43a71386b6 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryImpl.java @@ -0,0 +1,248 @@ +// Copyright (c) Microsoft Corporation. All rights 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.GalleryExpandParams; +import com.azure.resourcemanager.compute.generated.models.GalleryIdentifier; +import com.azure.resourcemanager.compute.generated.models.GalleryProvisioningState; +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 com.azure.resourcemanager.compute.generated.models.SharingStatus; +import com.azure.resourcemanager.compute.generated.models.SoftDeletePolicy; +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 GalleryProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public SharingProfile sharingProfile() { + return this.innerModel().sharingProfile(); + } + + public SoftDeletePolicy softDeletePolicy() { + return this.innerModel().softDeletePolicy(); + } + + public SharingStatus sharingStatus() { + return this.innerModel().sharingStatus(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + 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; + GalleryExpandParams localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getGalleries() + .getByResourceGroupWithResponse(resourceGroupName, galleryName, localSelect, localExpand, Context.NONE) + .getValue(); + return this; + } + + public Gallery refresh(Context context) { + SelectPermissions localSelect = null; + GalleryExpandParams localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getGalleries() + .getByResourceGroupWithResponse(resourceGroupName, galleryName, localSelect, localExpand, 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; + } + } + + public GalleryImpl withSoftDeletePolicy(SoftDeletePolicy softDeletePolicy) { + if (isInCreateMode()) { + this.innerModel().withSoftDeletePolicy(softDeletePolicy); + return this; + } else { + this.updateGallery.withSoftDeletePolicy(softDeletePolicy); + 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..093972381926f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GallerySharingProfilesClientImpl.java @@ -0,0 +1,345 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.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 { + /** 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") + public 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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2022-03-03"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + apiVersion, + sharingUpdate, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update sharing profile of a gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. + * @param sharingUpdate Parameters supplied to the update gallery sharing profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery sharing profile update along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2022-03-03"; + 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 the {@link PollerFlux} for polling of specifies information about the gallery sharing profile update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + 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 the {@link PollerFlux} for polling of specifies information about the gallery sharing profile update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of specifies information about the gallery sharing profile update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SharingUpdateInner> beginUpdate( + String resourceGroupName, String galleryName, SharingUpdateInner sharingUpdate) { + return this.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 the {@link SyncPoller} for polling of specifies information about the gallery sharing profile update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SharingUpdateInner> beginUpdate( + String resourceGroupName, String galleryName, SharingUpdateInner sharingUpdate, Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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..6f6ba062e4184 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GallerySharingProfilesImpl.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.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; + +public final class GallerySharingProfilesImpl implements GallerySharingProfiles { + private static 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..3a5800bf6da89 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ImageImpl.java @@ -0,0 +1,231 @@ +// Copyright (c) Microsoft Corporation. All rights 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 String resourceGroupName() { + return resourceGroupName; + } + + 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..9a5c229ccc25a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ImagesClientImpl.java @@ -0,0 +1,1535 @@ +// Copyright (c) Microsoft Corporation. All rights 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.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.ApiErrorException; +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 { + /** 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") + public interface ImagesService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ApiErrorException.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(ApiErrorException.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({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("imageName") String imageName, + @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/{imageName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.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(ApiErrorException.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(ApiErrorException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> 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 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 ApiErrorException 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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + imageName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update an image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @param parameters Parameters supplied to the Create Image operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 = "2023-03-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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the source user image virtual hard disk. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the source user image virtual hard disk. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the source user image virtual hard disk. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ImageInner> beginCreateOrUpdate( + String resourceGroupName, String imageName, ImageInner parameters) { + return this.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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the source user image virtual hard disk. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ImageInner> beginCreateOrUpdate( + String resourceGroupName, String imageName, ImageInner parameters, Context context) { + return this.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 ApiErrorException 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 on successful completion of {@link Mono}. + */ + @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 ApiErrorException 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 on successful completion of {@link Mono}. + */ + @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 ApiErrorException 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 ApiErrorException 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 ApiErrorException 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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + imageName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update an image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @param parameters Parameters supplied to the Update Image operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 = "2023-03-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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the source user image virtual hard disk. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the source user image virtual hard disk. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the source user image virtual hard disk. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ImageInner> beginUpdate( + String resourceGroupName, String imageName, ImageUpdate parameters) { + return this.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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the source user image virtual hard disk. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ImageInner> beginUpdate( + String resourceGroupName, String imageName, ImageUpdate parameters, Context context) { + return this.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 ApiErrorException 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 on successful completion of {@link Mono}. + */ + @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 ApiErrorException 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 on successful completion of {@link Mono}. + */ + @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 ApiErrorException 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 ApiErrorException 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String 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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + imageName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an Image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String 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 = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + imageName, + apiVersion, + this.client.getSubscriptionId(), + accept, + 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String imageName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, imageName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String imageName) { + return this.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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String imageName, Context context) { + return this.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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String 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 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 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 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 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 ApiErrorException 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + imageName, + expand, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets an image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-03-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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String imageName) { + final String expand = null; + return getByResourceGroupWithResponseAsync(resourceGroupName, imageName, expand) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 ApiErrorException 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String imageName, String expand, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, imageName, expand, context).block(); + } + + /** + * 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 ApiErrorException 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 getByResourceGroupWithResponse(resourceGroupName, imageName, expand, Context.NONE).getValue(); + } + + /** + * 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 ApiErrorException thrown 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the list of images under a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2023-03-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 ApiErrorException thrown 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 as paginated response with {@link PagedFlux}. + */ + @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 ApiErrorException thrown 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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * 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 ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + @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 ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + @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 ApiErrorException thrown 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the list of Images in the subscription. Use nextLink property in the response to get the next page of + * Images. Do this till nextLink is null to fetch all the Images. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2023-03-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 ApiErrorException thrown 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 as paginated response with {@link PagedFlux}. + */ + @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 ApiErrorException thrown 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 as paginated response with {@link PagedFlux}. + */ + @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 ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + @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 ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 Image operation response along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 Image operation response along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/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..ebb4e12584d19 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ImagesImpl.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.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; + +public final class ImagesImpl implements Images { + private static 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 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 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 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..c8a412be55f30 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/LogAnalyticsClientImpl.java @@ -0,0 +1,607 @@ +// Copyright (c) Microsoft Corporation. All rights 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.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.ApiErrorException; +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 { + /** 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") + public interface LogAnalyticsService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/logAnalytics/apiAccess/getRequestRateByInterval") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.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(ApiErrorException.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 ApiErrorException 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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .exportRequestRateByInterval( + this.client.getEndpoint(), + location, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Export logs that show Api requests made by this subscription in the given time window to show throttling + * activities. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Parameters supplied to the LogAnalytics getRequestRateByInterval Api. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 = "2023-03-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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of logAnalytics operation status response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of logAnalytics operation status response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of logAnalytics operation status response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LogAnalyticsOperationResultInner> + beginExportRequestRateByInterval(String location, RequestRateByIntervalInput parameters) { + return this.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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of logAnalytics operation status response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LogAnalyticsOperationResultInner> + beginExportRequestRateByInterval(String location, RequestRateByIntervalInput parameters, Context context) { + return this.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 ApiErrorException 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 on successful completion of {@link Mono}. + */ + @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 ApiErrorException 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 on successful completion of {@link Mono}. + */ + @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 ApiErrorException 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 ApiErrorException 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 ApiErrorException 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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .exportThrottledRequests( + this.client.getEndpoint(), + location, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Export logs that show total throttled Api requests for this subscription in the given time window. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Parameters supplied to the LogAnalytics getThrottledRequests Api. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 = "2023-03-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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of logAnalytics operation status response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of logAnalytics operation status response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of logAnalytics operation status response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LogAnalyticsOperationResultInner> + beginExportThrottledRequests(String location, ThrottledRequestsInput parameters) { + return this.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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of logAnalytics operation status response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LogAnalyticsOperationResultInner> + beginExportThrottledRequests(String location, ThrottledRequestsInput parameters, Context context) { + return this.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 ApiErrorException 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 on successful completion of {@link Mono}. + */ + @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 ApiErrorException 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 on successful completion of {@link Mono}. + */ + @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 ApiErrorException 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 ApiErrorException 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..b9c561e64bc6e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/LogAnalyticsImpl.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.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; + +public final class LogAnalyticsImpl implements LogAnalytics { + private static final ClientLogger LOGGER = new ClientLogger(LogAnalyticsImpl.class); + + private final LogAnalyticsClient innerClient; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + public LogAnalyticsImpl( + LogAnalyticsClient innerClient, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public LogAnalyticsOperationResult exportRequestRateByInterval( + String location, RequestRateByIntervalInput parameters) { + LogAnalyticsOperationResultInner inner = this.serviceClient().exportRequestRateByInterval(location, parameters); + if (inner != null) { + return new LogAnalyticsOperationResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public LogAnalyticsOperationResult exportRequestRateByInterval( + String location, RequestRateByIntervalInput parameters, Context context) { + LogAnalyticsOperationResultInner inner = + this.serviceClient().exportRequestRateByInterval(location, parameters, context); + if (inner != null) { + return new LogAnalyticsOperationResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public LogAnalyticsOperationResult exportThrottledRequests(String location, ThrottledRequestsInput parameters) { + LogAnalyticsOperationResultInner inner = this.serviceClient().exportThrottledRequests(location, parameters); + if (inner != null) { + return new LogAnalyticsOperationResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public LogAnalyticsOperationResult exportThrottledRequests( + String location, ThrottledRequestsInput parameters, Context context) { + LogAnalyticsOperationResultInner inner = + this.serviceClient().exportThrottledRequests(location, parameters, context); + if (inner != null) { + return new LogAnalyticsOperationResultImpl(inner, this.manager()); + } else { + return null; + } + } + + private LogAnalyticsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/LogAnalyticsOperationResultImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/LogAnalyticsOperationResultImpl.java new file mode 100644 index 0000000000000..498f33b546b23 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/LogAnalyticsOperationResultImpl.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.resourcemanager.compute.generated.fluent.models.LogAnalyticsOperationResultInner; +import com.azure.resourcemanager.compute.generated.models.LogAnalyticsOperationResult; +import com.azure.resourcemanager.compute.generated.models.LogAnalyticsOutput; + +public final class LogAnalyticsOperationResultImpl implements LogAnalyticsOperationResult { + private LogAnalyticsOperationResultInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + LogAnalyticsOperationResultImpl( + LogAnalyticsOperationResultInner innerObject, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public LogAnalyticsOutput properties() { + return this.innerModel().properties(); + } + + public LogAnalyticsOperationResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/OSFamilyImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/OSFamilyImpl.java new file mode 100644 index 0000000000000..f8f51ec56a409 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/OSFamilyImpl.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.resourcemanager.compute.generated.fluent.models.OSFamilyInner; +import com.azure.resourcemanager.compute.generated.models.OSFamily; +import com.azure.resourcemanager.compute.generated.models.OSFamilyProperties; + +public final class OSFamilyImpl implements OSFamily { + private OSFamilyInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + OSFamilyImpl(OSFamilyInner innerObject, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public OSFamilyProperties properties() { + return this.innerModel().properties(); + } + + public OSFamilyInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/OSVersionImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/OSVersionImpl.java new file mode 100644 index 0000000000000..fc67b7d79dfb2 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/OSVersionImpl.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.resourcemanager.compute.generated.fluent.models.OSVersionInner; +import com.azure.resourcemanager.compute.generated.models.OSVersion; +import com.azure.resourcemanager.compute.generated.models.OSVersionProperties; + +public final class OSVersionImpl implements OSVersion { + private OSVersionInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + OSVersionImpl( + OSVersionInner innerObject, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public OSVersionProperties properties() { + return this.innerModel().properties(); + } + + public OSVersionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/OperationsClientImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/OperationsClientImpl.java new file mode 100644 index 0000000000000..985e64d7bfad9 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/OperationsClientImpl.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.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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.compute.generated.fluent.OperationsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.ComputeOperationValueInner; +import com.azure.resourcemanager.compute.generated.models.ApiErrorException; +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 { + /** 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") + public interface OperationsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.Compute/operations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.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 ApiErrorException thrown if 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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String apiVersion = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of compute operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if 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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String apiVersion = "2023-03-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 ApiErrorException thrown if 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 as paginated response with {@link PagedFlux}. + */ + @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 ApiErrorException thrown if 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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context)); + } + + /** + * Gets a list of compute operations. + * + * @throws ApiErrorException thrown if 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 as paginated response with {@link PagedIterable}. + */ + @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 ApiErrorException thrown if 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 as paginated response with {@link PagedIterable}. + */ + @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..d47b4a47cc9b6 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/OperationsImpl.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.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; + +public final class OperationsImpl implements Operations { + private static 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..a5b23a5927bc7 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ProximityPlacementGroupImpl.java @@ -0,0 +1,260 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.ProximityPlacementGroupInner; +import com.azure.resourcemanager.compute.generated.models.InstanceViewStatus; +import com.azure.resourcemanager.compute.generated.models.ProximityPlacementGroup; +import com.azure.resourcemanager.compute.generated.models.ProximityPlacementGroupPropertiesIntent; +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 List zones() { + List inner = this.innerModel().zones(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + 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 ProximityPlacementGroupPropertiesIntent intent() { + return this.innerModel().intent(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + 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 withZones(List zones) { + this.innerModel().withZones(zones); + return this; + } + + public ProximityPlacementGroupImpl withProximityPlacementGroupType( + ProximityPlacementGroupType proximityPlacementGroupType) { + this.innerModel().withProximityPlacementGroupType(proximityPlacementGroupType); + return this; + } + + public ProximityPlacementGroupImpl withColocationStatus(InstanceViewStatus colocationStatus) { + this.innerModel().withColocationStatus(colocationStatus); + return this; + } + + public ProximityPlacementGroupImpl withIntent(ProximityPlacementGroupPropertiesIntent intent) { + this.innerModel().withIntent(intent); + 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..c1ba177be5eca --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ProximityPlacementGroupsClientImpl.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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.compute.generated.fluent.ProximityPlacementGroupsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.ProximityPlacementGroupInner; +import com.azure.resourcemanager.compute.generated.models.ApiErrorException; +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 { + /** 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") + public interface ProximityPlacementGroupsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups/{proximityPlacementGroupName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ApiErrorException.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(ApiErrorException.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({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups/{proximityPlacementGroupName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("proximityPlacementGroupName") String proximityPlacementGroupName, + @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/{proximityPlacementGroupName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.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(ApiErrorException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.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(ApiErrorException.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(ApiErrorException.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 ApiErrorException thrown if the 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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + proximityPlacementGroupName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a proximity placement group. + * + * @param resourceGroupName The name of the resource group. + * @param proximityPlacementGroupName The name of the proximity placement group. + * @param parameters Parameters supplied to the Create Proximity Placement Group operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the 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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2023-03-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 ApiErrorException thrown if the 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String proximityPlacementGroupName, ProximityPlacementGroupInner parameters) { + return createOrUpdateWithResponseAsync(resourceGroupName, proximityPlacementGroupName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 ApiErrorException thrown if the 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String proximityPlacementGroupName, + ProximityPlacementGroupInner parameters, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, proximityPlacementGroupName, parameters, context) + .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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the 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 createOrUpdateWithResponse(resourceGroupName, proximityPlacementGroupName, parameters, Context.NONE) + .getValue(); + } + + /** + * 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 ApiErrorException thrown if the 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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + proximityPlacementGroupName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a proximity placement group. + * + * @param resourceGroupName The name of the resource group. + * @param proximityPlacementGroupName The name of the proximity placement group. + * @param parameters Parameters supplied to the Update Proximity Placement Group operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the 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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2023-03-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 ApiErrorException thrown if the 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String proximityPlacementGroupName, ProximityPlacementGroupUpdate parameters) { + return updateWithResponseAsync(resourceGroupName, proximityPlacementGroupName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 ApiErrorException thrown if the 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String proximityPlacementGroupName, + ProximityPlacementGroupUpdate parameters, + Context context) { + return updateWithResponseAsync(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 ApiErrorException thrown if the 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 updateWithResponse(resourceGroupName, proximityPlacementGroupName, parameters, Context.NONE).getValue(); + } + + /** + * 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String 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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + proximityPlacementGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a proximity placement group. + * + * @param resourceGroupName The name of the resource group. + * @param proximityPlacementGroupName The name of the proximity placement group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String 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 = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + proximityPlacementGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String proximityPlacementGroupName) { + return deleteWithResponseAsync(resourceGroupName, proximityPlacementGroupName).flatMap(ignored -> Mono.empty()); + } + + /** + * 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String proximityPlacementGroupName, Context context) { + return deleteWithResponseAsync(resourceGroupName, proximityPlacementGroupName, 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 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 proximityPlacementGroupName) { + deleteWithResponse(resourceGroupName, proximityPlacementGroupName, Context.NONE); + } + + /** + * 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 ApiErrorException thrown if the 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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + proximityPlacementGroupName, + includeColocationStatus, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves information about a proximity placement group . + * + * @param resourceGroupName The name of the resource group. + * @param proximityPlacementGroupName The name of the proximity placement group. + * @param includeColocationStatus includeColocationStatus=true enables fetching the colocation status of all the + * resources in the proximity placement group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the 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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2023-03-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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String proximityPlacementGroupName) { + final String includeColocationStatus = null; + return getByResourceGroupWithResponseAsync( + resourceGroupName, proximityPlacementGroupName, includeColocationStatus) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 ApiErrorException thrown if the 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String proximityPlacementGroupName, String includeColocationStatus, Context context) { + return getByResourceGroupWithResponseAsync( + resourceGroupName, proximityPlacementGroupName, includeColocationStatus, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the 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 getByResourceGroupWithResponse( + resourceGroupName, proximityPlacementGroupName, includeColocationStatus, Context.NONE) + .getValue(); + } + + /** + * Lists all proximity placement groups in 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 Proximity Placement Group operation response along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all proximity placement groups in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2023-03-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 ApiErrorException thrown 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 as paginated response with {@link PagedFlux}. + */ + @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 ApiErrorException thrown 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 as paginated response with {@link PagedFlux}. + */ + @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 ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + @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 ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + @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 ApiErrorException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all proximity placement groups in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2023-03-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 ApiErrorException thrown 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 as paginated response with {@link PagedFlux}. + */ + @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 ApiErrorException thrown 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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * 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 ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + @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 ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + @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 URL to get the next list of items + *

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 Proximity Placement Group operation response along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} 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..da3023104b51a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ProximityPlacementGroupsImpl.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.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; + +public final class ProximityPlacementGroupsImpl implements ProximityPlacementGroups { + private static 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 Response deleteByResourceGroupWithResponse( + String resourceGroupName, String proximityPlacementGroupName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, proximityPlacementGroupName, context); + } + + public void deleteByResourceGroup(String resourceGroupName, String proximityPlacementGroupName) { + this.serviceClient().delete(resourceGroupName, proximityPlacementGroupName); + } + + 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 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 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.deleteByResourceGroupWithResponse(resourceGroupName, proximityPlacementGroupName, Context.NONE); + } + + 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.deleteByResourceGroupWithResponse(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..e05c15e361db1 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ResourceSkusClientImpl.java @@ -0,0 +1,342 @@ +// Copyright (c) Microsoft Corporation. All rights 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.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 { + /** 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") + public 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, + @QueryParam("includeExtendedLocations") String includeExtendedLocations, + @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. + * @param includeExtendedLocations To Include Extended Locations information or not in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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.Compute SKUs available for your Subscription along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String filter, String includeExtendedLocations) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-07-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + filter, + includeExtendedLocations, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the list of Microsoft.Compute SKUs available for your Subscription. + * + * @param filter The filter to apply on the operation. Only **location** filter is supported currently. + * @param includeExtendedLocations To Include Extended Locations information or not in the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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.Compute SKUs available for your Subscription along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String filter, String includeExtendedLocations, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-07-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + filter, + includeExtendedLocations, + 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. + * @param includeExtendedLocations To Include Extended Locations information or not in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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.Compute SKUs available for your Subscription as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String filter, String includeExtendedLocations) { + return new PagedFlux<>( + () -> listSinglePageAsync(filter, includeExtendedLocations), 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.Compute SKUs available for your Subscription as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + final String filter = null; + final String includeExtendedLocations = null; + return new PagedFlux<>( + () -> listSinglePageAsync(filter, includeExtendedLocations), 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 includeExtendedLocations To Include Extended Locations information or not in the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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.Compute SKUs available for your Subscription as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String filter, String includeExtendedLocations, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(filter, includeExtendedLocations, 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.Compute SKUs available for your Subscription as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + final String filter = null; + final String includeExtendedLocations = null; + return new PagedIterable<>(listAsync(filter, includeExtendedLocations)); + } + + /** + * 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 includeExtendedLocations To Include Extended Locations information or not in the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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.Compute SKUs available for your Subscription as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String filter, String includeExtendedLocations, Context context) { + return new PagedIterable<>(listAsync(filter, includeExtendedLocations, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Resource Skus operation response along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Resource Skus operation response along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/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..80176b634ce6e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ResourceSkusImpl.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.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; + +public final class ResourceSkusImpl implements ResourceSkus { + private static 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, String includeExtendedLocations, Context context) { + PagedIterable inner = this.serviceClient().list(filter, includeExtendedLocations, context); + return Utils.mapPage(inner, inner1 -> new ResourceSkuImpl(inner1, this.manager())); + } + + private ResourceSkusClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RestorePointCollectionImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RestorePointCollectionImpl.java new file mode 100644 index 0000000000000..9a6909c7f4b87 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RestorePointCollectionImpl.java @@ -0,0 +1,226 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.RestorePointCollectionInner; +import com.azure.resourcemanager.compute.generated.fluent.models.RestorePointInner; +import com.azure.resourcemanager.compute.generated.models.RestorePoint; +import com.azure.resourcemanager.compute.generated.models.RestorePointCollection; +import com.azure.resourcemanager.compute.generated.models.RestorePointCollectionExpandOptions; +import com.azure.resourcemanager.compute.generated.models.RestorePointCollectionSourceProperties; +import com.azure.resourcemanager.compute.generated.models.RestorePointCollectionUpdate; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public final class RestorePointCollectionImpl + implements RestorePointCollection, RestorePointCollection.Definition, RestorePointCollection.Update { + private RestorePointCollectionInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public RestorePointCollectionSourceProperties source() { + return this.innerModel().source(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public String restorePointCollectionId() { + return this.innerModel().restorePointCollectionId(); + } + + public List restorePoints() { + List inner = this.innerModel().restorePoints(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new RestorePointImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public RestorePointCollectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String restorePointCollectionName; + + private RestorePointCollectionUpdate updateParameters; + + public RestorePointCollectionImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public RestorePointCollection create() { + this.innerObject = + serviceManager + .serviceClient() + .getRestorePointCollections() + .createOrUpdateWithResponse( + resourceGroupName, restorePointCollectionName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public RestorePointCollection create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getRestorePointCollections() + .createOrUpdateWithResponse(resourceGroupName, restorePointCollectionName, this.innerModel(), context) + .getValue(); + return this; + } + + RestorePointCollectionImpl(String name, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = new RestorePointCollectionInner(); + this.serviceManager = serviceManager; + this.restorePointCollectionName = name; + } + + public RestorePointCollectionImpl update() { + this.updateParameters = new RestorePointCollectionUpdate(); + return this; + } + + public RestorePointCollection apply() { + this.innerObject = + serviceManager + .serviceClient() + .getRestorePointCollections() + .updateWithResponse(resourceGroupName, restorePointCollectionName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public RestorePointCollection apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getRestorePointCollections() + .updateWithResponse(resourceGroupName, restorePointCollectionName, updateParameters, context) + .getValue(); + return this; + } + + RestorePointCollectionImpl( + RestorePointCollectionInner innerObject, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.restorePointCollectionName = Utils.getValueFromIdByName(innerObject.id(), "restorePointCollections"); + } + + public RestorePointCollection refresh() { + RestorePointCollectionExpandOptions localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getRestorePointCollections() + .getByResourceGroupWithResponse( + resourceGroupName, restorePointCollectionName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public RestorePointCollection refresh(Context context) { + RestorePointCollectionExpandOptions localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getRestorePointCollections() + .getByResourceGroupWithResponse(resourceGroupName, restorePointCollectionName, localExpand, context) + .getValue(); + return this; + } + + public RestorePointCollectionImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public RestorePointCollectionImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public RestorePointCollectionImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public RestorePointCollectionImpl withSource(RestorePointCollectionSourceProperties source) { + if (isInCreateMode()) { + this.innerModel().withSource(source); + return this; + } else { + this.updateParameters.withSource(source); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RestorePointCollectionsClientImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RestorePointCollectionsClientImpl.java new file mode 100644 index 0000000000000..dcdf5812ce39c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RestorePointCollectionsClientImpl.java @@ -0,0 +1,1424 @@ +// Copyright (c) Microsoft Corporation. All rights 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.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.compute.generated.fluent.RestorePointCollectionsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.RestorePointCollectionInner; +import com.azure.resourcemanager.compute.generated.models.ApiErrorException; +import com.azure.resourcemanager.compute.generated.models.RestorePointCollectionExpandOptions; +import com.azure.resourcemanager.compute.generated.models.RestorePointCollectionListResult; +import com.azure.resourcemanager.compute.generated.models.RestorePointCollectionUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in RestorePointCollectionsClient. */ +public final class RestorePointCollectionsClientImpl implements RestorePointCollectionsClient { + /** The proxy service used to perform REST calls. */ + private final RestorePointCollectionsService service; + + /** The service client containing this operation class. */ + private final ComputeManagementClientImpl client; + + /** + * Initializes an instance of RestorePointCollectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RestorePointCollectionsClientImpl(ComputeManagementClientImpl client) { + this.service = + RestProxy + .create(RestorePointCollectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ComputeManagementClientRestorePointCollections to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ComputeManagementCli") + public interface RestorePointCollectionsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("restorePointCollectionName") String restorePointCollectionName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") RestorePointCollectionInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("restorePointCollectionName") String restorePointCollectionName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") RestorePointCollectionUpdate parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("restorePointCollectionName") String restorePointCollectionName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("restorePointCollectionName") String restorePointCollectionName, + @QueryParam("$expand") RestorePointCollectionExpandOptions expand, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/restorePointCollections") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> listAllNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * The operation to create or update the restore point collection. Please refer to https://aka.ms/RestorePoints for + * more details. When updating a restore point collection, only tags may be modified. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param parameters Parameters supplied to the Create or Update restore point collection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return create or update Restore Point collection parameters along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String restorePointCollectionName, RestorePointCollectionInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (restorePointCollectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter restorePointCollectionName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + restorePointCollectionName, + apiVersion, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to create or update the restore point collection. Please refer to https://aka.ms/RestorePoints for + * more details. When updating a restore point collection, only tags may be modified. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param parameters Parameters supplied to the Create or Update restore point collection operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return create or update Restore Point collection parameters along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String restorePointCollectionName, + RestorePointCollectionInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (restorePointCollectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter restorePointCollectionName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + restorePointCollectionName, + apiVersion, + parameters, + accept, + context); + } + + /** + * The operation to create or update the restore point collection. Please refer to https://aka.ms/RestorePoints for + * more details. When updating a restore point collection, only tags may be modified. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param parameters Parameters supplied to the Create or Update restore point collection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return create or update Restore Point collection parameters on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String restorePointCollectionName, RestorePointCollectionInner parameters) { + return createOrUpdateWithResponseAsync(resourceGroupName, restorePointCollectionName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * The operation to create or update the restore point collection. Please refer to https://aka.ms/RestorePoints for + * more details. When updating a restore point collection, only tags may be modified. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param parameters Parameters supplied to the Create or Update restore point collection operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return create or update Restore Point collection parameters along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String restorePointCollectionName, + RestorePointCollectionInner parameters, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, restorePointCollectionName, parameters, context) + .block(); + } + + /** + * The operation to create or update the restore point collection. Please refer to https://aka.ms/RestorePoints for + * more details. When updating a restore point collection, only tags may be modified. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param parameters Parameters supplied to the Create or Update restore point collection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return create or update Restore Point collection parameters. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RestorePointCollectionInner createOrUpdate( + String resourceGroupName, String restorePointCollectionName, RestorePointCollectionInner parameters) { + return createOrUpdateWithResponse(resourceGroupName, restorePointCollectionName, parameters, Context.NONE) + .getValue(); + } + + /** + * The operation to update the restore point collection. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param parameters Parameters supplied to the Update restore point collection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return create or update Restore Point collection parameters along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String restorePointCollectionName, RestorePointCollectionUpdate parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (restorePointCollectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter restorePointCollectionName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + restorePointCollectionName, + apiVersion, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to update the restore point collection. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param parameters Parameters supplied to the Update restore point collection operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return create or update Restore Point collection parameters along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String restorePointCollectionName, + RestorePointCollectionUpdate parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (restorePointCollectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter restorePointCollectionName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + restorePointCollectionName, + apiVersion, + parameters, + accept, + context); + } + + /** + * The operation to update the restore point collection. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param parameters Parameters supplied to the Update restore point collection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return create or update Restore Point collection parameters on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String restorePointCollectionName, RestorePointCollectionUpdate parameters) { + return updateWithResponseAsync(resourceGroupName, restorePointCollectionName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * The operation to update the restore point collection. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param parameters Parameters supplied to the Update restore point collection operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return create or update Restore Point collection parameters along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String restorePointCollectionName, + RestorePointCollectionUpdate parameters, + Context context) { + return updateWithResponseAsync(resourceGroupName, restorePointCollectionName, parameters, context).block(); + } + + /** + * The operation to update the restore point collection. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param parameters Parameters supplied to the Update restore point collection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return create or update Restore Point collection parameters. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RestorePointCollectionInner update( + String resourceGroupName, String restorePointCollectionName, RestorePointCollectionUpdate parameters) { + return updateWithResponse(resourceGroupName, restorePointCollectionName, parameters, Context.NONE).getValue(); + } + + /** + * The operation to delete the restore point collection. This operation will also delete all the contained restore + * points. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the Restore Point Collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String restorePointCollectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (restorePointCollectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter restorePointCollectionName is required and cannot be null.")); + } + final String apiVersion = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + restorePointCollectionName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to delete the restore point collection. This operation will also delete all the contained restore + * points. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the Restore Point Collection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String restorePointCollectionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (restorePointCollectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter restorePointCollectionName is required and cannot be null.")); + } + final String apiVersion = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + restorePointCollectionName, + apiVersion, + accept, + context); + } + + /** + * The operation to delete the restore point collection. This operation will also delete all the contained restore + * points. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the Restore Point Collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String restorePointCollectionName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, restorePointCollectionName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * The operation to delete the restore point collection. This operation will also delete all the contained restore + * points. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the Restore Point Collection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String restorePointCollectionName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, restorePointCollectionName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * The operation to delete the restore point collection. This operation will also delete all the contained restore + * points. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the Restore Point Collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String restorePointCollectionName) { + return this.beginDeleteAsync(resourceGroupName, restorePointCollectionName).getSyncPoller(); + } + + /** + * The operation to delete the restore point collection. This operation will also delete all the contained restore + * points. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the Restore Point Collection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String restorePointCollectionName, Context context) { + return this.beginDeleteAsync(resourceGroupName, restorePointCollectionName, context).getSyncPoller(); + } + + /** + * The operation to delete the restore point collection. This operation will also delete all the contained restore + * points. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the Restore Point Collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String restorePointCollectionName) { + return beginDeleteAsync(resourceGroupName, restorePointCollectionName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to delete the restore point collection. This operation will also delete all the contained restore + * points. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the Restore Point Collection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String restorePointCollectionName, Context context) { + return beginDeleteAsync(resourceGroupName, restorePointCollectionName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to delete the restore point collection. This operation will also delete all the contained restore + * points. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the Restore Point Collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String restorePointCollectionName) { + deleteAsync(resourceGroupName, restorePointCollectionName).block(); + } + + /** + * The operation to delete the restore point collection. This operation will also delete all the contained restore + * points. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the Restore Point Collection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String restorePointCollectionName, Context context) { + deleteAsync(resourceGroupName, restorePointCollectionName, context).block(); + } + + /** + * The operation to get the restore point collection. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param expand The expand expression to apply on the operation. If expand=restorePoints, server will return all + * contained restore points in the restorePointCollection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return create or update Restore Point collection parameters along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String restorePointCollectionName, RestorePointCollectionExpandOptions expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (restorePointCollectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter restorePointCollectionName is required and cannot be null.")); + } + final String apiVersion = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + restorePointCollectionName, + expand, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to get the restore point collection. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param expand The expand expression to apply on the operation. If expand=restorePoints, server will return all + * contained restore points in the restorePointCollection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return create or update Restore Point collection parameters along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, + String restorePointCollectionName, + RestorePointCollectionExpandOptions expand, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (restorePointCollectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter restorePointCollectionName is required and cannot be null.")); + } + final String apiVersion = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + restorePointCollectionName, + expand, + apiVersion, + accept, + context); + } + + /** + * The operation to get the restore point collection. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return create or update Restore Point collection parameters on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String restorePointCollectionName) { + final RestorePointCollectionExpandOptions expand = null; + return getByResourceGroupWithResponseAsync(resourceGroupName, restorePointCollectionName, expand) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * The operation to get the restore point collection. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param expand The expand expression to apply on the operation. If expand=restorePoints, server will return all + * contained restore points in the restorePointCollection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return create or update Restore Point collection parameters along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, + String restorePointCollectionName, + RestorePointCollectionExpandOptions expand, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, restorePointCollectionName, expand, context) + .block(); + } + + /** + * The operation to get the restore point collection. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return create or update Restore Point collection parameters. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RestorePointCollectionInner getByResourceGroup(String resourceGroupName, String restorePointCollectionName) { + final RestorePointCollectionExpandOptions expand = null; + return getByResourceGroupWithResponse(resourceGroupName, restorePointCollectionName, expand, Context.NONE) + .getValue(); + } + + /** + * Gets the list of restore point collections in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of restore point collections in a resource group along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String apiVersion = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the list of restore point collections in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of restore point collections in a resource group along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String apiVersion = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets the list of restore point collections in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of restore point collections in a resource group as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets the list of restore point collections in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of restore point collections in a resource group as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the list of restore point collections in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of restore point collections in a resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets the list of restore point collections in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of restore point collections in a resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets the list of restore point collections in the subscription. Use nextLink property in the response to get the + * next page of restore point collections. Do this till nextLink is not null to fetch all the restore point + * collections. + * + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of restore point collections in the subscription along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the list of restore point collections in the subscription. Use nextLink property in the response to get the + * next page of restore point collections. Do this till nextLink is not null to fetch all the restore point + * collections. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of restore point collections in the subscription along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets the list of restore point collections in the subscription. Use nextLink property in the response to get the + * next page of restore point collections. Do this till nextLink is not null to fetch all the restore point + * collections. + * + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of restore point collections in the subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); + } + + /** + * Gets the list of restore point collections in the subscription. Use nextLink property in the response to get the + * next page of restore point collections. Do this till nextLink is not null to fetch all the restore point + * collections. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of restore point collections in the subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the list of restore point collections in the subscription. Use nextLink property in the response to get the + * next page of restore point collections. Do this till nextLink is not null to fetch all the restore point + * collections. + * + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of restore point collections in the subscription as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets the list of restore point collections in the subscription. Use nextLink property in the response to get the + * next page of restore point collections. Do this till nextLink is not null to fetch all the restore point + * collections. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of restore point collections in the subscription as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List restore point collection operation response along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List restore point collection operation response along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List restore point collection operation response along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listAllNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List restore point collection operation response along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listAllNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RestorePointCollectionsImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RestorePointCollectionsImpl.java new file mode 100644 index 0000000000000..6000fcc8b750d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RestorePointCollectionsImpl.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.RestorePointCollectionsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.RestorePointCollectionInner; +import com.azure.resourcemanager.compute.generated.models.RestorePointCollection; +import com.azure.resourcemanager.compute.generated.models.RestorePointCollectionExpandOptions; +import com.azure.resourcemanager.compute.generated.models.RestorePointCollections; + +public final class RestorePointCollectionsImpl implements RestorePointCollections { + private static final ClientLogger LOGGER = new ClientLogger(RestorePointCollectionsImpl.class); + + private final RestorePointCollectionsClient innerClient; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + public RestorePointCollectionsImpl( + RestorePointCollectionsClient innerClient, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String restorePointCollectionName) { + this.serviceClient().delete(resourceGroupName, restorePointCollectionName); + } + + public void delete(String resourceGroupName, String restorePointCollectionName, Context context) { + this.serviceClient().delete(resourceGroupName, restorePointCollectionName, context); + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, + String restorePointCollectionName, + RestorePointCollectionExpandOptions expand, + Context context) { + Response inner = + this + .serviceClient() + .getByResourceGroupWithResponse(resourceGroupName, restorePointCollectionName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RestorePointCollectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RestorePointCollection getByResourceGroup(String resourceGroupName, String restorePointCollectionName) { + RestorePointCollectionInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, restorePointCollectionName); + if (inner != null) { + return new RestorePointCollectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new RestorePointCollectionImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new RestorePointCollectionImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new RestorePointCollectionImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new RestorePointCollectionImpl(inner1, this.manager())); + } + + public RestorePointCollection getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String restorePointCollectionName = Utils.getValueFromIdByName(id, "restorePointCollections"); + if (restorePointCollectionName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'restorePointCollections'.", + id))); + } + RestorePointCollectionExpandOptions localExpand = null; + return this + .getByResourceGroupWithResponse(resourceGroupName, restorePointCollectionName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse( + String id, RestorePointCollectionExpandOptions expand, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String restorePointCollectionName = Utils.getValueFromIdByName(id, "restorePointCollections"); + if (restorePointCollectionName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'restorePointCollections'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, restorePointCollectionName, expand, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String restorePointCollectionName = Utils.getValueFromIdByName(id, "restorePointCollections"); + if (restorePointCollectionName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'restorePointCollections'.", + id))); + } + this.delete(resourceGroupName, restorePointCollectionName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String restorePointCollectionName = Utils.getValueFromIdByName(id, "restorePointCollections"); + if (restorePointCollectionName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'restorePointCollections'.", + id))); + } + this.delete(resourceGroupName, restorePointCollectionName, context); + } + + private RestorePointCollectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } + + public RestorePointCollectionImpl define(String name) { + return new RestorePointCollectionImpl(name, this.manager()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RestorePointImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RestorePointImpl.java new file mode 100644 index 0000000000000..1158a914bb540 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RestorePointImpl.java @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.RestorePointInner; +import com.azure.resourcemanager.compute.generated.models.ApiEntityReference; +import com.azure.resourcemanager.compute.generated.models.ConsistencyModeTypes; +import com.azure.resourcemanager.compute.generated.models.RestorePoint; +import com.azure.resourcemanager.compute.generated.models.RestorePointExpandOptions; +import com.azure.resourcemanager.compute.generated.models.RestorePointInstanceView; +import com.azure.resourcemanager.compute.generated.models.RestorePointSourceMetadata; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; + +public final class RestorePointImpl implements RestorePoint, RestorePoint.Definition { + private RestorePointInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + RestorePointImpl( + RestorePointInner innerObject, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public List excludeDisks() { + List inner = this.innerModel().excludeDisks(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public RestorePointSourceMetadata sourceMetadata() { + return this.innerModel().sourceMetadata(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public ConsistencyModeTypes consistencyMode() { + return this.innerModel().consistencyMode(); + } + + public OffsetDateTime timeCreated() { + return this.innerModel().timeCreated(); + } + + public ApiEntityReference sourceRestorePoint() { + return this.innerModel().sourceRestorePoint(); + } + + public RestorePointInstanceView instanceView() { + return this.innerModel().instanceView(); + } + + public RestorePointInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String restorePointCollectionName; + + private String restorePointName; + + public RestorePointImpl withExistingRestorePointCollection( + String resourceGroupName, String restorePointCollectionName) { + this.resourceGroupName = resourceGroupName; + this.restorePointCollectionName = restorePointCollectionName; + return this; + } + + public RestorePoint create() { + this.innerObject = + serviceManager + .serviceClient() + .getRestorePoints() + .create( + resourceGroupName, restorePointCollectionName, restorePointName, this.innerModel(), Context.NONE); + return this; + } + + public RestorePoint create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getRestorePoints() + .create(resourceGroupName, restorePointCollectionName, restorePointName, this.innerModel(), context); + return this; + } + + RestorePointImpl(String name, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = new RestorePointInner(); + this.serviceManager = serviceManager; + this.restorePointName = name; + } + + public RestorePoint refresh() { + RestorePointExpandOptions localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getRestorePoints() + .getWithResponse( + resourceGroupName, restorePointCollectionName, restorePointName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public RestorePoint refresh(Context context) { + RestorePointExpandOptions localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getRestorePoints() + .getWithResponse(resourceGroupName, restorePointCollectionName, restorePointName, localExpand, context) + .getValue(); + return this; + } + + public RestorePointImpl withExcludeDisks(List excludeDisks) { + this.innerModel().withExcludeDisks(excludeDisks); + return this; + } + + public RestorePointImpl withSourceMetadata(RestorePointSourceMetadata sourceMetadata) { + this.innerModel().withSourceMetadata(sourceMetadata); + return this; + } + + public RestorePointImpl withConsistencyMode(ConsistencyModeTypes consistencyMode) { + this.innerModel().withConsistencyMode(consistencyMode); + return this; + } + + public RestorePointImpl withTimeCreated(OffsetDateTime timeCreated) { + this.innerModel().withTimeCreated(timeCreated); + return this; + } + + public RestorePointImpl withSourceRestorePoint(ApiEntityReference sourceRestorePoint) { + this.innerModel().withSourceRestorePoint(sourceRestorePoint); + return this; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RestorePointsClientImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RestorePointsClientImpl.java new file mode 100644 index 0000000000000..c89e8be8cdf61 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RestorePointsClientImpl.java @@ -0,0 +1,902 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.compute.generated.fluent.RestorePointsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.RestorePointInner; +import com.azure.resourcemanager.compute.generated.models.ApiErrorException; +import com.azure.resourcemanager.compute.generated.models.RestorePointExpandOptions; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in RestorePointsClient. */ +public final class RestorePointsClientImpl implements RestorePointsClient { + /** The proxy service used to perform REST calls. */ + private final RestorePointsService service; + + /** The service client containing this operation class. */ + private final ComputeManagementClientImpl client; + + /** + * Initializes an instance of RestorePointsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RestorePointsClientImpl(ComputeManagementClientImpl client) { + this.service = + RestProxy.create(RestorePointsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ComputeManagementClientRestorePoints to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ComputeManagementCli") + public interface RestorePointsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{restorePointName}") + @ExpectedResponses({201}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("restorePointCollectionName") String restorePointCollectionName, + @PathParam("restorePointName") String restorePointName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") RestorePointInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{restorePointName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("restorePointCollectionName") String restorePointCollectionName, + @PathParam("restorePointName") String restorePointName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{restorePointName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("restorePointCollectionName") String restorePointCollectionName, + @PathParam("restorePointName") String restorePointName, + @QueryParam("$expand") RestorePointExpandOptions expand, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * The operation to create the restore point. Updating properties of an existing restore point is not allowed. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param restorePointName The name of the restore point. + * @param parameters Parameters supplied to the Create restore point operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return restore Point details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String restorePointCollectionName, + String restorePointName, + RestorePointInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (restorePointCollectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter restorePointCollectionName is required and cannot be null.")); + } + if (restorePointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter restorePointName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + restorePointCollectionName, + restorePointName, + apiVersion, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to create the restore point. Updating properties of an existing restore point is not allowed. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param restorePointName The name of the restore point. + * @param parameters Parameters supplied to the Create restore point operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return restore Point details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String restorePointCollectionName, + String restorePointName, + RestorePointInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (restorePointCollectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter restorePointCollectionName is required and cannot be null.")); + } + if (restorePointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter restorePointName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + restorePointCollectionName, + restorePointName, + apiVersion, + parameters, + accept, + context); + } + + /** + * The operation to create the restore point. Updating properties of an existing restore point is not allowed. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param restorePointName The name of the restore point. + * @param parameters Parameters supplied to the Create restore point operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of restore Point details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RestorePointInner> beginCreateAsync( + String resourceGroupName, + String restorePointCollectionName, + String restorePointName, + RestorePointInner parameters) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, restorePointCollectionName, restorePointName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + RestorePointInner.class, + RestorePointInner.class, + this.client.getContext()); + } + + /** + * The operation to create the restore point. Updating properties of an existing restore point is not allowed. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param restorePointName The name of the restore point. + * @param parameters Parameters supplied to the Create restore point operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of restore Point details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RestorePointInner> beginCreateAsync( + String resourceGroupName, + String restorePointCollectionName, + String restorePointName, + RestorePointInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync( + resourceGroupName, restorePointCollectionName, restorePointName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), RestorePointInner.class, RestorePointInner.class, context); + } + + /** + * The operation to create the restore point. Updating properties of an existing restore point is not allowed. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param restorePointName The name of the restore point. + * @param parameters Parameters supplied to the Create restore point operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of restore Point details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RestorePointInner> beginCreate( + String resourceGroupName, + String restorePointCollectionName, + String restorePointName, + RestorePointInner parameters) { + return this + .beginCreateAsync(resourceGroupName, restorePointCollectionName, restorePointName, parameters) + .getSyncPoller(); + } + + /** + * The operation to create the restore point. Updating properties of an existing restore point is not allowed. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param restorePointName The name of the restore point. + * @param parameters Parameters supplied to the Create restore point operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of restore Point details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RestorePointInner> beginCreate( + String resourceGroupName, + String restorePointCollectionName, + String restorePointName, + RestorePointInner parameters, + Context context) { + return this + .beginCreateAsync(resourceGroupName, restorePointCollectionName, restorePointName, parameters, context) + .getSyncPoller(); + } + + /** + * The operation to create the restore point. Updating properties of an existing restore point is not allowed. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param restorePointName The name of the restore point. + * @param parameters Parameters supplied to the Create restore point operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return restore Point details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String restorePointCollectionName, + String restorePointName, + RestorePointInner parameters) { + return beginCreateAsync(resourceGroupName, restorePointCollectionName, restorePointName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to create the restore point. Updating properties of an existing restore point is not allowed. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param restorePointName The name of the restore point. + * @param parameters Parameters supplied to the Create restore point operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return restore Point details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String restorePointCollectionName, + String restorePointName, + RestorePointInner parameters, + Context context) { + return beginCreateAsync(resourceGroupName, restorePointCollectionName, restorePointName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to create the restore point. Updating properties of an existing restore point is not allowed. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param restorePointName The name of the restore point. + * @param parameters Parameters supplied to the Create restore point operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return restore Point details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RestorePointInner create( + String resourceGroupName, + String restorePointCollectionName, + String restorePointName, + RestorePointInner parameters) { + return createAsync(resourceGroupName, restorePointCollectionName, restorePointName, parameters).block(); + } + + /** + * The operation to create the restore point. Updating properties of an existing restore point is not allowed. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param restorePointName The name of the restore point. + * @param parameters Parameters supplied to the Create restore point operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return restore Point details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RestorePointInner create( + String resourceGroupName, + String restorePointCollectionName, + String restorePointName, + RestorePointInner parameters, + Context context) { + return createAsync(resourceGroupName, restorePointCollectionName, restorePointName, parameters, context) + .block(); + } + + /** + * The operation to delete the restore point. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the Restore Point Collection. + * @param restorePointName The name of the restore point. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String restorePointCollectionName, String restorePointName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (restorePointCollectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter restorePointCollectionName is required and cannot be null.")); + } + if (restorePointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter restorePointName is required and cannot be null.")); + } + final String apiVersion = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + restorePointCollectionName, + restorePointName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to delete the restore point. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the Restore Point Collection. + * @param restorePointName The name of the restore point. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String restorePointCollectionName, String restorePointName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (restorePointCollectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter restorePointCollectionName is required and cannot be null.")); + } + if (restorePointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter restorePointName is required and cannot be null.")); + } + final String apiVersion = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + restorePointCollectionName, + restorePointName, + apiVersion, + accept, + context); + } + + /** + * The operation to delete the restore point. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the Restore Point Collection. + * @param restorePointName The name of the restore point. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String restorePointCollectionName, String restorePointName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, restorePointCollectionName, restorePointName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * The operation to delete the restore point. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the Restore Point Collection. + * @param restorePointName The name of the restore point. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String restorePointCollectionName, String restorePointName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, restorePointCollectionName, restorePointName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * The operation to delete the restore point. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the Restore Point Collection. + * @param restorePointName The name of the restore point. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String restorePointCollectionName, String restorePointName) { + return this.beginDeleteAsync(resourceGroupName, restorePointCollectionName, restorePointName).getSyncPoller(); + } + + /** + * The operation to delete the restore point. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the Restore Point Collection. + * @param restorePointName The name of the restore point. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String restorePointCollectionName, String restorePointName, Context context) { + return this + .beginDeleteAsync(resourceGroupName, restorePointCollectionName, restorePointName, context) + .getSyncPoller(); + } + + /** + * The operation to delete the restore point. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the Restore Point Collection. + * @param restorePointName The name of the restore point. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String restorePointCollectionName, String restorePointName) { + return beginDeleteAsync(resourceGroupName, restorePointCollectionName, restorePointName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to delete the restore point. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the Restore Point Collection. + * @param restorePointName The name of the restore point. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String restorePointCollectionName, String restorePointName, Context context) { + return beginDeleteAsync(resourceGroupName, restorePointCollectionName, restorePointName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to delete the restore point. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the Restore Point Collection. + * @param restorePointName The name of the restore point. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String restorePointCollectionName, String restorePointName) { + deleteAsync(resourceGroupName, restorePointCollectionName, restorePointName).block(); + } + + /** + * The operation to delete the restore point. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the Restore Point Collection. + * @param restorePointName The name of the restore point. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, String restorePointCollectionName, String restorePointName, Context context) { + deleteAsync(resourceGroupName, restorePointCollectionName, restorePointName, context).block(); + } + + /** + * The operation to get the restore point. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param restorePointName The name of the restore point. + * @param expand The expand expression to apply on the operation. 'InstanceView' retrieves information about the + * run-time state of a restore point. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return restore Point details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String restorePointCollectionName, + String restorePointName, + RestorePointExpandOptions expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (restorePointCollectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter restorePointCollectionName is required and cannot be null.")); + } + if (restorePointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter restorePointName is required and cannot be null.")); + } + final String apiVersion = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + restorePointCollectionName, + restorePointName, + expand, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to get the restore point. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param restorePointName The name of the restore point. + * @param expand The expand expression to apply on the operation. 'InstanceView' retrieves information about the + * run-time state of a restore point. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return restore Point details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String restorePointCollectionName, + String restorePointName, + RestorePointExpandOptions expand, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (restorePointCollectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter restorePointCollectionName is required and cannot be null.")); + } + if (restorePointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter restorePointName is required and cannot be null.")); + } + final String apiVersion = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + restorePointCollectionName, + restorePointName, + expand, + apiVersion, + accept, + context); + } + + /** + * The operation to get the restore point. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param restorePointName The name of the restore point. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return restore Point details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String restorePointCollectionName, String restorePointName) { + final RestorePointExpandOptions expand = null; + return getWithResponseAsync(resourceGroupName, restorePointCollectionName, restorePointName, expand) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * The operation to get the restore point. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param restorePointName The name of the restore point. + * @param expand The expand expression to apply on the operation. 'InstanceView' retrieves information about the + * run-time state of a restore point. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return restore Point details along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String restorePointCollectionName, + String restorePointName, + RestorePointExpandOptions expand, + Context context) { + return getWithResponseAsync(resourceGroupName, restorePointCollectionName, restorePointName, expand, context) + .block(); + } + + /** + * The operation to get the restore point. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param restorePointName The name of the restore point. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return restore Point details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RestorePointInner get(String resourceGroupName, String restorePointCollectionName, String restorePointName) { + final RestorePointExpandOptions expand = null; + return getWithResponse(resourceGroupName, restorePointCollectionName, restorePointName, expand, Context.NONE) + .getValue(); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RestorePointsImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RestorePointsImpl.java new file mode 100644 index 0000000000000..c43ed138ace13 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RestorePointsImpl.java @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.RestorePointsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.RestorePointInner; +import com.azure.resourcemanager.compute.generated.models.RestorePoint; +import com.azure.resourcemanager.compute.generated.models.RestorePointExpandOptions; +import com.azure.resourcemanager.compute.generated.models.RestorePoints; + +public final class RestorePointsImpl implements RestorePoints { + private static final ClientLogger LOGGER = new ClientLogger(RestorePointsImpl.class); + + private final RestorePointsClient innerClient; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + public RestorePointsImpl( + RestorePointsClient innerClient, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void delete(String resourceGroupName, String restorePointCollectionName, String restorePointName) { + this.serviceClient().delete(resourceGroupName, restorePointCollectionName, restorePointName); + } + + public void delete( + String resourceGroupName, String restorePointCollectionName, String restorePointName, Context context) { + this.serviceClient().delete(resourceGroupName, restorePointCollectionName, restorePointName, context); + } + + public Response getWithResponse( + String resourceGroupName, + String restorePointCollectionName, + String restorePointName, + RestorePointExpandOptions expand, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, restorePointCollectionName, restorePointName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RestorePointImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RestorePoint get(String resourceGroupName, String restorePointCollectionName, String restorePointName) { + RestorePointInner inner = + this.serviceClient().get(resourceGroupName, restorePointCollectionName, restorePointName); + if (inner != null) { + return new RestorePointImpl(inner, this.manager()); + } else { + return null; + } + } + + public RestorePoint getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String restorePointCollectionName = Utils.getValueFromIdByName(id, "restorePointCollections"); + if (restorePointCollectionName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'restorePointCollections'.", + id))); + } + String restorePointName = Utils.getValueFromIdByName(id, "restorePoints"); + if (restorePointName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'restorePoints'.", id))); + } + RestorePointExpandOptions localExpand = null; + return this + .getWithResponse(resourceGroupName, restorePointCollectionName, restorePointName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, RestorePointExpandOptions expand, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String restorePointCollectionName = Utils.getValueFromIdByName(id, "restorePointCollections"); + if (restorePointCollectionName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'restorePointCollections'.", + id))); + } + String restorePointName = Utils.getValueFromIdByName(id, "restorePoints"); + if (restorePointName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'restorePoints'.", id))); + } + return this.getWithResponse(resourceGroupName, restorePointCollectionName, restorePointName, expand, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String restorePointCollectionName = Utils.getValueFromIdByName(id, "restorePointCollections"); + if (restorePointCollectionName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'restorePointCollections'.", + id))); + } + String restorePointName = Utils.getValueFromIdByName(id, "restorePoints"); + if (restorePointName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'restorePoints'.", id))); + } + this.delete(resourceGroupName, restorePointCollectionName, restorePointName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String restorePointCollectionName = Utils.getValueFromIdByName(id, "restorePointCollections"); + if (restorePointCollectionName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'restorePointCollections'.", + id))); + } + String restorePointName = Utils.getValueFromIdByName(id, "restorePoints"); + if (restorePointName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'restorePoints'.", id))); + } + this.delete(resourceGroupName, restorePointCollectionName, restorePointName, context); + } + + private RestorePointsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } + + public RestorePointImpl define(String name) { + return new RestorePointImpl(name, this.manager()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RetrieveBootDiagnosticsDataResultImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RetrieveBootDiagnosticsDataResultImpl.java new file mode 100644 index 0000000000000..92ae008e28534 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RetrieveBootDiagnosticsDataResultImpl.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.resourcemanager.compute.generated.fluent.models.RetrieveBootDiagnosticsDataResultInner; +import com.azure.resourcemanager.compute.generated.models.RetrieveBootDiagnosticsDataResult; + +public final class RetrieveBootDiagnosticsDataResultImpl implements RetrieveBootDiagnosticsDataResult { + private RetrieveBootDiagnosticsDataResultInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + RetrieveBootDiagnosticsDataResultImpl( + RetrieveBootDiagnosticsDataResultInner innerObject, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String consoleScreenshotBlobUri() { + return this.innerModel().consoleScreenshotBlobUri(); + } + + public String serialConsoleLogBlobUri() { + return this.innerModel().serialConsoleLogBlobUri(); + } + + public RetrieveBootDiagnosticsDataResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RoleInstanceImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RoleInstanceImpl.java new file mode 100644 index 0000000000000..7162bf34c51f8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RoleInstanceImpl.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.resourcemanager.compute.generated.fluent.models.RoleInstanceInner; +import com.azure.resourcemanager.compute.generated.fluent.models.RoleInstancePropertiesInner; +import com.azure.resourcemanager.compute.generated.models.InstanceSku; +import com.azure.resourcemanager.compute.generated.models.RoleInstance; +import com.azure.resourcemanager.compute.generated.models.RoleInstanceProperties; +import java.util.Collections; +import java.util.Map; + +public final class RoleInstanceImpl implements RoleInstance { + private RoleInstanceInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + RoleInstanceImpl( + RoleInstanceInner innerObject, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public InstanceSku sku() { + return this.innerModel().sku(); + } + + public RoleInstanceProperties properties() { + RoleInstancePropertiesInner inner = this.innerModel().properties(); + if (inner != null) { + return new RoleInstancePropertiesImpl(inner, this.manager()); + } else { + return null; + } + } + + public RoleInstanceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RoleInstancePropertiesImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RoleInstancePropertiesImpl.java new file mode 100644 index 0000000000000..01cae7f0c0c0e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RoleInstancePropertiesImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.resourcemanager.compute.generated.fluent.models.RoleInstancePropertiesInner; +import com.azure.resourcemanager.compute.generated.fluent.models.RoleInstanceViewInner; +import com.azure.resourcemanager.compute.generated.models.RoleInstanceNetworkProfile; +import com.azure.resourcemanager.compute.generated.models.RoleInstanceProperties; +import com.azure.resourcemanager.compute.generated.models.RoleInstanceView; + +public final class RoleInstancePropertiesImpl implements RoleInstanceProperties { + private RoleInstancePropertiesInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + RoleInstancePropertiesImpl( + RoleInstancePropertiesInner innerObject, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public RoleInstanceNetworkProfile networkProfile() { + return this.innerModel().networkProfile(); + } + + public RoleInstanceView instanceView() { + RoleInstanceViewInner inner = this.innerModel().instanceView(); + if (inner != null) { + return new RoleInstanceViewImpl(inner, this.manager()); + } else { + return null; + } + } + + public RoleInstancePropertiesInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RoleInstanceViewImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RoleInstanceViewImpl.java new file mode 100644 index 0000000000000..8fb1b043a1576 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RoleInstanceViewImpl.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.resourcemanager.compute.generated.fluent.models.RoleInstanceViewInner; +import com.azure.resourcemanager.compute.generated.models.ResourceInstanceViewStatus; +import com.azure.resourcemanager.compute.generated.models.RoleInstanceView; +import java.util.Collections; +import java.util.List; + +public final class RoleInstanceViewImpl implements RoleInstanceView { + private RoleInstanceViewInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + RoleInstanceViewImpl( + RoleInstanceViewInner innerObject, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Integer platformUpdateDomain() { + return this.innerModel().platformUpdateDomain(); + } + + public Integer platformFaultDomain() { + return this.innerModel().platformFaultDomain(); + } + + public String privateId() { + return this.innerModel().privateId(); + } + + public List statuses() { + List inner = this.innerModel().statuses(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public RoleInstanceViewInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RollingUpgradeStatusInfoImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RollingUpgradeStatusInfoImpl.java new file mode 100644 index 0000000000000..0a5d024c3b198 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RollingUpgradeStatusInfoImpl.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.resourcemanager.compute.generated.fluent.models.RollingUpgradeStatusInfoInner; +import com.azure.resourcemanager.compute.generated.models.ApiError; +import com.azure.resourcemanager.compute.generated.models.RollingUpgradePolicy; +import com.azure.resourcemanager.compute.generated.models.RollingUpgradeProgressInfo; +import com.azure.resourcemanager.compute.generated.models.RollingUpgradeRunningStatus; +import com.azure.resourcemanager.compute.generated.models.RollingUpgradeStatusInfo; +import java.util.Collections; +import java.util.Map; + +public final class RollingUpgradeStatusInfoImpl implements RollingUpgradeStatusInfo { + private RollingUpgradeStatusInfoInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + RollingUpgradeStatusInfoImpl( + RollingUpgradeStatusInfoInner innerObject, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public RollingUpgradePolicy policy() { + return this.innerModel().policy(); + } + + public RollingUpgradeRunningStatus runningStatus() { + return this.innerModel().runningStatus(); + } + + public RollingUpgradeProgressInfo progress() { + return this.innerModel().progress(); + } + + public ApiError error() { + return this.innerModel().error(); + } + + public RollingUpgradeStatusInfoInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RunCommandDocumentBaseImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RunCommandDocumentBaseImpl.java new file mode 100644 index 0000000000000..8891dcb14b696 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RunCommandDocumentBaseImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.resourcemanager.compute.generated.fluent.models.RunCommandDocumentBaseInner; +import com.azure.resourcemanager.compute.generated.models.OperatingSystemTypes; +import com.azure.resourcemanager.compute.generated.models.RunCommandDocumentBase; + +public final class RunCommandDocumentBaseImpl implements RunCommandDocumentBase { + private RunCommandDocumentBaseInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + RunCommandDocumentBaseImpl( + RunCommandDocumentBaseInner innerObject, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String schema() { + return this.innerModel().schema(); + } + + public String id() { + return this.innerModel().id(); + } + + public OperatingSystemTypes osType() { + return this.innerModel().osType(); + } + + public String label() { + return this.innerModel().label(); + } + + public String description() { + return this.innerModel().description(); + } + + public RunCommandDocumentBaseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RunCommandDocumentImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RunCommandDocumentImpl.java new file mode 100644 index 0000000000000..c174d60199592 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RunCommandDocumentImpl.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.resourcemanager.compute.generated.fluent.models.RunCommandDocumentInner; +import com.azure.resourcemanager.compute.generated.models.OperatingSystemTypes; +import com.azure.resourcemanager.compute.generated.models.RunCommandDocument; +import com.azure.resourcemanager.compute.generated.models.RunCommandParameterDefinition; +import java.util.Collections; +import java.util.List; + +public final class RunCommandDocumentImpl implements RunCommandDocument { + private RunCommandDocumentInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + RunCommandDocumentImpl( + RunCommandDocumentInner innerObject, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String schema() { + return this.innerModel().schema(); + } + + public String id() { + return this.innerModel().id(); + } + + public OperatingSystemTypes osType() { + return this.innerModel().osType(); + } + + public String label() { + return this.innerModel().label(); + } + + public String description() { + return this.innerModel().description(); + } + + public List script() { + List inner = this.innerModel().script(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List parameters() { + List inner = this.innerModel().parameters(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public RunCommandDocumentInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RunCommandResultImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RunCommandResultImpl.java new file mode 100644 index 0000000000000..4afb8aa9655f6 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RunCommandResultImpl.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.resourcemanager.compute.generated.fluent.models.RunCommandResultInner; +import com.azure.resourcemanager.compute.generated.models.InstanceViewStatus; +import com.azure.resourcemanager.compute.generated.models.RunCommandResult; +import java.util.Collections; +import java.util.List; + +public final class RunCommandResultImpl implements RunCommandResult { + private RunCommandResultInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + RunCommandResultImpl( + RunCommandResultInner innerObject, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public RunCommandResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SharedGalleriesClientImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SharedGalleriesClientImpl.java new file mode 100644 index 0000000000000..9f2eddba48930 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SharedGalleriesClientImpl.java @@ -0,0 +1,503 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.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.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 { + /** 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") + public 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 = "2022-03-03"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + apiVersion, + sharedTo, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List shared galleries by subscription id or tenant id. + * + * @param location Resource location. + * @param sharedTo The query parameter to decide what shared galleries to fetch when doing listing operations. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Shared Galleries operation response along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 = "2022-03-03"; + 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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2022-03-03"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + galleryUniqueName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a shared gallery by subscription id or tenant id. + * + * @param location Resource location. + * @param galleryUniqueName The unique name of the Shared Gallery. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a shared gallery by subscription id or tenant id along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2022-03-03"; + 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String location, String galleryUniqueName) { + return getWithResponseAsync(location, galleryUniqueName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String location, String galleryUniqueName, Context context) { + return getWithResponseAsync(location, galleryUniqueName, context).block(); + } + + /** + * 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 getWithResponse(location, galleryUniqueName, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/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..d24f4519d5ed6 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SharedGalleriesImpl.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.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; + +public final class SharedGalleriesImpl implements SharedGalleries { + private static 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 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; + } + } + + 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; + } + } + + 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..6bc3e2f1825a9 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SharedGalleryImageImpl.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.resourcemanager.compute.generated.fluent.models.SharedGalleryImageInner; +import com.azure.resourcemanager.compute.generated.models.Architecture; +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 Architecture architecture() { + return this.innerModel().architecture(); + } + + public String privacyStatementUri() { + return this.innerModel().privacyStatementUri(); + } + + public String eula() { + return this.innerModel().eula(); + } + + 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..9df38bc0061e8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SharedGalleryImageVersionImpl.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.resourcemanager.compute.generated.fluent.models.SharedGalleryImageVersionInner; +import com.azure.resourcemanager.compute.generated.models.SharedGalleryImageVersion; +import com.azure.resourcemanager.compute.generated.models.SharedGalleryImageVersionStorageProfile; +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 Boolean excludeFromLatest() { + return this.innerModel().excludeFromLatest(); + } + + public SharedGalleryImageVersionStorageProfile storageProfile() { + return this.innerModel().storageProfile(); + } + + 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..c75a90a301e8d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SharedGalleryImageVersionsClientImpl.java @@ -0,0 +1,624 @@ +// Copyright (c) Microsoft Corporation. All rights 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.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 { + /** 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") + public 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 = "2022-03-03"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + apiVersion, + galleryUniqueName, + galleryImageName, + sharedTo, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List shared gallery image versions by subscription id or tenant id. + * + * @param location Resource location. + * @param galleryUniqueName The unique name of the Shared Gallery. + * @param galleryImageName The name of the Shared Gallery Image Definition from which the Image Versions are to be + * listed. + * @param sharedTo The query parameter to decide what shared galleries to fetch when doing listing operations. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Shared Gallery Image versions operation response along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 = "2022-03-03"; + 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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link + * PagedIterable}. + */ + @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 as paginated response with {@link + * PagedIterable}. + */ + @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2022-03-03"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + apiVersion, + galleryUniqueName, + galleryImageName, + galleryImageVersionName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a shared gallery image version by subscription id or tenant id. + * + * @param location Resource location. + * @param galleryUniqueName The unique name of the Shared Gallery. + * @param galleryImageName The name of the Shared Gallery Image Definition from which the Image Versions are to be + * listed. + * @param galleryImageVersionName The name of the gallery image version to be created. Needs to follow semantic + * version name pattern: The allowed characters are digit and period. Digits must be within the range of a + * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a shared gallery image version by subscription id or tenant id along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2022-03-03"; + 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String location, String galleryUniqueName, String galleryImageName, String galleryImageVersionName) { + return getWithResponseAsync(location, galleryUniqueName, galleryImageName, galleryImageVersionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @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 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 getWithResponse(location, galleryUniqueName, galleryImageName, galleryImageVersionName, Context.NONE) + .getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/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..ef387ef040640 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SharedGalleryImageVersionsImpl.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.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; + +public final class SharedGalleryImageVersionsImpl implements SharedGalleryImageVersions { + private static 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 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; + } + } + + 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; + } + } + + 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..8ee3fffd2d8e4 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SharedGalleryImagesClientImpl.java @@ -0,0 +1,552 @@ +// Copyright (c) Microsoft Corporation. All rights 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.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 { + /** 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") + public 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 = "2022-03-03"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + apiVersion, + galleryUniqueName, + sharedTo, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List shared gallery images by subscription id or tenant id. + * + * @param location Resource location. + * @param galleryUniqueName The unique name of the Shared Gallery. + * @param sharedTo The query parameter to decide what shared galleries to fetch when doing listing operations. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Shared Gallery Images operation response along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 = "2022-03-03"; + 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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2022-03-03"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + apiVersion, + galleryUniqueName, + galleryImageName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a shared gallery image by subscription id or tenant id. + * + * @param location Resource location. + * @param galleryUniqueName The unique name of the Shared Gallery. + * @param galleryImageName The name of the Shared Gallery Image Definition from which the Image Versions are to be + * listed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a shared gallery image by subscription id or tenant id along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2022-03-03"; + 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String location, String galleryUniqueName, String galleryImageName) { + return getWithResponseAsync(location, galleryUniqueName, galleryImageName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String location, String galleryUniqueName, String galleryImageName, Context context) { + return getWithResponseAsync(location, galleryUniqueName, galleryImageName, context).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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 getWithResponse(location, galleryUniqueName, galleryImageName, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/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..7f3301f230549 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SharedGalleryImagesImpl.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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; + +public final class SharedGalleryImagesImpl implements SharedGalleryImages { + private static 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 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; + } + } + + 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; + } + } + + 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..d68b19ac944ef --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SnapshotImpl.java @@ -0,0 +1,461 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.SnapshotInner; +import com.azure.resourcemanager.compute.generated.models.AccessUri; +import com.azure.resourcemanager.compute.generated.models.CopyCompletionError; +import com.azure.resourcemanager.compute.generated.models.CreationData; +import com.azure.resourcemanager.compute.generated.models.DataAccessAuthMode; +import com.azure.resourcemanager.compute.generated.models.DiskSecurityProfile; +import com.azure.resourcemanager.compute.generated.models.DiskState; +import com.azure.resourcemanager.compute.generated.models.Encryption; +import com.azure.resourcemanager.compute.generated.models.EncryptionSettingsCollection; +import com.azure.resourcemanager.compute.generated.models.ExtendedLocation; +import com.azure.resourcemanager.compute.generated.models.GrantAccessData; +import com.azure.resourcemanager.compute.generated.models.HyperVGeneration; +import com.azure.resourcemanager.compute.generated.models.NetworkAccessPolicy; +import com.azure.resourcemanager.compute.generated.models.OperatingSystemTypes; +import com.azure.resourcemanager.compute.generated.models.PublicNetworkAccess; +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 com.azure.resourcemanager.compute.generated.models.SupportedCapabilities; +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 SupportedCapabilities supportedCapabilities() { + return this.innerModel().supportedCapabilities(); + } + + 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 String incrementalSnapshotFamilyId() { + return this.innerModel().incrementalSnapshotFamilyId(); + } + + public Encryption encryption() { + return this.innerModel().encryption(); + } + + public NetworkAccessPolicy networkAccessPolicy() { + return this.innerModel().networkAccessPolicy(); + } + + public String diskAccessId() { + return this.innerModel().diskAccessId(); + } + + public DiskSecurityProfile securityProfile() { + return this.innerModel().securityProfile(); + } + + public Boolean supportsHibernation() { + return this.innerModel().supportsHibernation(); + } + + public PublicNetworkAccess publicNetworkAccess() { + return this.innerModel().publicNetworkAccess(); + } + + public Float completionPercent() { + return this.innerModel().completionPercent(); + } + + public CopyCompletionError copyCompletionError() { + return this.innerModel().copyCompletionError(); + } + + public DataAccessAuthMode dataAccessAuthMode() { + return this.innerModel().dataAccessAuthMode(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public SnapshotInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String snapshotName; + + private SnapshotUpdate updateSnapshot; + + public SnapshotImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Snapshot create() { + this.innerObject = + serviceManager + .serviceClient() + .getSnapshots() + .createOrUpdate(resourceGroupName, snapshotName, this.innerModel(), Context.NONE); + return this; + } + + public Snapshot create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSnapshots() + .createOrUpdate(resourceGroupName, snapshotName, this.innerModel(), context); + return this; + } + + SnapshotImpl(String name, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = new SnapshotInner(); + this.serviceManager = serviceManager; + this.snapshotName = name; + } + + public SnapshotImpl update() { + this.updateSnapshot = new SnapshotUpdate(); + return this; + } + + public Snapshot apply() { + this.innerObject = + serviceManager + .serviceClient() + .getSnapshots() + .update(resourceGroupName, snapshotName, updateSnapshot, Context.NONE); + return this; + } + + public Snapshot apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSnapshots() + .update(resourceGroupName, snapshotName, updateSnapshot, context); + return this; + } + + SnapshotImpl(SnapshotInner innerObject, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.snapshotName = Utils.getValueFromIdByName(innerObject.id(), "snapshots"); + } + + public Snapshot refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getSnapshots() + .getByResourceGroupWithResponse(resourceGroupName, snapshotName, Context.NONE) + .getValue(); + return this; + } + + public Snapshot refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSnapshots() + .getByResourceGroupWithResponse(resourceGroupName, snapshotName, context) + .getValue(); + return this; + } + + public AccessUri grantAccess(GrantAccessData grantAccessData) { + return serviceManager.snapshots().grantAccess(resourceGroupName, snapshotName, grantAccessData); + } + + public AccessUri grantAccess(GrantAccessData grantAccessData, Context context) { + return serviceManager.snapshots().grantAccess(resourceGroupName, snapshotName, grantAccessData, context); + } + + public void revokeAccess() { + serviceManager.snapshots().revokeAccess(resourceGroupName, snapshotName); + } + + public void revokeAccess(Context context) { + serviceManager.snapshots().revokeAccess(resourceGroupName, snapshotName, context); + } + + public SnapshotImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public SnapshotImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public SnapshotImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateSnapshot.withTags(tags); + return this; + } + } + + public SnapshotImpl withSku(SnapshotSku sku) { + if (isInCreateMode()) { + this.innerModel().withSku(sku); + return this; + } else { + this.updateSnapshot.withSku(sku); + return this; + } + } + + public SnapshotImpl withExtendedLocation(ExtendedLocation extendedLocation) { + this.innerModel().withExtendedLocation(extendedLocation); + return this; + } + + public SnapshotImpl withOsType(OperatingSystemTypes osType) { + if (isInCreateMode()) { + this.innerModel().withOsType(osType); + return this; + } else { + this.updateSnapshot.withOsType(osType); + return this; + } + } + + public SnapshotImpl withHyperVGeneration(HyperVGeneration hyperVGeneration) { + this.innerModel().withHyperVGeneration(hyperVGeneration); + return this; + } + + public SnapshotImpl withPurchasePlan(PurchasePlanAutoGenerated purchasePlan) { + this.innerModel().withPurchasePlan(purchasePlan); + return this; + } + + public SnapshotImpl withSupportedCapabilities(SupportedCapabilities supportedCapabilities) { + if (isInCreateMode()) { + this.innerModel().withSupportedCapabilities(supportedCapabilities); + return this; + } else { + this.updateSnapshot.withSupportedCapabilities(supportedCapabilities); + return this; + } + } + + public SnapshotImpl withCreationData(CreationData creationData) { + this.innerModel().withCreationData(creationData); + return this; + } + + public SnapshotImpl withDiskSizeGB(Integer diskSizeGB) { + if (isInCreateMode()) { + this.innerModel().withDiskSizeGB(diskSizeGB); + return this; + } else { + this.updateSnapshot.withDiskSizeGB(diskSizeGB); + return this; + } + } + + public SnapshotImpl withEncryptionSettingsCollection(EncryptionSettingsCollection encryptionSettingsCollection) { + if (isInCreateMode()) { + this.innerModel().withEncryptionSettingsCollection(encryptionSettingsCollection); + return this; + } else { + this.updateSnapshot.withEncryptionSettingsCollection(encryptionSettingsCollection); + return this; + } + } + + public SnapshotImpl withIncremental(Boolean incremental) { + this.innerModel().withIncremental(incremental); + return this; + } + + public SnapshotImpl withEncryption(Encryption encryption) { + if (isInCreateMode()) { + this.innerModel().withEncryption(encryption); + return this; + } else { + this.updateSnapshot.withEncryption(encryption); + return this; + } + } + + public SnapshotImpl withNetworkAccessPolicy(NetworkAccessPolicy networkAccessPolicy) { + if (isInCreateMode()) { + this.innerModel().withNetworkAccessPolicy(networkAccessPolicy); + return this; + } else { + this.updateSnapshot.withNetworkAccessPolicy(networkAccessPolicy); + return this; + } + } + + public SnapshotImpl withDiskAccessId(String diskAccessId) { + if (isInCreateMode()) { + this.innerModel().withDiskAccessId(diskAccessId); + return this; + } else { + this.updateSnapshot.withDiskAccessId(diskAccessId); + return this; + } + } + + public SnapshotImpl withSecurityProfile(DiskSecurityProfile securityProfile) { + this.innerModel().withSecurityProfile(securityProfile); + return this; + } + + public SnapshotImpl withSupportsHibernation(Boolean supportsHibernation) { + if (isInCreateMode()) { + this.innerModel().withSupportsHibernation(supportsHibernation); + return this; + } else { + this.updateSnapshot.withSupportsHibernation(supportsHibernation); + return this; + } + } + + public SnapshotImpl withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + if (isInCreateMode()) { + this.innerModel().withPublicNetworkAccess(publicNetworkAccess); + return this; + } else { + this.updateSnapshot.withPublicNetworkAccess(publicNetworkAccess); + return this; + } + } + + public SnapshotImpl withCompletionPercent(Float completionPercent) { + this.innerModel().withCompletionPercent(completionPercent); + return this; + } + + public SnapshotImpl withCopyCompletionError(CopyCompletionError copyCompletionError) { + this.innerModel().withCopyCompletionError(copyCompletionError); + return this; + } + + public SnapshotImpl withDataAccessAuthMode(DataAccessAuthMode dataAccessAuthMode) { + if (isInCreateMode()) { + this.innerModel().withDataAccessAuthMode(dataAccessAuthMode); + return this; + } else { + this.updateSnapshot.withDataAccessAuthMode(dataAccessAuthMode); + 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..a89e6012e7b56 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SnapshotsClientImpl.java @@ -0,0 +1,2164 @@ +// Copyright (c) Microsoft Corporation. All rights 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.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 { + /** 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") + public 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-07-02"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + snapshotName, + apiVersion, + snapshot, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name length is 80 + * characters. + * @param snapshot Snapshot object supplied in the body of the Put disk operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-07-02"; + 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 the {@link PollerFlux} for polling of snapshot resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + 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 the {@link PollerFlux} for polling of snapshot resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of snapshot resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SnapshotInner> beginCreateOrUpdate( + String resourceGroupName, String snapshotName, SnapshotInner snapshot) { + return this.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 the {@link SyncPoller} for polling of snapshot resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SnapshotInner> beginCreateOrUpdate( + String resourceGroupName, String snapshotName, SnapshotInner snapshot, Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-07-02"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + snapshotName, + apiVersion, + snapshot, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates (patches) a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name length is 80 + * characters. + * @param snapshot Snapshot object supplied in the body of the Patch snapshot operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-07-02"; + 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 the {@link PollerFlux} for polling of snapshot resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + 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 the {@link PollerFlux} for polling of snapshot resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of snapshot resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SnapshotInner> beginUpdate( + String resourceGroupName, String snapshotName, SnapshotUpdate snapshot) { + return this.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 the {@link SyncPoller} for polling of snapshot resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SnapshotInner> beginUpdate( + String resourceGroupName, String snapshotName, SnapshotUpdate snapshot, Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-07-02"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + snapshotName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets information about a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name length is 80 + * characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a snapshot along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-07-02"; + 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String snapshotName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, snapshotName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String snapshotName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, snapshotName, 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) + public SnapshotInner getByResourceGroup(String resourceGroupName, String snapshotName) { + return getByResourceGroupWithResponse(resourceGroupName, snapshotName, Context.NONE).getValue(); + } + + /** + * 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-07-02"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + snapshotName, + apiVersion, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name length is 80 + * characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-07-02"; + 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String snapshotName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String snapshotName, Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String apiVersion = "2022-07-02"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists snapshots under a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Snapshots operation response along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String apiVersion = "2022-07-02"; + 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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2022-07-02"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists snapshots under a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Snapshots operation response along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2022-07-02"; + 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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-07-02"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .grantAccess( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + snapshotName, + apiVersion, + grantAccessData, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Grants access to a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name length is 80 + * characters. + * @param grantAccessData Access data object supplied in the body of the get snapshot access operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a disk access SAS uri along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-07-02"; + 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 the {@link PollerFlux} for polling of a disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + 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 the {@link PollerFlux} for polling of a disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of a disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AccessUriInner> beginGrantAccess( + String resourceGroupName, String snapshotName, GrantAccessData grantAccessData) { + return this.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 the {@link SyncPoller} for polling of a disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AccessUriInner> beginGrantAccess( + String resourceGroupName, String snapshotName, GrantAccessData grantAccessData, Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-07-02"; + return FluxUtil + .withContext( + context -> + service + .revokeAccess( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + snapshotName, + apiVersion, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Revokes access to a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name length is 80 + * characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-07-02"; + 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRevokeAccess(String resourceGroupName, String snapshotName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRevokeAccess( + String resourceGroupName, String snapshotName, Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Snapshots operation response along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Snapshots operation response along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Snapshots operation response along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Snapshots operation response along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/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..45f8f9611e16e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SnapshotsImpl.java @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.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; + +public final class SnapshotsImpl implements Snapshots { + private static 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 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 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 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..7c98b46a033a0 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SshPublicKeyResourceImpl.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.Response; +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.SshPublicKeyResourceInner; +import com.azure.resourcemanager.compute.generated.models.SshPublicKeyGenerateKeyPairResult; +import com.azure.resourcemanager.compute.generated.models.SshPublicKeyResource; +import com.azure.resourcemanager.compute.generated.models.SshPublicKeyUpdateResource; +import java.util.Collections; +import java.util.Map; + +public final class SshPublicKeyResourceImpl + implements SshPublicKeyResource, SshPublicKeyResource.Definition, SshPublicKeyResource.Update { + private SshPublicKeyResourceInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String publicKey() { + return this.innerModel().publicKey(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + 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 Response generateKeyPairWithResponse(Context context) { + return serviceManager.sshPublicKeys().generateKeyPairWithResponse(resourceGroupName, sshPublicKeyName, context); + } + + public SshPublicKeyGenerateKeyPairResult generateKeyPair() { + return serviceManager.sshPublicKeys().generateKeyPair(resourceGroupName, sshPublicKeyName); + } + + 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..53fd0025ba02a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SshPublicKeysClientImpl.java @@ -0,0 +1,1429 @@ +// Copyright (c) Microsoft Corporation. All rights 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.util.Context; +import com.azure.core.util.FluxUtil; +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.ApiErrorException; +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 { + /** 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") + public interface SshPublicKeysService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/sshPublicKeys") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.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(ApiErrorException.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(ApiErrorException.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({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> delete( + @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( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.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(ApiErrorException.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(ApiErrorException.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(ApiErrorException.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 ApiErrorException thrown 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next + * page of SSH public keys. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2023-03-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 ApiErrorException thrown 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 as paginated response with {@link PagedFlux}. + */ + @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 ApiErrorException thrown 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 as paginated response with {@link PagedFlux}. + */ + @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 ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + @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 ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + @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 ApiErrorException thrown 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to + * get the next page of SSH public keys. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2023-03-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 ApiErrorException thrown 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 as paginated response with {@link PagedFlux}. + */ + @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 ApiErrorException thrown 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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * 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 ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + @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 ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + @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 ApiErrorException thrown if the 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + resourceGroupName, + sshPublicKeyName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a new SSH public key resource. + * + * @param resourceGroupName The name of the resource group. + * @param sshPublicKeyName The name of the SSH public key. + * @param parameters Parameters supplied to create the SSH public key. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2023-03-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 ApiErrorException thrown if the 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String sshPublicKeyName, SshPublicKeyResourceInner parameters) { + return createWithResponseAsync(resourceGroupName, sshPublicKeyName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 ApiErrorException thrown if the 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse( + String resourceGroupName, String sshPublicKeyName, SshPublicKeyResourceInner parameters, Context context) { + return createWithResponseAsync(resourceGroupName, sshPublicKeyName, parameters, context).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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the 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 createWithResponse(resourceGroupName, sshPublicKeyName, parameters, Context.NONE).getValue(); + } + + /** + * 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 ApiErrorException thrown if the 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + sshPublicKeyName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a new SSH public key resource. + * + * @param resourceGroupName The name of the resource group. + * @param sshPublicKeyName The name of the SSH public key. + * @param parameters Parameters supplied to update the SSH public key. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2023-03-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 ApiErrorException thrown if the 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String sshPublicKeyName, SshPublicKeyUpdateResource parameters) { + return updateWithResponseAsync(resourceGroupName, sshPublicKeyName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 ApiErrorException thrown if the 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, String sshPublicKeyName, SshPublicKeyUpdateResource parameters, Context context) { + return updateWithResponseAsync(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 ApiErrorException thrown if the 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 updateWithResponse(resourceGroupName, sshPublicKeyName, parameters, Context.NONE).getValue(); + } + + /** + * 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String 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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + sshPublicKeyName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete an SSH public key. + * + * @param resourceGroupName The name of the resource group. + * @param sshPublicKeyName The name of the SSH public key. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String 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 = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + sshPublicKeyName, + apiVersion, + this.client.getSubscriptionId(), + accept, + 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String sshPublicKeyName) { + return deleteWithResponseAsync(resourceGroupName, sshPublicKeyName).flatMap(ignored -> Mono.empty()); + } + + /** + * 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String sshPublicKeyName, Context context) { + return deleteWithResponseAsync(resourceGroupName, sshPublicKeyName, 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 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 sshPublicKeyName) { + deleteWithResponse(resourceGroupName, sshPublicKeyName, Context.NONE); + } + + /** + * 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 ApiErrorException thrown if the 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + sshPublicKeyName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves information about an SSH public key. + * + * @param resourceGroupName The name of the resource group. + * @param sshPublicKeyName The name of the SSH public key. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2023-03-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 ApiErrorException thrown if the 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String sshPublicKeyName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, sshPublicKeyName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 ApiErrorException thrown if the 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String sshPublicKeyName, Context context) { + return getByResourceGroupWithResponseAsync(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 ApiErrorException thrown if the 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 getByResourceGroupWithResponse(resourceGroupName, sshPublicKeyName, Context.NONE).getValue(); + } + + /** + * 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 ApiErrorException 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .generateKeyPair( + this.client.getEndpoint(), + resourceGroupName, + sshPublicKeyName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Generates and returns a public/private key pair and populates the SSH public key resource with the public key. + * The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. + * + * @param resourceGroupName The name of the resource group. + * @param sshPublicKeyName The name of the SSH public key. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2023-03-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 ApiErrorException 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono generateKeyPairAsync( + String resourceGroupName, String sshPublicKeyName) { + return generateKeyPairWithResponseAsync(resourceGroupName, sshPublicKeyName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 ApiErrorException 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response generateKeyPairWithResponse( + String resourceGroupName, String sshPublicKeyName, Context context) { + return generateKeyPairWithResponseAsync(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 ApiErrorException 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 generateKeyPairWithResponse(resourceGroupName, sshPublicKeyName, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} 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..452bbce90a442 --- /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; + +public final class SshPublicKeysImpl implements SshPublicKeys { + private static 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 Response deleteByResourceGroupWithResponse( + String resourceGroupName, String sshPublicKeyName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, sshPublicKeyName, context); + } + + public void deleteByResourceGroup(String resourceGroupName, String sshPublicKeyName) { + this.serviceClient().delete(resourceGroupName, sshPublicKeyName); + } + + 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 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 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 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 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.deleteByResourceGroupWithResponse(resourceGroupName, sshPublicKeyName, Context.NONE); + } + + 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.deleteByResourceGroupWithResponse(resourceGroupName, sshPublicKeyName, context); + } + + private SshPublicKeysClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } + + public SshPublicKeyResourceImpl define(String name) { + return new SshPublicKeyResourceImpl(name, this.manager()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/UpdateDomainImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/UpdateDomainImpl.java new file mode 100644 index 0000000000000..5bee57378fa7e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/UpdateDomainImpl.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.resourcemanager.compute.generated.fluent.models.UpdateDomainInner; +import com.azure.resourcemanager.compute.generated.models.UpdateDomain; + +public final class UpdateDomainImpl implements UpdateDomain { + private UpdateDomainInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + UpdateDomainImpl( + UpdateDomainInner innerObject, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public UpdateDomainInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/UpgradeOperationHistoricalStatusInfoImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/UpgradeOperationHistoricalStatusInfoImpl.java new file mode 100644 index 0000000000000..54081979ebba3 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/UpgradeOperationHistoricalStatusInfoImpl.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.resourcemanager.compute.generated.fluent.models.UpgradeOperationHistoricalStatusInfoInner; +import com.azure.resourcemanager.compute.generated.models.UpgradeOperationHistoricalStatusInfo; +import com.azure.resourcemanager.compute.generated.models.UpgradeOperationHistoricalStatusInfoProperties; + +public final class UpgradeOperationHistoricalStatusInfoImpl implements UpgradeOperationHistoricalStatusInfo { + private UpgradeOperationHistoricalStatusInfoInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + UpgradeOperationHistoricalStatusInfoImpl( + UpgradeOperationHistoricalStatusInfoInner innerObject, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public UpgradeOperationHistoricalStatusInfoProperties properties() { + return this.innerModel().properties(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public UpgradeOperationHistoricalStatusInfoInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/UsageImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/UsageImpl.java new file mode 100644 index 0000000000000..96124976a1abb --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/UsageImpl.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.resourcemanager.compute.generated.fluent.models.UsageInner; +import com.azure.resourcemanager.compute.generated.models.Usage; +import com.azure.resourcemanager.compute.generated.models.UsageName; + +public final class UsageImpl implements Usage { + private UsageInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + UsageImpl(UsageInner innerObject, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String unit() { + return this.innerModel().unit(); + } + + public int currentValue() { + return this.innerModel().currentValue(); + } + + public long limit() { + return this.innerModel().limit(); + } + + public UsageName name() { + return this.innerModel().name(); + } + + public UsageInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/UsagesClientImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/UsagesClientImpl.java new file mode 100644 index 0000000000000..bfc4569f3a3af --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/UsagesClientImpl.java @@ -0,0 +1,316 @@ +// Copyright (c) Microsoft Corporation. All rights 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.resourcemanager.compute.generated.fluent.UsagesClient; +import com.azure.resourcemanager.compute.generated.fluent.models.UsageInner; +import com.azure.resourcemanager.compute.generated.models.ApiErrorException; +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 { + /** 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") + public interface UsagesService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/usages") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.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(ApiErrorException.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 ApiErrorException thrown 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 along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + location, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets, for the specified location, the current compute resource usage information as well as the limits for + * compute resources under the subscription. + * + * @param location The location for which resource usage is queried. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @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 = "2023-03-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 ApiErrorException thrown 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 as paginated response with {@link PagedFlux}. + */ + @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 ApiErrorException thrown 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 as paginated response with {@link PagedFlux}. + */ + @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 ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + @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 ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + @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 URL to get the next list of items + *

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 Usages operation response along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/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..d06511bed6d39 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/UsagesImpl.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.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; + +public final class UsagesImpl implements Usages { + private static 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..0c45f1699d5ed --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineExtensionImagesClientImpl.java @@ -0,0 +1,610 @@ +// Copyright (c) Microsoft Corporation. All rights 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.resourcemanager.compute.generated.fluent.VirtualMachineExtensionImagesClient; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineExtensionImageInner; +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 VirtualMachineExtensionImagesClient. */ +public final class VirtualMachineExtensionImagesClientImpl implements VirtualMachineExtensionImagesClient { + /** 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") + public 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(ApiErrorException.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(ApiErrorException.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(ApiErrorException.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 ApiErrorException 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + location, + publisherName, + type, + version, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a virtual machine extension image. + * + * @param location The name of a supported Azure region. + * @param publisherName The publisherName parameter. + * @param type The type parameter. + * @param version The version parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-03-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 ApiErrorException 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String location, String publisherName, String type, String version) { + return getWithResponseAsync(location, publisherName, type, version) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 ApiErrorException 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 along with {@link Response}. + */ + @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 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 ApiErrorException 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 getWithResponse(location, publisherName, type, version, Context.NONE).getValue(); + } + + /** + * 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 ApiErrorException thrown if 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listTypes( + this.client.getEndpoint(), + location, + publisherName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of virtual machine extension image types. + * + * @param location The name of a supported Azure region. + * @param publisherName The publisherName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2023-03-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 ApiErrorException thrown if 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listTypesAsync(String location, String publisherName) { + return listTypesWithResponseAsync(location, publisherName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 ApiErrorException thrown if 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 along with {@link Response}. + */ + @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 types. + * + * @param location The name of a supported Azure region. + * @param publisherName The publisherName 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 virtual machine extension image types. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public List listTypes(String location, String publisherName) { + return listTypesWithResponse(location, publisherName, Context.NONE).getValue(); + } + + /** + * 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 ApiErrorException thrown if 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 along with {@link Response} on successful completion + * of {@link Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listVersions( + this.client.getEndpoint(), + location, + publisherName, + type, + filter, + top, + orderby, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of virtual machine extension image versions. + * + * @param location The name of a supported Azure region. + * @param publisherName The publisherName parameter. + * @param type The type parameter. + * @param filter The filter to apply on the operation. + * @param top The top parameter. + * @param orderby The orderby parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if 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 along with {@link Response} on successful completion + * of {@link Mono}. + */ + @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 = "2023-03-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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if 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 on successful completion of {@link Mono}. + */ + @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(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 ApiErrorException thrown if 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 along with {@link Response}. + */ + @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(); + } + + /** + * 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 ApiErrorException thrown if 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 listVersionsWithResponse(location, publisherName, type, filter, top, orderby, Context.NONE).getValue(); + } +} 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..23d27347ea779 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineExtensionImagesImpl.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.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 java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class VirtualMachineExtensionImagesImpl implements VirtualMachineExtensionImages { + private static 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 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 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> 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 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> 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; + } + } + + 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(); + } + } + + 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..a5ea5f874e54e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineExtensionImpl.java @@ -0,0 +1,354 @@ +// Copyright (c) Microsoft Corporation. All rights 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.KeyVaultSecretReference; +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.List; +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 Boolean suppressFailures() { + return this.innerModel().suppressFailures(); + } + + public KeyVaultSecretReference protectedSettingsFromKeyVault() { + return this.innerModel().protectedSettingsFromKeyVault(); + } + + public List provisionAfterExtensions() { + List inner = this.innerModel().provisionAfterExtensions(); + 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 String resourceGroupName() { + return resourceGroupName; + } + + 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 withSuppressFailures(Boolean suppressFailures) { + if (isInCreateMode()) { + this.innerModel().withSuppressFailures(suppressFailures); + return this; + } else { + this.updateExtensionParameters.withSuppressFailures(suppressFailures); + return this; + } + } + + public VirtualMachineExtensionImpl withProtectedSettingsFromKeyVault( + KeyVaultSecretReference protectedSettingsFromKeyVault) { + if (isInCreateMode()) { + this.innerModel().withProtectedSettingsFromKeyVault(protectedSettingsFromKeyVault); + return this; + } else { + this.updateExtensionParameters.withProtectedSettingsFromKeyVault(protectedSettingsFromKeyVault); + return this; + } + } + + public VirtualMachineExtensionImpl withProvisionAfterExtensions(List provisionAfterExtensions) { + this.innerModel().withProvisionAfterExtensions(provisionAfterExtensions); + 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..2903de1c9b630 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineExtensionsClientImpl.java @@ -0,0 +1,1391 @@ +// Copyright (c) Microsoft Corporation. All rights 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.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.ApiErrorException; +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 { + /** 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") + public interface VirtualMachineExtensionsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ApiErrorException.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(ApiErrorException.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({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ApiErrorException.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, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.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(ApiErrorException.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 ApiErrorException thrown if the 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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + vmName, + vmExtensionName, + apiVersion, + this.client.getSubscriptionId(), + extensionParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to create or update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be created or updated. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the 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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 = "2023-03-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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of describes a Virtual Machine Extension. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of describes a Virtual Machine Extension. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes a Virtual Machine Extension. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualMachineExtensionInner> beginCreateOrUpdate( + String resourceGroupName, + String vmName, + String vmExtensionName, + VirtualMachineExtensionInner extensionParameters) { + return this + .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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes a Virtual Machine Extension. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualMachineExtensionInner> beginCreateOrUpdate( + String resourceGroupName, + String vmName, + String vmExtensionName, + VirtualMachineExtensionInner extensionParameters, + Context context) { + return this + .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 ApiErrorException thrown if the 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 on successful completion of {@link Mono}. + */ + @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 ApiErrorException thrown if the 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 on successful completion of {@link Mono}. + */ + @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 ApiErrorException thrown if the 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 ApiErrorException thrown if the 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 ApiErrorException thrown if the 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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + vmName, + vmExtensionName, + apiVersion, + this.client.getSubscriptionId(), + extensionParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be updated. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the 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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 = "2023-03-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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of describes a Virtual Machine Extension. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of describes a Virtual Machine Extension. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes a Virtual Machine Extension. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualMachineExtensionInner> beginUpdate( + String resourceGroupName, + String vmName, + String vmExtensionName, + VirtualMachineExtensionUpdate extensionParameters) { + return this.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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes a Virtual Machine Extension. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualMachineExtensionInner> beginUpdate( + String resourceGroupName, + String vmName, + String vmExtensionName, + VirtualMachineExtensionUpdate extensionParameters, + Context context) { + return this + .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 ApiErrorException thrown if the 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 on successful completion of {@link Mono}. + */ + @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 ApiErrorException thrown if the 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 on successful completion of {@link Mono}. + */ + @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 ApiErrorException thrown if the 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 ApiErrorException thrown if the 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String 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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + vmName, + vmExtensionName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to delete the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be deleted. + * @param vmExtensionName The name of the virtual machine extension. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String 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 = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + vmName, + vmExtensionName, + apiVersion, + this.client.getSubscriptionId(), + accept, + 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String vmName, String vmExtensionName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, vmName, vmExtensionName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String vmName, String vmExtensionName) { + return this.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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String vmName, String vmExtensionName, Context context) { + return this.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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String 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 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 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 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 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 ApiErrorException thrown if the 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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + vmName, + vmExtensionName, + expand, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to get the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the extension. + * @param vmExtensionName The name of the virtual machine extension. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the 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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 = "2023-03-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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String vmName, String vmExtensionName) { + final String expand = null; + return getWithResponseAsync(resourceGroupName, vmName, vmExtensionName, expand) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 ApiErrorException thrown if the 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 along with {@link Response}. + */ + @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 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 ApiErrorException thrown if the 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 getWithResponse(resourceGroupName, vmName, vmExtensionName, expand, Context.NONE).getValue(); + } + + /** + * 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 ApiErrorException thrown 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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + vmName, + expand, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to get all extensions of a Virtual Machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the extension. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 = "2023-03-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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync(String resourceGroupName, String vmName) { + final String expand = null; + return listWithResponseAsync(resourceGroupName, vmName, expand) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 ApiErrorException thrown 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse( + String resourceGroupName, String vmName, String expand, Context context) { + return listWithResponseAsync(resourceGroupName, vmName, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 listWithResponse(resourceGroupName, vmName, expand, Context.NONE).getValue(); + } +} 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..613a58ae17883 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineExtensionsImpl.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.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; + +public final class VirtualMachineExtensionsImpl implements VirtualMachineExtensions { + private static 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 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 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 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 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 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..7ea61269ab398 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineImageImpl.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.implementation; + +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineImageInner; +import com.azure.resourcemanager.compute.generated.models.ArchitectureTypes; +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.ImageDeprecationStatus; +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 ArchitectureTypes architecture() { + return this.innerModel().architecture(); + } + + public ImageDeprecationStatus imageDeprecationStatus() { + return this.innerModel().imageDeprecationStatus(); + } + + 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..4cab6d3560ec4 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineImagesClientImpl.java @@ -0,0 +1,1115 @@ +// Copyright (c) Microsoft Corporation. All rights 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.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.fluent.models.VmImagesInEdgeZoneListResultInner; +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 VirtualMachineImagesClient. */ +public final class VirtualMachineImagesClientImpl implements VirtualMachineImagesClient { + /** 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") + public 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(ApiErrorException.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(ApiErrorException.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(ApiErrorException.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(ApiErrorException.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(ApiErrorException.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); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}/vmimages") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> listByEdgeZone( + @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); + } + + /** + * 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 ApiErrorException 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + location, + publisherName, + offer, + skus, + version, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a virtual machine image. + * + * @param location The name of a supported Azure region. + * @param publisherName A valid image publisher. + * @param offer A valid image publisher offer. + * @param skus A valid image SKU. + * @param version A valid image SKU version. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-03-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 ApiErrorException 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 on successful completion of {@link Mono}. + */ + @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(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 ApiErrorException 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 along with {@link Response}. + */ + @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 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 ApiErrorException 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 getWithResponse(location, publisherName, offer, skus, version, Context.NONE).getValue(); + } + + /** + * 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 ApiErrorException thrown if 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 along + * with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + location, + publisherName, + offer, + skus, + expand, + top, + orderby, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. + * + * @param location The name of a supported Azure region. + * @param publisherName A valid image publisher. + * @param offer A valid image publisher offer. + * @param skus A valid image SKU. + * @param expand The expand expression to apply on the operation. + * @param top The top parameter. + * @param orderby The orderby parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if 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 along + * with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-03-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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if 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 on + * successful completion of {@link Mono}. + */ + @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(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 ApiErrorException thrown if 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 along + * with {@link Response}. + */ + @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 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 ApiErrorException thrown if 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 listWithResponse(location, publisherName, offer, skus, expand, top, orderby, Context.NONE).getValue(); + } + + /** + * 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 ApiErrorException thrown if 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 along with {@link + * Response} on successful completion of {@link Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listOffers( + this.client.getEndpoint(), + location, + publisherName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of virtual machine image offers for the specified location and publisher. + * + * @param location The name of a supported Azure region. + * @param publisherName A valid image publisher. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if 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 along with {@link + * Response} on successful completion of {@link Mono}. + */ + @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 = "2023-03-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 ApiErrorException thrown if 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 on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listOffersAsync(String location, String publisherName) { + return listOffersWithResponseAsync(location, publisherName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 ApiErrorException thrown if 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 along with {@link + * Response}. + */ + @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 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 ApiErrorException thrown if 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 listOffersWithResponse(location, publisherName, Context.NONE).getValue(); + } + + /** + * 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 ApiErrorException thrown if 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 along with {@link Response} + * on successful completion of {@link Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listPublishers( + this.client.getEndpoint(), + location, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of virtual machine image publishers for the specified Azure location. + * + * @param location The name of a supported Azure region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if 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 along with {@link Response} + * on successful completion of {@link Mono}. + */ + @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 = "2023-03-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 ApiErrorException thrown if 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 on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listPublishersAsync(String location) { + return listPublishersWithResponseAsync(location).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 ApiErrorException thrown if 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response> listPublishersWithResponse( + String location, Context context) { + return listPublishersWithResponseAsync(location, 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 ApiErrorException thrown if 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 listPublishersWithResponse(location, Context.NONE).getValue(); + } + + /** + * 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 ApiErrorException thrown if 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 along with {@link + * Response} on successful completion of {@link Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listSkus( + this.client.getEndpoint(), + location, + publisherName, + offer, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. + * + * @param location The name of a supported Azure region. + * @param publisherName A valid image publisher. + * @param offer A valid image publisher offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if 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 along with {@link + * Response} on successful completion of {@link Mono}. + */ + @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 = "2023-03-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 ApiErrorException thrown if 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 on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSkusAsync( + String location, String publisherName, String offer) { + return listSkusWithResponseAsync(location, publisherName, offer) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 ApiErrorException thrown if 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 along with {@link + * Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response> listSkusWithResponse( + String location, String publisherName, String offer, Context context) { + return listSkusWithResponseAsync(location, publisherName, offer, 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 ApiErrorException thrown if 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 listSkusWithResponse(location, publisherName, offer, Context.NONE).getValue(); + } + + /** + * Gets a list of all virtual machine image versions for the specified 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 all virtual machine image versions for the specified edge zone along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByEdgeZoneWithResponseAsync( + 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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByEdgeZone( + this.client.getEndpoint(), + location, + edgeZone, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of all virtual machine image versions for the specified 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 all virtual machine image versions for the specified edge zone along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByEdgeZoneWithResponseAsync( + 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 = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByEdgeZone( + this.client.getEndpoint(), + location, + edgeZone, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets a list of all virtual machine image versions for the specified 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 all virtual machine image versions for the specified edge zone on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listByEdgeZoneAsync(String location, String edgeZone) { + return listByEdgeZoneWithResponseAsync(location, edgeZone).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a list of all virtual machine image versions for the specified 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 all virtual machine image versions for the specified edge zone along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listByEdgeZoneWithResponse( + String location, String edgeZone, Context context) { + return listByEdgeZoneWithResponseAsync(location, edgeZone, context).block(); + } + + /** + * Gets a list of all virtual machine image versions for the specified 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 all virtual machine image versions for the specified edge zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VmImagesInEdgeZoneListResultInner listByEdgeZone(String location, String edgeZone) { + return listByEdgeZoneWithResponse(location, edgeZone, Context.NONE).getValue(); + } +} 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..7c261c0a00b4f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineImagesEdgeZonesClientImpl.java @@ -0,0 +1,1071 @@ +// Copyright (c) Microsoft Corporation. All rights 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.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 { + /** 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") + public 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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + location, + edgeZone, + publisherName, + offer, + skus, + version, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a virtual machine image in an edge zone. + * + * @param location The name of a supported Azure region. + * @param edgeZone The name of the edge zone. + * @param publisherName A valid image publisher. + * @param offer A valid image publisher offer. + * @param skus A valid image SKU. + * @param version A valid image SKU version. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual machine image in an edge zone along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 = "2023-03-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 on successful completion of {@link Mono}. + */ + @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(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @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 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 getWithResponse(location, edgeZone, publisherName, offer, skus, version, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + location, + edgeZone, + publisherName, + offer, + skus, + expand, + top, + orderby, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and + * SKU. + * + * @param location The name of a supported Azure region. + * @param edgeZone The name of the edge zone. + * @param publisherName A valid image publisher. + * @param offer A valid image publisher offer. + * @param skus A valid image SKU. + * @param expand The expand expression to apply on the operation. + * @param top An integer value specifying the number of images to return that matches supplied values. + * @param orderby Specifies the order of the results returned. Formatted as an OData query. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and + * SKU along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-03-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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if 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 on successful completion of {@link Mono}. + */ + @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(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @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 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 listWithResponse(location, edgeZone, publisherName, offer, skus, expand, top, orderby, Context.NONE) + .getValue(); + } + + /** + * 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 along with + * {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listOffers( + this.client.getEndpoint(), + location, + edgeZone, + publisherName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of virtual machine image offers for the specified location, edge zone and publisher. + * + * @param location The name of a supported Azure region. + * @param edgeZone The name of the edge zone. + * @param publisherName A valid image publisher. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine image offers for the specified location, edge zone and publisher along with + * {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-03-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 on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listOffersAsync( + String location, String edgeZone, String publisherName) { + return listOffersWithResponseAsync(location, edgeZone, publisherName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with + * {@link Response}. + */ + @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 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 listOffersWithResponse(location, edgeZone, publisherName, Context.NONE).getValue(); + } + + /** + * 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 along with + * {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listPublishers( + this.client.getEndpoint(), + location, + edgeZone, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of virtual machine image publishers for the specified Azure location and edge zone. + * + * @param location The name of a supported Azure region. + * @param edgeZone The name of the edge zone. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine image publishers for the specified Azure location and edge zone along with + * {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-03-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 on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listPublishersAsync(String location, String edgeZone) { + return listPublishersWithResponseAsync(location, edgeZone).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with + * {@link Response}. + */ + @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 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 listPublishersWithResponse(location, edgeZone, Context.NONE).getValue(); + } + + /** + * 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 along + * with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listSkus( + this.client.getEndpoint(), + location, + edgeZone, + publisherName, + offer, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. + * + * @param location The name of a supported Azure region. + * @param edgeZone The name of the edge zone. + * @param publisherName A valid image publisher. + * @param offer A valid image publisher offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer along + * with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-03-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 on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSkusAsync( + String location, String edgeZone, String publisherName, String offer) { + return listSkusWithResponseAsync(location, edgeZone, publisherName, offer) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along + * with {@link Response}. + */ + @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(); + } + + /** + * 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 listSkusWithResponse(location, edgeZone, publisherName, offer, Context.NONE).getValue(); + } +} 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..ea68ff42e928e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineImagesEdgeZonesImpl.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.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 java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class VirtualMachineImagesEdgeZonesImpl implements VirtualMachineImagesEdgeZones { + private static 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 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 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> 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 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> 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 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> 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 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> 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; + } + } + + 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(); + } + } + + 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..c4601ae021bb5 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineImagesImpl.java @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights 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.fluent.models.VmImagesInEdgeZoneListResultInner; +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.azure.resourcemanager.compute.generated.models.VmImagesInEdgeZoneListResult; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class VirtualMachineImagesImpl implements VirtualMachineImages { + private static 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 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 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> 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 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> 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 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> 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 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> 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; + } + } + + 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 listByEdgeZoneWithResponse( + String location, String edgeZone, Context context) { + Response inner = + this.serviceClient().listByEdgeZoneWithResponse(location, edgeZone, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VmImagesInEdgeZoneListResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public VmImagesInEdgeZoneListResult listByEdgeZone(String location, String edgeZone) { + VmImagesInEdgeZoneListResultInner inner = this.serviceClient().listByEdgeZone(location, edgeZone); + if (inner != null) { + return new VmImagesInEdgeZoneListResultImpl(inner, this.manager()); + } 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..8861d457db8fb --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineImpl.java @@ -0,0 +1,743 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineExtensionInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineInstanceViewInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineUpdateInner; +import com.azure.resourcemanager.compute.generated.models.AdditionalCapabilities; +import com.azure.resourcemanager.compute.generated.models.ApplicationProfile; +import com.azure.resourcemanager.compute.generated.models.BillingProfile; +import com.azure.resourcemanager.compute.generated.models.CapacityReservationProfile; +import com.azure.resourcemanager.compute.generated.models.DiagnosticsProfile; +import com.azure.resourcemanager.compute.generated.models.ExtendedLocation; +import com.azure.resourcemanager.compute.generated.models.HardwareProfile; +import com.azure.resourcemanager.compute.generated.models.InstanceViewTypes; +import com.azure.resourcemanager.compute.generated.models.NetworkProfile; +import com.azure.resourcemanager.compute.generated.models.OSProfile; +import com.azure.resourcemanager.compute.generated.models.Plan; +import com.azure.resourcemanager.compute.generated.models.RetrieveBootDiagnosticsDataResult; +import com.azure.resourcemanager.compute.generated.models.RunCommandInput; +import com.azure.resourcemanager.compute.generated.models.RunCommandResult; +import com.azure.resourcemanager.compute.generated.models.ScheduledEventsProfile; +import com.azure.resourcemanager.compute.generated.models.SecurityProfile; +import com.azure.resourcemanager.compute.generated.models.StorageProfile; +import com.azure.resourcemanager.compute.generated.models.VirtualMachine; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineAssessPatchesResult; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineCaptureParameters; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineCaptureResult; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineEvictionPolicyTypes; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineExtension; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineIdentity; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineInstallPatchesParameters; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineInstallPatchesResult; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineInstanceView; +import com.azure.resourcemanager.compute.generated.models.VirtualMachinePriorityTypes; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineReimageParameters; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public final class VirtualMachineImpl implements VirtualMachine, VirtualMachine.Definition, VirtualMachine.Update { + private VirtualMachineInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Plan plan() { + return this.innerModel().plan(); + } + + public List resources() { + List inner = this.innerModel().resources(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new VirtualMachineExtensionImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public VirtualMachineIdentity identity() { + return this.innerModel().identity(); + } + + public List zones() { + List inner = this.innerModel().zones(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ExtendedLocation extendedLocation() { + return this.innerModel().extendedLocation(); + } + + public HardwareProfile hardwareProfile() { + return this.innerModel().hardwareProfile(); + } + + public StorageProfile storageProfile() { + return this.innerModel().storageProfile(); + } + + public AdditionalCapabilities additionalCapabilities() { + return this.innerModel().additionalCapabilities(); + } + + public OSProfile osProfile() { + return this.innerModel().osProfile(); + } + + public NetworkProfile networkProfile() { + return this.innerModel().networkProfile(); + } + + public SecurityProfile securityProfile() { + return this.innerModel().securityProfile(); + } + + public DiagnosticsProfile diagnosticsProfile() { + return this.innerModel().diagnosticsProfile(); + } + + public SubResource availabilitySet() { + return this.innerModel().availabilitySet(); + } + + public SubResource virtualMachineScaleSet() { + return this.innerModel().virtualMachineScaleSet(); + } + + public SubResource proximityPlacementGroup() { + return this.innerModel().proximityPlacementGroup(); + } + + public VirtualMachinePriorityTypes priority() { + return this.innerModel().priority(); + } + + public VirtualMachineEvictionPolicyTypes evictionPolicy() { + return this.innerModel().evictionPolicy(); + } + + public BillingProfile billingProfile() { + return this.innerModel().billingProfile(); + } + + public SubResource host() { + return this.innerModel().host(); + } + + public SubResource hostGroup() { + return this.innerModel().hostGroup(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public VirtualMachineInstanceView instanceView() { + VirtualMachineInstanceViewInner inner = this.innerModel().instanceView(); + if (inner != null) { + return new VirtualMachineInstanceViewImpl(inner, this.manager()); + } else { + return null; + } + } + + public String licenseType() { + return this.innerModel().licenseType(); + } + + public String vmId() { + return this.innerModel().vmId(); + } + + public String extensionsTimeBudget() { + return this.innerModel().extensionsTimeBudget(); + } + + public Integer platformFaultDomain() { + return this.innerModel().platformFaultDomain(); + } + + public ScheduledEventsProfile scheduledEventsProfile() { + return this.innerModel().scheduledEventsProfile(); + } + + public String userData() { + return this.innerModel().userData(); + } + + public CapacityReservationProfile capacityReservation() { + return this.innerModel().capacityReservation(); + } + + public ApplicationProfile applicationProfile() { + return this.innerModel().applicationProfile(); + } + + public OffsetDateTime timeCreated() { + return this.innerModel().timeCreated(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public VirtualMachineInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String vmName; + + private VirtualMachineUpdateInner updateParameters; + + public VirtualMachineImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public VirtualMachine create() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualMachines() + .createOrUpdate(resourceGroupName, vmName, this.innerModel(), Context.NONE); + return this; + } + + public VirtualMachine create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualMachines() + .createOrUpdate(resourceGroupName, vmName, this.innerModel(), context); + return this; + } + + VirtualMachineImpl(String name, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = new VirtualMachineInner(); + this.serviceManager = serviceManager; + this.vmName = name; + } + + public VirtualMachineImpl update() { + this.updateParameters = new VirtualMachineUpdateInner(); + return this; + } + + public VirtualMachine apply() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualMachines() + .update(resourceGroupName, vmName, updateParameters, Context.NONE); + return this; + } + + public VirtualMachine apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualMachines() + .update(resourceGroupName, vmName, updateParameters, context); + return this; + } + + VirtualMachineImpl( + VirtualMachineInner innerObject, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.vmName = Utils.getValueFromIdByName(innerObject.id(), "virtualMachines"); + } + + public VirtualMachine refresh() { + InstanceViewTypes localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getVirtualMachines() + .getByResourceGroupWithResponse(resourceGroupName, vmName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public VirtualMachine refresh(Context context) { + InstanceViewTypes localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getVirtualMachines() + .getByResourceGroupWithResponse(resourceGroupName, vmName, localExpand, context) + .getValue(); + return this; + } + + public VirtualMachineCaptureResult capture(VirtualMachineCaptureParameters parameters) { + return serviceManager.virtualMachines().capture(resourceGroupName, vmName, parameters); + } + + public VirtualMachineCaptureResult capture(VirtualMachineCaptureParameters parameters, Context context) { + return serviceManager.virtualMachines().capture(resourceGroupName, vmName, parameters, context); + } + + public void convertToManagedDisks() { + serviceManager.virtualMachines().convertToManagedDisks(resourceGroupName, vmName); + } + + public void convertToManagedDisks(Context context) { + serviceManager.virtualMachines().convertToManagedDisks(resourceGroupName, vmName, context); + } + + public void deallocate() { + serviceManager.virtualMachines().deallocate(resourceGroupName, vmName); + } + + public void deallocate(Boolean hibernate, Context context) { + serviceManager.virtualMachines().deallocate(resourceGroupName, vmName, hibernate, context); + } + + public Response generalizeWithResponse(Context context) { + return serviceManager.virtualMachines().generalizeWithResponse(resourceGroupName, vmName, context); + } + + public void generalize() { + serviceManager.virtualMachines().generalize(resourceGroupName, vmName); + } + + public void powerOff() { + serviceManager.virtualMachines().powerOff(resourceGroupName, vmName); + } + + public void powerOff(Boolean skipShutdown, Context context) { + serviceManager.virtualMachines().powerOff(resourceGroupName, vmName, skipShutdown, context); + } + + public void reapply() { + serviceManager.virtualMachines().reapply(resourceGroupName, vmName); + } + + public void reapply(Context context) { + serviceManager.virtualMachines().reapply(resourceGroupName, vmName, context); + } + + public void restart() { + serviceManager.virtualMachines().restart(resourceGroupName, vmName); + } + + public void restart(Context context) { + serviceManager.virtualMachines().restart(resourceGroupName, vmName, context); + } + + public void start() { + serviceManager.virtualMachines().start(resourceGroupName, vmName); + } + + public void start(Context context) { + serviceManager.virtualMachines().start(resourceGroupName, vmName, context); + } + + public void redeploy() { + serviceManager.virtualMachines().redeploy(resourceGroupName, vmName); + } + + public void redeploy(Context context) { + serviceManager.virtualMachines().redeploy(resourceGroupName, vmName, context); + } + + public void reimage() { + serviceManager.virtualMachines().reimage(resourceGroupName, vmName); + } + + public void reimage(VirtualMachineReimageParameters parameters, Context context) { + serviceManager.virtualMachines().reimage(resourceGroupName, vmName, parameters, context); + } + + public Response retrieveBootDiagnosticsDataWithResponse( + Integer sasUriExpirationTimeInMinutes, Context context) { + return serviceManager + .virtualMachines() + .retrieveBootDiagnosticsDataWithResponse(resourceGroupName, vmName, sasUriExpirationTimeInMinutes, context); + } + + public RetrieveBootDiagnosticsDataResult retrieveBootDiagnosticsData() { + return serviceManager.virtualMachines().retrieveBootDiagnosticsData(resourceGroupName, vmName); + } + + public void performMaintenance() { + serviceManager.virtualMachines().performMaintenance(resourceGroupName, vmName); + } + + public void performMaintenance(Context context) { + serviceManager.virtualMachines().performMaintenance(resourceGroupName, vmName, context); + } + + public Response simulateEvictionWithResponse(Context context) { + return serviceManager.virtualMachines().simulateEvictionWithResponse(resourceGroupName, vmName, context); + } + + public void simulateEviction() { + serviceManager.virtualMachines().simulateEviction(resourceGroupName, vmName); + } + + public VirtualMachineAssessPatchesResult assessPatches() { + return serviceManager.virtualMachines().assessPatches(resourceGroupName, vmName); + } + + public VirtualMachineAssessPatchesResult assessPatches(Context context) { + return serviceManager.virtualMachines().assessPatches(resourceGroupName, vmName, context); + } + + public VirtualMachineInstallPatchesResult installPatches( + VirtualMachineInstallPatchesParameters installPatchesInput) { + return serviceManager.virtualMachines().installPatches(resourceGroupName, vmName, installPatchesInput); + } + + public VirtualMachineInstallPatchesResult installPatches( + VirtualMachineInstallPatchesParameters installPatchesInput, Context context) { + return serviceManager.virtualMachines().installPatches(resourceGroupName, vmName, installPatchesInput, context); + } + + public RunCommandResult runCommand(RunCommandInput parameters) { + return serviceManager.virtualMachines().runCommand(resourceGroupName, vmName, parameters); + } + + public RunCommandResult runCommand(RunCommandInput parameters, Context context) { + return serviceManager.virtualMachines().runCommand(resourceGroupName, vmName, parameters, context); + } + + public VirtualMachineImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public VirtualMachineImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public VirtualMachineImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public VirtualMachineImpl withPlan(Plan plan) { + if (isInCreateMode()) { + this.innerModel().withPlan(plan); + return this; + } else { + this.updateParameters.withPlan(plan); + return this; + } + } + + public VirtualMachineImpl withIdentity(VirtualMachineIdentity identity) { + if (isInCreateMode()) { + this.innerModel().withIdentity(identity); + return this; + } else { + this.updateParameters.withIdentity(identity); + return this; + } + } + + public VirtualMachineImpl withZones(List zones) { + if (isInCreateMode()) { + this.innerModel().withZones(zones); + return this; + } else { + this.updateParameters.withZones(zones); + return this; + } + } + + public VirtualMachineImpl withExtendedLocation(ExtendedLocation extendedLocation) { + this.innerModel().withExtendedLocation(extendedLocation); + return this; + } + + public VirtualMachineImpl withHardwareProfile(HardwareProfile hardwareProfile) { + if (isInCreateMode()) { + this.innerModel().withHardwareProfile(hardwareProfile); + return this; + } else { + this.updateParameters.withHardwareProfile(hardwareProfile); + return this; + } + } + + public VirtualMachineImpl withStorageProfile(StorageProfile storageProfile) { + if (isInCreateMode()) { + this.innerModel().withStorageProfile(storageProfile); + return this; + } else { + this.updateParameters.withStorageProfile(storageProfile); + return this; + } + } + + public VirtualMachineImpl withAdditionalCapabilities(AdditionalCapabilities additionalCapabilities) { + if (isInCreateMode()) { + this.innerModel().withAdditionalCapabilities(additionalCapabilities); + return this; + } else { + this.updateParameters.withAdditionalCapabilities(additionalCapabilities); + return this; + } + } + + public VirtualMachineImpl withOsProfile(OSProfile osProfile) { + if (isInCreateMode()) { + this.innerModel().withOsProfile(osProfile); + return this; + } else { + this.updateParameters.withOsProfile(osProfile); + return this; + } + } + + public VirtualMachineImpl withNetworkProfile(NetworkProfile networkProfile) { + if (isInCreateMode()) { + this.innerModel().withNetworkProfile(networkProfile); + return this; + } else { + this.updateParameters.withNetworkProfile(networkProfile); + return this; + } + } + + public VirtualMachineImpl withSecurityProfile(SecurityProfile securityProfile) { + if (isInCreateMode()) { + this.innerModel().withSecurityProfile(securityProfile); + return this; + } else { + this.updateParameters.withSecurityProfile(securityProfile); + return this; + } + } + + public VirtualMachineImpl withDiagnosticsProfile(DiagnosticsProfile diagnosticsProfile) { + if (isInCreateMode()) { + this.innerModel().withDiagnosticsProfile(diagnosticsProfile); + return this; + } else { + this.updateParameters.withDiagnosticsProfile(diagnosticsProfile); + return this; + } + } + + public VirtualMachineImpl withAvailabilitySet(SubResource availabilitySet) { + if (isInCreateMode()) { + this.innerModel().withAvailabilitySet(availabilitySet); + return this; + } else { + this.updateParameters.withAvailabilitySet(availabilitySet); + return this; + } + } + + public VirtualMachineImpl withVirtualMachineScaleSet(SubResource virtualMachineScaleSet) { + if (isInCreateMode()) { + this.innerModel().withVirtualMachineScaleSet(virtualMachineScaleSet); + return this; + } else { + this.updateParameters.withVirtualMachineScaleSet(virtualMachineScaleSet); + return this; + } + } + + public VirtualMachineImpl withProximityPlacementGroup(SubResource proximityPlacementGroup) { + if (isInCreateMode()) { + this.innerModel().withProximityPlacementGroup(proximityPlacementGroup); + return this; + } else { + this.updateParameters.withProximityPlacementGroup(proximityPlacementGroup); + return this; + } + } + + public VirtualMachineImpl withPriority(VirtualMachinePriorityTypes priority) { + if (isInCreateMode()) { + this.innerModel().withPriority(priority); + return this; + } else { + this.updateParameters.withPriority(priority); + return this; + } + } + + public VirtualMachineImpl withEvictionPolicy(VirtualMachineEvictionPolicyTypes evictionPolicy) { + if (isInCreateMode()) { + this.innerModel().withEvictionPolicy(evictionPolicy); + return this; + } else { + this.updateParameters.withEvictionPolicy(evictionPolicy); + return this; + } + } + + public VirtualMachineImpl withBillingProfile(BillingProfile billingProfile) { + if (isInCreateMode()) { + this.innerModel().withBillingProfile(billingProfile); + return this; + } else { + this.updateParameters.withBillingProfile(billingProfile); + return this; + } + } + + public VirtualMachineImpl withHost(SubResource host) { + if (isInCreateMode()) { + this.innerModel().withHost(host); + return this; + } else { + this.updateParameters.withHost(host); + return this; + } + } + + public VirtualMachineImpl withHostGroup(SubResource hostGroup) { + if (isInCreateMode()) { + this.innerModel().withHostGroup(hostGroup); + return this; + } else { + this.updateParameters.withHostGroup(hostGroup); + return this; + } + } + + public VirtualMachineImpl withLicenseType(String licenseType) { + if (isInCreateMode()) { + this.innerModel().withLicenseType(licenseType); + return this; + } else { + this.updateParameters.withLicenseType(licenseType); + return this; + } + } + + public VirtualMachineImpl withExtensionsTimeBudget(String extensionsTimeBudget) { + if (isInCreateMode()) { + this.innerModel().withExtensionsTimeBudget(extensionsTimeBudget); + return this; + } else { + this.updateParameters.withExtensionsTimeBudget(extensionsTimeBudget); + return this; + } + } + + public VirtualMachineImpl withPlatformFaultDomain(Integer platformFaultDomain) { + if (isInCreateMode()) { + this.innerModel().withPlatformFaultDomain(platformFaultDomain); + return this; + } else { + this.updateParameters.withPlatformFaultDomain(platformFaultDomain); + return this; + } + } + + public VirtualMachineImpl withScheduledEventsProfile(ScheduledEventsProfile scheduledEventsProfile) { + if (isInCreateMode()) { + this.innerModel().withScheduledEventsProfile(scheduledEventsProfile); + return this; + } else { + this.updateParameters.withScheduledEventsProfile(scheduledEventsProfile); + return this; + } + } + + public VirtualMachineImpl withUserData(String userData) { + if (isInCreateMode()) { + this.innerModel().withUserData(userData); + return this; + } else { + this.updateParameters.withUserData(userData); + return this; + } + } + + public VirtualMachineImpl withCapacityReservation(CapacityReservationProfile capacityReservation) { + if (isInCreateMode()) { + this.innerModel().withCapacityReservation(capacityReservation); + return this; + } else { + this.updateParameters.withCapacityReservation(capacityReservation); + return this; + } + } + + public VirtualMachineImpl withApplicationProfile(ApplicationProfile applicationProfile) { + if (isInCreateMode()) { + this.innerModel().withApplicationProfile(applicationProfile); + return this; + } else { + this.updateParameters.withApplicationProfile(applicationProfile); + 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/VirtualMachinePropertiesImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachinePropertiesImpl.java new file mode 100644 index 0000000000000..2d1883d77bd14 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachinePropertiesImpl.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.implementation; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineInstanceViewInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachinePropertiesInner; +import com.azure.resourcemanager.compute.generated.models.AdditionalCapabilities; +import com.azure.resourcemanager.compute.generated.models.ApplicationProfile; +import com.azure.resourcemanager.compute.generated.models.BillingProfile; +import com.azure.resourcemanager.compute.generated.models.CapacityReservationProfile; +import com.azure.resourcemanager.compute.generated.models.DiagnosticsProfile; +import com.azure.resourcemanager.compute.generated.models.HardwareProfile; +import com.azure.resourcemanager.compute.generated.models.NetworkProfile; +import com.azure.resourcemanager.compute.generated.models.OSProfile; +import com.azure.resourcemanager.compute.generated.models.ScheduledEventsProfile; +import com.azure.resourcemanager.compute.generated.models.SecurityProfile; +import com.azure.resourcemanager.compute.generated.models.StorageProfile; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineEvictionPolicyTypes; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineInstanceView; +import com.azure.resourcemanager.compute.generated.models.VirtualMachinePriorityTypes; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineProperties; +import java.time.OffsetDateTime; + +public final class VirtualMachinePropertiesImpl implements VirtualMachineProperties { + private VirtualMachinePropertiesInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + VirtualMachinePropertiesImpl( + VirtualMachinePropertiesInner innerObject, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public HardwareProfile hardwareProfile() { + return this.innerModel().hardwareProfile(); + } + + public StorageProfile storageProfile() { + return this.innerModel().storageProfile(); + } + + public AdditionalCapabilities additionalCapabilities() { + return this.innerModel().additionalCapabilities(); + } + + public OSProfile osProfile() { + return this.innerModel().osProfile(); + } + + public NetworkProfile networkProfile() { + return this.innerModel().networkProfile(); + } + + public SecurityProfile securityProfile() { + return this.innerModel().securityProfile(); + } + + public DiagnosticsProfile diagnosticsProfile() { + return this.innerModel().diagnosticsProfile(); + } + + public SubResource availabilitySet() { + return this.innerModel().availabilitySet(); + } + + public SubResource virtualMachineScaleSet() { + return this.innerModel().virtualMachineScaleSet(); + } + + public SubResource proximityPlacementGroup() { + return this.innerModel().proximityPlacementGroup(); + } + + public VirtualMachinePriorityTypes priority() { + return this.innerModel().priority(); + } + + public VirtualMachineEvictionPolicyTypes evictionPolicy() { + return this.innerModel().evictionPolicy(); + } + + public BillingProfile billingProfile() { + return this.innerModel().billingProfile(); + } + + public SubResource host() { + return this.innerModel().host(); + } + + public SubResource hostGroup() { + return this.innerModel().hostGroup(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public VirtualMachineInstanceView instanceView() { + VirtualMachineInstanceViewInner inner = this.innerModel().instanceView(); + if (inner != null) { + return new VirtualMachineInstanceViewImpl(inner, this.manager()); + } else { + return null; + } + } + + public String licenseType() { + return this.innerModel().licenseType(); + } + + public String vmId() { + return this.innerModel().vmId(); + } + + public String extensionsTimeBudget() { + return this.innerModel().extensionsTimeBudget(); + } + + public Integer platformFaultDomain() { + return this.innerModel().platformFaultDomain(); + } + + public ScheduledEventsProfile scheduledEventsProfile() { + return this.innerModel().scheduledEventsProfile(); + } + + public String userData() { + return this.innerModel().userData(); + } + + public CapacityReservationProfile capacityReservation() { + return this.innerModel().capacityReservation(); + } + + public ApplicationProfile applicationProfile() { + return this.innerModel().applicationProfile(); + } + + public OffsetDateTime timeCreated() { + return this.innerModel().timeCreated(); + } + + public VirtualMachinePropertiesInner 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..3d5d95f08c45a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineRunCommandImpl.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.VirtualMachineRunCommandInner; +import com.azure.resourcemanager.compute.generated.models.RunCommandInputParameter; +import com.azure.resourcemanager.compute.generated.models.RunCommandManagedIdentity; +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 RunCommandManagedIdentity outputBlobManagedIdentity() { + return this.innerModel().outputBlobManagedIdentity(); + } + + public RunCommandManagedIdentity errorBlobManagedIdentity() { + return this.innerModel().errorBlobManagedIdentity(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public VirtualMachineRunCommandInstanceView instanceView() { + return this.innerModel().instanceView(); + } + + public Boolean treatFailureAsDeploymentFailure() { + return this.innerModel().treatFailureAsDeploymentFailure(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + 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; + } + } + + public VirtualMachineRunCommandImpl withOutputBlobManagedIdentity( + RunCommandManagedIdentity outputBlobManagedIdentity) { + if (isInCreateMode()) { + this.innerModel().withOutputBlobManagedIdentity(outputBlobManagedIdentity); + return this; + } else { + this.updateRunCommand.withOutputBlobManagedIdentity(outputBlobManagedIdentity); + return this; + } + } + + public VirtualMachineRunCommandImpl withErrorBlobManagedIdentity( + RunCommandManagedIdentity errorBlobManagedIdentity) { + if (isInCreateMode()) { + this.innerModel().withErrorBlobManagedIdentity(errorBlobManagedIdentity); + return this; + } else { + this.updateRunCommand.withErrorBlobManagedIdentity(errorBlobManagedIdentity); + return this; + } + } + + public VirtualMachineRunCommandImpl withTreatFailureAsDeploymentFailure(Boolean treatFailureAsDeploymentFailure) { + if (isInCreateMode()) { + this.innerModel().withTreatFailureAsDeploymentFailure(treatFailureAsDeploymentFailure); + return this; + } else { + this.updateRunCommand.withTreatFailureAsDeploymentFailure(treatFailureAsDeploymentFailure); + 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..7859e41a798ce --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineRunCommandsClientImpl.java @@ -0,0 +1,1911 @@ +// Copyright (c) Microsoft Corporation. All rights 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.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 { + /** 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") + public 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json, text/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + location, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all available run commands for a subscription in a location. + * + * @param location The location upon which run commands is queried. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 = "2023-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json, text/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + location, + commandId, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets specific run command for a subscription in a location. + * + * @param location The location upon which run commands is queried. + * @param commandId The command id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specific run command for a subscription in a location along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2023-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String location, String commandId) { + return getWithResponseAsync(location, commandId).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String location, String commandId, Context context) { + return getWithResponseAsync(location, commandId, context).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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 getWithResponse(location, commandId, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json, text/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + vmName, + runCommandName, + apiVersion, + this.client.getSubscriptionId(), + runCommand, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to create or update the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be created or updated. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 = "2023-03-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 the {@link PollerFlux} for polling of describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + 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 the {@link PollerFlux} for polling of describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualMachineRunCommandInner> beginCreateOrUpdate( + String resourceGroupName, String vmName, String runCommandName, VirtualMachineRunCommandInner runCommand) { + return this.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 the {@link SyncPoller} for polling of describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualMachineRunCommandInner> beginCreateOrUpdate( + String resourceGroupName, + String vmName, + String runCommandName, + VirtualMachineRunCommandInner runCommand, + Context context) { + return this + .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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json, text/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + vmName, + runCommandName, + apiVersion, + this.client.getSubscriptionId(), + runCommand, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to update the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be updated. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 = "2023-03-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 the {@link PollerFlux} for polling of describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + 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 the {@link PollerFlux} for polling of describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualMachineRunCommandInner> beginUpdate( + String resourceGroupName, String vmName, String runCommandName, VirtualMachineRunCommandUpdate runCommand) { + return this.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 the {@link SyncPoller} for polling of describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualMachineRunCommandInner> beginUpdate( + String resourceGroupName, + String vmName, + String runCommandName, + VirtualMachineRunCommandUpdate runCommand, + Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json, text/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + vmName, + runCommandName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to delete the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be deleted. + * @param runCommandName The name of the virtual machine run command. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String vmName, String runCommandName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String vmName, String runCommandName, Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json, text/json"; + return FluxUtil + .withContext( + context -> + service + .getByVirtualMachine( + this.client.getEndpoint(), + resourceGroupName, + vmName, + runCommandName, + expand, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to get the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the run command. + * @param runCommandName The name of the virtual machine run command. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 = "2023-03-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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByVirtualMachineAsync( + String resourceGroupName, String vmName, String runCommandName) { + final String expand = null; + return getByVirtualMachineWithResponseAsync(resourceGroupName, vmName, runCommandName, expand) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @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 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 getByVirtualMachineWithResponse(resourceGroupName, vmName, runCommandName, expand, Context.NONE) + .getValue(); + } + + /** + * 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json, text/json"; + return FluxUtil + .withContext( + context -> + service + .listByVirtualMachine( + this.client.getEndpoint(), + resourceGroupName, + vmName, + expand, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to get all run commands of a Virtual Machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the run command. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List run command operation response along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 = "2023-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json, text/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json, 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 URL to get the next list of items + *

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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByVirtualMachineNextSinglePageAsync( + String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json, text/json"; + return FluxUtil + .withContext( + context -> service.listByVirtualMachineNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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..bb9141658f0cb --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineRunCommandsImpl.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.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; + +public final class VirtualMachineRunCommandsImpl implements VirtualMachineRunCommands { + private static 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 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 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 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 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 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 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..28e3bfa923165 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetExtensionImpl.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.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetExtensionInner; +import com.azure.resourcemanager.compute.generated.models.KeyVaultSecretReference; +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 Boolean suppressFailures() { + return this.innerModel().suppressFailures(); + } + + public KeyVaultSecretReference protectedSettingsFromKeyVault() { + return this.innerModel().protectedSettingsFromKeyVault(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + 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; + } + } + + public VirtualMachineScaleSetExtensionImpl withSuppressFailures(Boolean suppressFailures) { + if (isInCreateMode()) { + this.innerModel().withSuppressFailures(suppressFailures); + return this; + } else { + this.updateExtensionParameters.withSuppressFailures(suppressFailures); + return this; + } + } + + public VirtualMachineScaleSetExtensionImpl withProtectedSettingsFromKeyVault( + KeyVaultSecretReference protectedSettingsFromKeyVault) { + if (isInCreateMode()) { + this.innerModel().withProtectedSettingsFromKeyVault(protectedSettingsFromKeyVault); + return this; + } else { + this.updateExtensionParameters.withProtectedSettingsFromKeyVault(protectedSettingsFromKeyVault); + 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..10a836101acad --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetExtensionsClientImpl.java @@ -0,0 +1,1533 @@ +// Copyright (c) Microsoft Corporation. All rights 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.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.ApiErrorException; +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 { + /** 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") + public interface VirtualMachineScaleSetExtensionsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ApiErrorException.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(ApiErrorException.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({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ApiErrorException.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, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.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(ApiErrorException.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(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 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 ApiErrorException thrown if the 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + vmssExtensionName, + apiVersion, + this.client.getSubscriptionId(), + extensionParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to create or update an extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. + * @param vmssExtensionName The name of the VM scale set extension. + * @param extensionParameters Parameters supplied to the Create VM scale set Extension operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2023-03-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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of describes a Virtual Machine Scale Set Extension. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of describes a Virtual Machine Scale Set Extension. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes a Virtual Machine Scale Set Extension. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualMachineScaleSetExtensionInner> + beginCreateOrUpdate( + String resourceGroupName, + String vmScaleSetName, + String vmssExtensionName, + VirtualMachineScaleSetExtensionInner extensionParameters) { + return this + .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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes a Virtual Machine Scale Set Extension. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualMachineScaleSetExtensionInner> + beginCreateOrUpdate( + String resourceGroupName, + String vmScaleSetName, + String vmssExtensionName, + VirtualMachineScaleSetExtensionInner extensionParameters, + Context context) { + return this + .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 ApiErrorException thrown if the 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 on successful completion of {@link Mono}. + */ + @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 ApiErrorException thrown if the 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 on successful completion of {@link Mono}. + */ + @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 ApiErrorException thrown if the 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 ApiErrorException thrown if the 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 ApiErrorException thrown if the 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + vmssExtensionName, + apiVersion, + this.client.getSubscriptionId(), + extensionParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to update an extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be updated. + * @param vmssExtensionName The name of the VM scale set extension. + * @param extensionParameters Parameters supplied to the Update VM scale set Extension operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2023-03-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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of describes a Virtual Machine Scale Set Extension. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of describes a Virtual Machine Scale Set Extension. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes a Virtual Machine Scale Set Extension. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualMachineScaleSetExtensionInner> + beginUpdate( + String resourceGroupName, + String vmScaleSetName, + String vmssExtensionName, + VirtualMachineScaleSetExtensionUpdate extensionParameters) { + return this + .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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes a Virtual Machine Scale Set Extension. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualMachineScaleSetExtensionInner> + beginUpdate( + String resourceGroupName, + String vmScaleSetName, + String vmssExtensionName, + VirtualMachineScaleSetExtensionUpdate extensionParameters, + Context context) { + return this + .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 ApiErrorException thrown if the 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 on successful completion of {@link Mono}. + */ + @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 ApiErrorException thrown if the 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 on successful completion of {@link Mono}. + */ + @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 ApiErrorException thrown if the 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 ApiErrorException thrown if the 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String 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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + vmssExtensionName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to delete the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be deleted. + * @param vmssExtensionName The name of the VM scale set extension. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String 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 = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + vmssExtensionName, + apiVersion, + this.client.getSubscriptionId(), + accept, + 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String vmScaleSetName, String vmssExtensionName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, vmScaleSetName, vmssExtensionName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String vmScaleSetName, String vmssExtensionName) { + return this.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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String vmScaleSetName, String vmssExtensionName, Context context) { + return this.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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String 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 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 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 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 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 ApiErrorException thrown if the 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + vmssExtensionName, + expand, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to get the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set containing the extension. + * @param vmssExtensionName The name of the VM scale set extension. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2023-03-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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String vmScaleSetName, String vmssExtensionName) { + final String expand = null; + return getWithResponseAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, expand) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 ApiErrorException thrown if the 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 along with {@link Response}. + */ + @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(); + } + + /** + * 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 ApiErrorException thrown if the 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 getWithResponse(resourceGroupName, vmScaleSetName, vmssExtensionName, expand, Context.NONE).getValue(); + } + + /** + * 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 ApiErrorException thrown if 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of all extensions in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set containing the extension. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 = "2023-03-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 ApiErrorException thrown if 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 as paginated response with {@link PagedFlux}. + */ + @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 ApiErrorException thrown if 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 as paginated response with {@link PagedFlux}. + */ + @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 ApiErrorException thrown if 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 as paginated response with {@link PagedIterable}. + */ + @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 ApiErrorException thrown if 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 as paginated response with {@link PagedIterable}. + */ + @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 URL to get the next list of items + *

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 VM scale set extension operation response along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/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..b9c00d7163e28 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetExtensionsImpl.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.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; + +public final class VirtualMachineScaleSetExtensionsImpl implements VirtualMachineScaleSetExtensions { + private static 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 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 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 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..84efc138f59d1 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetImpl.java @@ -0,0 +1,605 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetInner; +import com.azure.resourcemanager.compute.generated.models.AdditionalCapabilities; +import com.azure.resourcemanager.compute.generated.models.AutomaticRepairsPolicy; +import com.azure.resourcemanager.compute.generated.models.ExpandTypesForGetVMScaleSets; +import com.azure.resourcemanager.compute.generated.models.ExtendedLocation; +import com.azure.resourcemanager.compute.generated.models.OrchestrationMode; +import com.azure.resourcemanager.compute.generated.models.OrchestrationServiceStateInput; +import com.azure.resourcemanager.compute.generated.models.Plan; +import com.azure.resourcemanager.compute.generated.models.PriorityMixPolicy; +import com.azure.resourcemanager.compute.generated.models.ScaleInPolicy; +import com.azure.resourcemanager.compute.generated.models.Sku; +import com.azure.resourcemanager.compute.generated.models.SpotRestorePolicy; +import com.azure.resourcemanager.compute.generated.models.UpgradePolicy; +import com.azure.resourcemanager.compute.generated.models.VMScaleSetConvertToSinglePlacementGroupInput; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSet; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetIdentity; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetReimageParameters; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetUpdate; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetUpdateVMProfile; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMInstanceIDs; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMInstanceRequiredIDs; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMProfile; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class VirtualMachineScaleSetImpl + implements VirtualMachineScaleSet, VirtualMachineScaleSet.Definition, VirtualMachineScaleSet.Update { + private VirtualMachineScaleSetInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Sku sku() { + return this.innerModel().sku(); + } + + public Plan plan() { + return this.innerModel().plan(); + } + + public VirtualMachineScaleSetIdentity identity() { + return this.innerModel().identity(); + } + + public List zones() { + List inner = this.innerModel().zones(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ExtendedLocation extendedLocation() { + return this.innerModel().extendedLocation(); + } + + public UpgradePolicy upgradePolicy() { + return this.innerModel().upgradePolicy(); + } + + public AutomaticRepairsPolicy automaticRepairsPolicy() { + return this.innerModel().automaticRepairsPolicy(); + } + + public VirtualMachineScaleSetVMProfile virtualMachineProfile() { + return this.innerModel().virtualMachineProfile(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public Boolean overprovision() { + return this.innerModel().overprovision(); + } + + public Boolean doNotRunExtensionsOnOverprovisionedVMs() { + return this.innerModel().doNotRunExtensionsOnOverprovisionedVMs(); + } + + public String uniqueId() { + return this.innerModel().uniqueId(); + } + + public Boolean singlePlacementGroup() { + return this.innerModel().singlePlacementGroup(); + } + + public Boolean zoneBalance() { + return this.innerModel().zoneBalance(); + } + + public Integer platformFaultDomainCount() { + return this.innerModel().platformFaultDomainCount(); + } + + public SubResource proximityPlacementGroup() { + return this.innerModel().proximityPlacementGroup(); + } + + public SubResource hostGroup() { + return this.innerModel().hostGroup(); + } + + public AdditionalCapabilities additionalCapabilities() { + return this.innerModel().additionalCapabilities(); + } + + public ScaleInPolicy scaleInPolicy() { + return this.innerModel().scaleInPolicy(); + } + + public OrchestrationMode orchestrationMode() { + return this.innerModel().orchestrationMode(); + } + + public SpotRestorePolicy spotRestorePolicy() { + return this.innerModel().spotRestorePolicy(); + } + + public PriorityMixPolicy priorityMixPolicy() { + return this.innerModel().priorityMixPolicy(); + } + + public OffsetDateTime timeCreated() { + return this.innerModel().timeCreated(); + } + + public Boolean constrainedMaximumCapacity() { + return this.innerModel().constrainedMaximumCapacity(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public VirtualMachineScaleSetInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String vmScaleSetName; + + private VirtualMachineScaleSetUpdate updateParameters; + + public VirtualMachineScaleSetImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public VirtualMachineScaleSet create() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualMachineScaleSets() + .createOrUpdate(resourceGroupName, vmScaleSetName, this.innerModel(), Context.NONE); + return this; + } + + public VirtualMachineScaleSet create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualMachineScaleSets() + .createOrUpdate(resourceGroupName, vmScaleSetName, this.innerModel(), context); + return this; + } + + VirtualMachineScaleSetImpl(String name, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = new VirtualMachineScaleSetInner(); + this.serviceManager = serviceManager; + this.vmScaleSetName = name; + } + + public VirtualMachineScaleSetImpl update() { + this.updateParameters = new VirtualMachineScaleSetUpdate(); + return this; + } + + public VirtualMachineScaleSet apply() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualMachineScaleSets() + .update(resourceGroupName, vmScaleSetName, updateParameters, Context.NONE); + return this; + } + + public VirtualMachineScaleSet apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualMachineScaleSets() + .update(resourceGroupName, vmScaleSetName, updateParameters, context); + return this; + } + + VirtualMachineScaleSetImpl( + VirtualMachineScaleSetInner innerObject, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.vmScaleSetName = Utils.getValueFromIdByName(innerObject.id(), "virtualMachineScaleSets"); + } + + public VirtualMachineScaleSet refresh() { + ExpandTypesForGetVMScaleSets localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getVirtualMachineScaleSets() + .getByResourceGroupWithResponse(resourceGroupName, vmScaleSetName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public VirtualMachineScaleSet refresh(Context context) { + ExpandTypesForGetVMScaleSets localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getVirtualMachineScaleSets() + .getByResourceGroupWithResponse(resourceGroupName, vmScaleSetName, localExpand, context) + .getValue(); + return this; + } + + public void deallocate() { + serviceManager.virtualMachineScaleSets().deallocate(resourceGroupName, vmScaleSetName); + } + + public void deallocate(Boolean hibernate, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, Context context) { + serviceManager + .virtualMachineScaleSets() + .deallocate(resourceGroupName, vmScaleSetName, hibernate, vmInstanceIDs, context); + } + + public void deleteInstances(VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs) { + serviceManager.virtualMachineScaleSets().deleteInstances(resourceGroupName, vmScaleSetName, vmInstanceIDs); + } + + public void deleteInstances( + VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs, Boolean forceDeletion, Context context) { + serviceManager + .virtualMachineScaleSets() + .deleteInstances(resourceGroupName, vmScaleSetName, vmInstanceIDs, forceDeletion, context); + } + + public void powerOff() { + serviceManager.virtualMachineScaleSets().powerOff(resourceGroupName, vmScaleSetName); + } + + public void powerOff(Boolean skipShutdown, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, Context context) { + serviceManager + .virtualMachineScaleSets() + .powerOff(resourceGroupName, vmScaleSetName, skipShutdown, vmInstanceIDs, context); + } + + public void restart() { + serviceManager.virtualMachineScaleSets().restart(resourceGroupName, vmScaleSetName); + } + + public void restart(VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, Context context) { + serviceManager.virtualMachineScaleSets().restart(resourceGroupName, vmScaleSetName, vmInstanceIDs, context); + } + + public void start() { + serviceManager.virtualMachineScaleSets().start(resourceGroupName, vmScaleSetName); + } + + public void start(VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, Context context) { + serviceManager.virtualMachineScaleSets().start(resourceGroupName, vmScaleSetName, vmInstanceIDs, context); + } + + public void reapply() { + serviceManager.virtualMachineScaleSets().reapply(resourceGroupName, vmScaleSetName); + } + + public void reapply(Context context) { + serviceManager.virtualMachineScaleSets().reapply(resourceGroupName, vmScaleSetName, context); + } + + public void redeploy() { + serviceManager.virtualMachineScaleSets().redeploy(resourceGroupName, vmScaleSetName); + } + + public void redeploy(VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, Context context) { + serviceManager.virtualMachineScaleSets().redeploy(resourceGroupName, vmScaleSetName, vmInstanceIDs, context); + } + + public void performMaintenance() { + serviceManager.virtualMachineScaleSets().performMaintenance(resourceGroupName, vmScaleSetName); + } + + public void performMaintenance(VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, Context context) { + serviceManager + .virtualMachineScaleSets() + .performMaintenance(resourceGroupName, vmScaleSetName, vmInstanceIDs, context); + } + + public void updateInstances(VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs) { + serviceManager.virtualMachineScaleSets().updateInstances(resourceGroupName, vmScaleSetName, vmInstanceIDs); + } + + public void updateInstances(VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs, Context context) { + serviceManager + .virtualMachineScaleSets() + .updateInstances(resourceGroupName, vmScaleSetName, vmInstanceIDs, context); + } + + public void reimage() { + serviceManager.virtualMachineScaleSets().reimage(resourceGroupName, vmScaleSetName); + } + + public void reimage(VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput, Context context) { + serviceManager + .virtualMachineScaleSets() + .reimage(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput, context); + } + + public void reimageAll() { + serviceManager.virtualMachineScaleSets().reimageAll(resourceGroupName, vmScaleSetName); + } + + public void reimageAll(VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, Context context) { + serviceManager.virtualMachineScaleSets().reimageAll(resourceGroupName, vmScaleSetName, vmInstanceIDs, context); + } + + public Response convertToSinglePlacementGroupWithResponse( + VMScaleSetConvertToSinglePlacementGroupInput parameters, Context context) { + return serviceManager + .virtualMachineScaleSets() + .convertToSinglePlacementGroupWithResponse(resourceGroupName, vmScaleSetName, parameters, context); + } + + public void convertToSinglePlacementGroup(VMScaleSetConvertToSinglePlacementGroupInput parameters) { + serviceManager + .virtualMachineScaleSets() + .convertToSinglePlacementGroup(resourceGroupName, vmScaleSetName, parameters); + } + + public void setOrchestrationServiceState(OrchestrationServiceStateInput parameters) { + serviceManager + .virtualMachineScaleSets() + .setOrchestrationServiceState(resourceGroupName, vmScaleSetName, parameters); + } + + public void setOrchestrationServiceState(OrchestrationServiceStateInput parameters, Context context) { + serviceManager + .virtualMachineScaleSets() + .setOrchestrationServiceState(resourceGroupName, vmScaleSetName, parameters, context); + } + + public VirtualMachineScaleSetImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public VirtualMachineScaleSetImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public VirtualMachineScaleSetImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public VirtualMachineScaleSetImpl withSku(Sku sku) { + if (isInCreateMode()) { + this.innerModel().withSku(sku); + return this; + } else { + this.updateParameters.withSku(sku); + return this; + } + } + + public VirtualMachineScaleSetImpl withPlan(Plan plan) { + if (isInCreateMode()) { + this.innerModel().withPlan(plan); + return this; + } else { + this.updateParameters.withPlan(plan); + return this; + } + } + + public VirtualMachineScaleSetImpl withIdentity(VirtualMachineScaleSetIdentity identity) { + if (isInCreateMode()) { + this.innerModel().withIdentity(identity); + return this; + } else { + this.updateParameters.withIdentity(identity); + return this; + } + } + + public VirtualMachineScaleSetImpl withZones(List zones) { + this.innerModel().withZones(zones); + return this; + } + + public VirtualMachineScaleSetImpl withExtendedLocation(ExtendedLocation extendedLocation) { + this.innerModel().withExtendedLocation(extendedLocation); + return this; + } + + public VirtualMachineScaleSetImpl withUpgradePolicy(UpgradePolicy upgradePolicy) { + if (isInCreateMode()) { + this.innerModel().withUpgradePolicy(upgradePolicy); + return this; + } else { + this.updateParameters.withUpgradePolicy(upgradePolicy); + return this; + } + } + + public VirtualMachineScaleSetImpl withAutomaticRepairsPolicy(AutomaticRepairsPolicy automaticRepairsPolicy) { + if (isInCreateMode()) { + this.innerModel().withAutomaticRepairsPolicy(automaticRepairsPolicy); + return this; + } else { + this.updateParameters.withAutomaticRepairsPolicy(automaticRepairsPolicy); + return this; + } + } + + public VirtualMachineScaleSetImpl withVirtualMachineProfile(VirtualMachineScaleSetVMProfile virtualMachineProfile) { + this.innerModel().withVirtualMachineProfile(virtualMachineProfile); + return this; + } + + public VirtualMachineScaleSetImpl withOverprovision(Boolean overprovision) { + if (isInCreateMode()) { + this.innerModel().withOverprovision(overprovision); + return this; + } else { + this.updateParameters.withOverprovision(overprovision); + return this; + } + } + + public VirtualMachineScaleSetImpl withDoNotRunExtensionsOnOverprovisionedVMs( + Boolean doNotRunExtensionsOnOverprovisionedVMs) { + if (isInCreateMode()) { + this.innerModel().withDoNotRunExtensionsOnOverprovisionedVMs(doNotRunExtensionsOnOverprovisionedVMs); + return this; + } else { + this.updateParameters.withDoNotRunExtensionsOnOverprovisionedVMs(doNotRunExtensionsOnOverprovisionedVMs); + return this; + } + } + + public VirtualMachineScaleSetImpl withSinglePlacementGroup(Boolean singlePlacementGroup) { + if (isInCreateMode()) { + this.innerModel().withSinglePlacementGroup(singlePlacementGroup); + return this; + } else { + this.updateParameters.withSinglePlacementGroup(singlePlacementGroup); + return this; + } + } + + public VirtualMachineScaleSetImpl withZoneBalance(Boolean zoneBalance) { + this.innerModel().withZoneBalance(zoneBalance); + return this; + } + + public VirtualMachineScaleSetImpl withPlatformFaultDomainCount(Integer platformFaultDomainCount) { + this.innerModel().withPlatformFaultDomainCount(platformFaultDomainCount); + return this; + } + + public VirtualMachineScaleSetImpl withProximityPlacementGroup(SubResource proximityPlacementGroup) { + if (isInCreateMode()) { + this.innerModel().withProximityPlacementGroup(proximityPlacementGroup); + return this; + } else { + this.updateParameters.withProximityPlacementGroup(proximityPlacementGroup); + return this; + } + } + + public VirtualMachineScaleSetImpl withHostGroup(SubResource hostGroup) { + this.innerModel().withHostGroup(hostGroup); + return this; + } + + public VirtualMachineScaleSetImpl withAdditionalCapabilities(AdditionalCapabilities additionalCapabilities) { + if (isInCreateMode()) { + this.innerModel().withAdditionalCapabilities(additionalCapabilities); + return this; + } else { + this.updateParameters.withAdditionalCapabilities(additionalCapabilities); + return this; + } + } + + public VirtualMachineScaleSetImpl withScaleInPolicy(ScaleInPolicy scaleInPolicy) { + if (isInCreateMode()) { + this.innerModel().withScaleInPolicy(scaleInPolicy); + return this; + } else { + this.updateParameters.withScaleInPolicy(scaleInPolicy); + return this; + } + } + + public VirtualMachineScaleSetImpl withOrchestrationMode(OrchestrationMode orchestrationMode) { + this.innerModel().withOrchestrationMode(orchestrationMode); + return this; + } + + public VirtualMachineScaleSetImpl withSpotRestorePolicy(SpotRestorePolicy spotRestorePolicy) { + if (isInCreateMode()) { + this.innerModel().withSpotRestorePolicy(spotRestorePolicy); + return this; + } else { + this.updateParameters.withSpotRestorePolicy(spotRestorePolicy); + return this; + } + } + + public VirtualMachineScaleSetImpl withPriorityMixPolicy(PriorityMixPolicy priorityMixPolicy) { + if (isInCreateMode()) { + this.innerModel().withPriorityMixPolicy(priorityMixPolicy); + return this; + } else { + this.updateParameters.withPriorityMixPolicy(priorityMixPolicy); + return this; + } + } + + public VirtualMachineScaleSetImpl withConstrainedMaximumCapacity(Boolean constrainedMaximumCapacity) { + this.innerModel().withConstrainedMaximumCapacity(constrainedMaximumCapacity); + 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..b8c9b559db663 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetRollingUpgradesClientImpl.java @@ -0,0 +1,992 @@ +// Copyright (c) Microsoft Corporation. All rights 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.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.compute.generated.fluent.VirtualMachineScaleSetRollingUpgradesClient; +import com.azure.resourcemanager.compute.generated.fluent.models.RollingUpgradeStatusInfoInner; +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 + * VirtualMachineScaleSetRollingUpgradesClient. + */ +public final class VirtualMachineScaleSetRollingUpgradesClientImpl + implements VirtualMachineScaleSetRollingUpgradesClient { + /** 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") + public interface VirtualMachineScaleSetRollingUpgradesService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/rollingUpgrades/cancel") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> cancel( + @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"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/osRollingUpgrade") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> startOSUpgrade( + @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"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensionRollingUpgrade") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> startExtensionUpgrade( + @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}/rollingUpgrades/latest") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> 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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .cancel( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Cancels the current virtual machine scale set rolling upgrade. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> 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 = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .cancel( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + accept, + 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginCancelAsync(String resourceGroupName, String vmScaleSetName) { + Mono>> mono = cancelWithResponseAsync(resourceGroupName, vmScaleSetName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginCancel(String resourceGroupName, String vmScaleSetName) { + return this.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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginCancel( + String resourceGroupName, String vmScaleSetName, Context context) { + return this.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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono 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 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 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 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 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> 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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .startOSUpgrade( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image + * OS version. Instances which are already running the latest available OS version are not affected. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> 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 = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .startOSUpgrade( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + accept, + 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginStartOSUpgradeAsync( + String resourceGroupName, String vmScaleSetName) { + Mono>> mono = startOSUpgradeWithResponseAsync(resourceGroupName, vmScaleSetName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStartOSUpgrade(String resourceGroupName, String vmScaleSetName) { + return this.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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStartOSUpgrade( + String resourceGroupName, String vmScaleSetName, Context context) { + return this.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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono 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 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 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 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 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> 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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .startExtensionUpgrade( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest + * available extension version. Instances which are already running the latest extension versions are not affected. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> 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 = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .startExtensionUpgrade( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + accept, + 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginStartExtensionUpgradeAsync( + String resourceGroupName, String vmScaleSetName) { + Mono>> mono = + startExtensionUpgradeWithResponseAsync(resourceGroupName, vmScaleSetName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStartExtensionUpgrade( + String resourceGroupName, String vmScaleSetName) { + return this.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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStartExtensionUpgrade( + String resourceGroupName, String vmScaleSetName, Context context) { + return this.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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono 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 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 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 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 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 ApiErrorException 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 along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getLatest( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the status of the latest virtual machine scale set rolling upgrade. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 = "2023-03-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 ApiErrorException 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 on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getLatestAsync(String resourceGroupName, String vmScaleSetName) { + return getLatestWithResponseAsync(resourceGroupName, vmScaleSetName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 ApiErrorException 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getLatestWithResponse( + String resourceGroupName, String vmScaleSetName, Context context) { + return getLatestWithResponseAsync(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 ApiErrorException 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 getLatestWithResponse(resourceGroupName, vmScaleSetName, Context.NONE).getValue(); + } +} 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..25af45949ac85 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetRollingUpgradesImpl.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.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; + +public final class VirtualMachineScaleSetRollingUpgradesImpl implements VirtualMachineScaleSetRollingUpgrades { + private static 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 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; + } + } + + 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; + } + } + + 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..2bde56f7e7d4f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetVMExtensionImpl.java @@ -0,0 +1,351 @@ +// Copyright (c) Microsoft Corporation. All rights 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.VirtualMachineScaleSetVMExtensionInner; +import com.azure.resourcemanager.compute.generated.models.KeyVaultSecretReference; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineExtensionInstanceView; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMExtension; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMExtensionUpdate; +import java.util.Collections; +import java.util.List; + +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 location() { + return this.innerModel().location(); + } + + 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 Boolean suppressFailures() { + return this.innerModel().suppressFailures(); + } + + public KeyVaultSecretReference protectedSettingsFromKeyVault() { + return this.innerModel().protectedSettingsFromKeyVault(); + } + + public List provisionAfterExtensions() { + List inner = this.innerModel().provisionAfterExtensions(); + 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 String resourceGroupName() { + return resourceGroupName; + } + + 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 withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public VirtualMachineScaleSetVMExtensionImpl withRegion(String location) { + this.innerModel().withLocation(location); + 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; + } + + public VirtualMachineScaleSetVMExtensionImpl withSuppressFailures(Boolean suppressFailures) { + if (isInCreateMode()) { + this.innerModel().withSuppressFailures(suppressFailures); + return this; + } else { + this.updateExtensionParameters.withSuppressFailures(suppressFailures); + return this; + } + } + + public VirtualMachineScaleSetVMExtensionImpl withProtectedSettingsFromKeyVault( + KeyVaultSecretReference protectedSettingsFromKeyVault) { + if (isInCreateMode()) { + this.innerModel().withProtectedSettingsFromKeyVault(protectedSettingsFromKeyVault); + return this; + } else { + this.updateExtensionParameters.withProtectedSettingsFromKeyVault(protectedSettingsFromKeyVault); + return this; + } + } + + public VirtualMachineScaleSetVMExtensionImpl withProvisionAfterExtensions(List provisionAfterExtensions) { + this.innerModel().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/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..a09f16f6ad42f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetVMExtensionsClientImpl.java @@ -0,0 +1,1540 @@ +// Copyright (c) Microsoft Corporation. All rights 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.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 { + /** 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") + public 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + vmExtensionName, + apiVersion, + this.client.getSubscriptionId(), + extensionParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to create or update the VMSS VM extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a VMSS VM Extension along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-03-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 the {@link PollerFlux} for polling of describes a VMSS VM Extension. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + 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 the {@link PollerFlux} for polling of describes a VMSS VM Extension. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of describes a VMSS VM Extension. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualMachineScaleSetVMExtensionInner> + beginCreateOrUpdate( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String vmExtensionName, + VirtualMachineScaleSetVMExtensionInner extensionParameters) { + return this + .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 the {@link SyncPoller} for polling of describes a VMSS VM Extension. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualMachineScaleSetVMExtensionInner> + beginCreateOrUpdate( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String vmExtensionName, + VirtualMachineScaleSetVMExtensionInner extensionParameters, + Context context) { + return this + .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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + vmExtensionName, + apiVersion, + this.client.getSubscriptionId(), + extensionParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to update the VMSS VM extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a VMSS VM Extension along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-03-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 the {@link PollerFlux} for polling of describes a VMSS VM Extension. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + 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 the {@link PollerFlux} for polling of describes a VMSS VM Extension. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of describes a VMSS VM Extension. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualMachineScaleSetVMExtensionInner> + beginUpdate( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String vmExtensionName, + VirtualMachineScaleSetVMExtensionUpdate extensionParameters) { + return this + .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 the {@link SyncPoller} for polling of describes a VMSS VM Extension. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualMachineScaleSetVMExtensionInner> + beginUpdate( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String vmExtensionName, + VirtualMachineScaleSetVMExtensionUpdate extensionParameters, + Context context) { + return this + .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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + vmExtensionName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to delete the VMSS VM extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmExtensionName The name of the virtual machine extension. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName, Context context) { + return this + .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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + vmExtensionName, + expand, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to get the VMSS VM extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmExtensionName The name of the virtual machine extension. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a VMSS VM Extension along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-03-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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 on successful completion of {@link Mono}. + */ + @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(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @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 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 getWithResponse(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, expand, Context.NONE) + .getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + expand, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to get all extensions of an instance in Virtual Machine Scaleset. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List VMSS VM Extension operation response along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2023-03-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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync( + String resourceGroupName, String vmScaleSetName, String instanceId) { + final String expand = null; + return listWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, expand) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link 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(); + } + + /** + * 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 listWithResponse(resourceGroupName, vmScaleSetName, instanceId, expand, Context.NONE).getValue(); + } +} 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..222456f579367 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetVMExtensionsImpl.java @@ -0,0 +1,262 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.http.rest.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; + +public final class VirtualMachineScaleSetVMExtensionsImpl implements VirtualMachineScaleSetVMExtensions { + private static 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 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 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 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 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 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..5e973d23e2b20 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetVMImpl.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights 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.VirtualMachineIdentity; +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.time.OffsetDateTime; +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 VirtualMachineIdentity identity() { + return this.innerModel().identity(); + } + + public Boolean latestModelApplied() { + return this.innerModel().latestModelApplied(); + } + + public String vmId() { + return this.innerModel().vmId(); + } + + public VirtualMachineScaleSetVMInstanceView instanceView() { + VirtualMachineScaleSetVMInstanceViewInner inner = this.innerModel().instanceView(); + if (inner != null) { + return new VirtualMachineScaleSetVMInstanceViewImpl(inner, this.manager()); + } else { + return null; + } + } + + public HardwareProfile hardwareProfile() { + return this.innerModel().hardwareProfile(); + } + + public StorageProfile storageProfile() { + return this.innerModel().storageProfile(); + } + + public AdditionalCapabilities additionalCapabilities() { + return this.innerModel().additionalCapabilities(); + } + + public OSProfile osProfile() { + return this.innerModel().osProfile(); + } + + public SecurityProfile securityProfile() { + return this.innerModel().securityProfile(); + } + + public NetworkProfile networkProfile() { + return this.innerModel().networkProfile(); + } + + public VirtualMachineScaleSetVMNetworkProfileConfiguration networkProfileConfiguration() { + return this.innerModel().networkProfileConfiguration(); + } + + public DiagnosticsProfile diagnosticsProfile() { + return this.innerModel().diagnosticsProfile(); + } + + public SubResource availabilitySet() { + return this.innerModel().availabilitySet(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public String licenseType() { + return this.innerModel().licenseType(); + } + + public String modelDefinitionApplied() { + return this.innerModel().modelDefinitionApplied(); + } + + public VirtualMachineScaleSetVMProtectionPolicy protectionPolicy() { + return this.innerModel().protectionPolicy(); + } + + public String userData() { + return this.innerModel().userData(); + } + + public OffsetDateTime timeCreated() { + return this.innerModel().timeCreated(); + } + + 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..943545656795e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetVMInstanceViewImpl.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.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.HyperVGeneration; +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 String computerName() { + return this.innerModel().computerName(); + } + + public String osName() { + return this.innerModel().osName(); + } + + public String osVersion() { + return this.innerModel().osVersion(); + } + + public HyperVGeneration hyperVGeneration() { + return this.innerModel().hyperVGeneration(); + } + + 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/VirtualMachineScaleSetVMPropertiesImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetVMPropertiesImpl.java new file mode 100644 index 0000000000000..ec58b432027f4 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetVMPropertiesImpl.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.core.management.SubResource; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetVMInstanceViewInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetVMPropertiesInner; +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.SecurityProfile; +import com.azure.resourcemanager.compute.generated.models.StorageProfile; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMInstanceView; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMNetworkProfileConfiguration; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMProperties; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMProtectionPolicy; +import java.time.OffsetDateTime; + +public final class VirtualMachineScaleSetVMPropertiesImpl implements VirtualMachineScaleSetVMProperties { + private VirtualMachineScaleSetVMPropertiesInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + VirtualMachineScaleSetVMPropertiesImpl( + VirtualMachineScaleSetVMPropertiesInner innerObject, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Boolean latestModelApplied() { + return this.innerModel().latestModelApplied(); + } + + public String vmId() { + return this.innerModel().vmId(); + } + + public VirtualMachineScaleSetVMInstanceView instanceView() { + VirtualMachineScaleSetVMInstanceViewInner inner = this.innerModel().instanceView(); + if (inner != null) { + return new VirtualMachineScaleSetVMInstanceViewImpl(inner, this.manager()); + } else { + return null; + } + } + + public HardwareProfile hardwareProfile() { + return this.innerModel().hardwareProfile(); + } + + public StorageProfile storageProfile() { + return this.innerModel().storageProfile(); + } + + public AdditionalCapabilities additionalCapabilities() { + return this.innerModel().additionalCapabilities(); + } + + public OSProfile osProfile() { + return this.innerModel().osProfile(); + } + + public SecurityProfile securityProfile() { + return this.innerModel().securityProfile(); + } + + public NetworkProfile networkProfile() { + return this.innerModel().networkProfile(); + } + + public VirtualMachineScaleSetVMNetworkProfileConfiguration networkProfileConfiguration() { + return this.innerModel().networkProfileConfiguration(); + } + + public DiagnosticsProfile diagnosticsProfile() { + return this.innerModel().diagnosticsProfile(); + } + + public SubResource availabilitySet() { + return this.innerModel().availabilitySet(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public String licenseType() { + return this.innerModel().licenseType(); + } + + public String modelDefinitionApplied() { + return this.innerModel().modelDefinitionApplied(); + } + + public VirtualMachineScaleSetVMProtectionPolicy protectionPolicy() { + return this.innerModel().protectionPolicy(); + } + + public String userData() { + return this.innerModel().userData(); + } + + public OffsetDateTime timeCreated() { + return this.innerModel().timeCreated(); + } + + public VirtualMachineScaleSetVMPropertiesInner 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..ab6b7570cf363 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetVMRunCommandsClientImpl.java @@ -0,0 +1,1668 @@ +// Copyright (c) Microsoft Corporation. All rights 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.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 { + /** 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") + public 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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json, text/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + runCommandName, + apiVersion, + this.client.getSubscriptionId(), + runCommand, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to create or update the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 = "2023-03-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 the {@link PollerFlux} for polling of describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + 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 the {@link PollerFlux} for polling of describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualMachineRunCommandInner> beginCreateOrUpdate( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String runCommandName, + VirtualMachineRunCommandInner runCommand) { + return this + .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 the {@link SyncPoller} for polling of describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualMachineRunCommandInner> beginCreateOrUpdate( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String runCommandName, + VirtualMachineRunCommandInner runCommand, + Context context) { + return this + .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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json, text/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + runCommandName, + apiVersion, + this.client.getSubscriptionId(), + runCommand, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to update the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 = "2023-03-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 the {@link PollerFlux} for polling of describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + 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 the {@link PollerFlux} for polling of describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualMachineRunCommandInner> beginUpdate( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String runCommandName, + VirtualMachineRunCommandUpdate runCommand) { + return this + .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 the {@link SyncPoller} for polling of describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualMachineRunCommandInner> beginUpdate( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String runCommandName, + VirtualMachineRunCommandUpdate runCommand, + Context context) { + return this + .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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json, text/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + runCommandName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to delete the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName, Context context) { + return this + .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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json, text/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + runCommandName, + expand, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to get the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 = "2023-03-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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the 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 on successful completion of {@link Mono}. + */ + @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(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @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 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 getWithResponse(resourceGroupName, vmScaleSetName, instanceId, runCommandName, expand, Context.NONE) + .getValue(); + } + + /** + * 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json, text/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + expand, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to get all run commands of an instance in Virtual Machine Scaleset. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List run command operation response along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 = "2023-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 URL to get the next list of items + *

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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json, text/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json, 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..bdb2d0e520b09 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetVMRunCommandsImpl.java @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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; + +public final class VirtualMachineScaleSetVMRunCommandsImpl implements VirtualMachineScaleSetVMRunCommands { + private static 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 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 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 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..d3f8667eaa350 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetVMsClientImpl.java @@ -0,0 +1,4530 @@ +// Copyright (c) Microsoft Corporation. All rights 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.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 { + /** 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") + public interface VirtualMachineScaleSetVMsService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/reimage") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.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, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/reimageall") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.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, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/deallocate") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.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, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.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({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}") + @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, + @QueryParam("forceDeletion") Boolean forceDeletion, + @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}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.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(ApiErrorException.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(ApiErrorException.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({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/poweroff") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.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, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/restart") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.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, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/start") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.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, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/redeploy") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.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, + @HeaderParam("Accept") String accept, + 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({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/performMaintenance") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.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, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/simulateEviction") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType(ApiErrorException.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, + @HeaderParam("Accept") String accept, + 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(ApiErrorException.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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> 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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .reimage( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + apiVersion, + this.client.getSubscriptionId(), + vmScaleSetVMReimageInput, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmScaleSetVMReimageInput Parameters for the Reimaging Virtual machine in ScaleSet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> 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 = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .reimage( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + apiVersion, + this.client.getSubscriptionId(), + vmScaleSetVMReimageInput, + accept, + 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> 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, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginReimageAsync( + String resourceGroupName, String vmScaleSetName, String instanceId) { + final VirtualMachineScaleSetVMReimageParameters vmScaleSetVMReimageInput = null; + Mono>> mono = + reimageWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, vmScaleSetVMReimageInput); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginReimage( + String resourceGroupName, String vmScaleSetName, String instanceId) { + final VirtualMachineScaleSetVMReimageParameters vmScaleSetVMReimageInput = null; + return this + .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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginReimage( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + VirtualMachineScaleSetVMReimageParameters vmScaleSetVMReimageInput, + Context context) { + return this + .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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void reimage(String resourceGroupName, String 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void reimage( + String resourceGroupName, + String 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> 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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .reimageAll( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is + * only supported for managed disks. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> 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 = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .reimageAll( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + apiVersion, + this.client.getSubscriptionId(), + accept, + 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> 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, 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginReimageAll( + String resourceGroupName, String vmScaleSetName, String instanceId) { + return this.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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginReimageAll( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + return this.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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono 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 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 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 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 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> 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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .deallocate( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute + * resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> 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 = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .deallocate( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + apiVersion, + this.client.getSubscriptionId(), + accept, + 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> 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, 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDeallocate( + String resourceGroupName, String vmScaleSetName, String instanceId) { + return this.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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDeallocate( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + return this.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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono 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 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 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 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 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 ApiErrorException thrown if the 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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a virtual machine of a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. + * @param instanceId The instance ID of the virtual machine. + * @param parameters Parameters supplied to the Update Virtual Machine Scale Sets VM operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the 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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2023-03-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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of describes a virtual machine scale set virtual machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of describes a virtual machine scale set virtual machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes a virtual machine scale set virtual machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualMachineScaleSetVMInner> beginUpdate( + String resourceGroupName, String vmScaleSetName, String instanceId, VirtualMachineScaleSetVMInner parameters) { + return this.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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes a virtual machine scale set virtual machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualMachineScaleSetVMInner> beginUpdate( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + VirtualMachineScaleSetVMInner parameters, + Context context) { + return this + .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 ApiErrorException thrown if the 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 on successful completion of {@link Mono}. + */ + @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 ApiErrorException thrown if the 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 on successful completion of {@link Mono}. + */ + @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 ApiErrorException thrown if the 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 ApiErrorException thrown if the 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String 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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + forceDeletion, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a virtual machine from a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param forceDeletion Optional parameter to force delete a virtual machine from a VM scale set. (Feature in + * Preview). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String 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 = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + forceDeletion, + apiVersion, + this.client.getSubscriptionId(), + accept, + 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, Boolean forceDeletion) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, forceDeletion); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String vmScaleSetName, String instanceId) { + final Boolean forceDeletion = null; + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, forceDeletion); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String vmScaleSetName, String instanceId) { + final Boolean forceDeletion = null; + return this.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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String vmScaleSetName, String instanceId, Boolean forceDeletion, Context context) { + return this + .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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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) { + 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 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, Boolean forceDeletion, Context context) { + deleteAsync(resourceGroupName, vmScaleSetName, instanceId, forceDeletion, context).block(); + } + + /** + * Gets a virtual machine from a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param expand The expand expression to apply on the operation. 'InstanceView' will retrieve the instance view of + * the virtual machine. 'UserData' will retrieve the UserData of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + expand, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a virtual machine from a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param expand The expand expression to apply on the operation. 'InstanceView' will retrieve the instance view of + * the virtual machine. 'UserData' will retrieve the UserData of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 = "2023-03-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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String vmScaleSetName, String instanceId) { + final InstanceViewTypes expand = null; + return getWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, expand) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a virtual machine from a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param expand The expand expression to apply on the operation. 'InstanceView' will retrieve the instance view of + * the virtual machine. 'UserData' will retrieve the UserData of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 along with {@link Response}. + */ + @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 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 ApiErrorException 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 getWithResponse(resourceGroupName, vmScaleSetName, instanceId, expand, Context.NONE).getValue(); + } + + /** + * 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 ApiErrorException 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 along with {@link Response} on successful completion + * of {@link Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getInstanceView( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the status of a virtual machine from a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 along with {@link Response} on successful completion + * of {@link Mono}. + */ + @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 = "2023-03-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 ApiErrorException 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getInstanceViewAsync( + String resourceGroupName, String vmScaleSetName, String instanceId) { + return getInstanceViewWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 ApiErrorException 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getInstanceViewWithResponse( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + return getInstanceViewWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, 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 ApiErrorException 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 getInstanceViewWithResponse(resourceGroupName, vmScaleSetName, instanceId, Context.NONE).getValue(); + } + + /** + * 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 ApiErrorException thrown if 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + virtualMachineScaleSetName, + filter, + select, + expand, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of all virtual machines in a VM scale sets. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the VM scale set. + * @param filter The filter to apply to the operation. Allowed values are 'startswith(instanceView/statuses/code, + * 'PowerState') eq true', 'properties/latestModelApplied eq true', 'properties/latestModelApplied eq false'. + * @param select The list parameters. Allowed values are 'instanceView', 'instanceView/statuses'. + * @param expand The expand expression to apply to the operation. Allowed values are 'instanceView'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 = "2023-03-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 ApiErrorException thrown if 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 as paginated response with {@link PagedFlux}. + */ + @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 ApiErrorException thrown if 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 as paginated response with {@link PagedFlux}. + */ + @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 ApiErrorException thrown if 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 as paginated response with {@link PagedFlux}. + */ + @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 ApiErrorException thrown if 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 as paginated response with {@link PagedIterable}. + */ + @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 ApiErrorException thrown if 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 as paginated response with {@link PagedIterable}. + */ + @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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> 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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .powerOff( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + skipShutdown, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting + * charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * specified. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> 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 = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .powerOff( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + skipShutdown, + apiVersion, + this.client.getSubscriptionId(), + accept, + 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> 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, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginPowerOffAsync( + String resourceGroupName, String vmScaleSetName, String instanceId) { + final Boolean skipShutdown = null; + Mono>> mono = + powerOffWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginPowerOff( + String resourceGroupName, String vmScaleSetName, String instanceId) { + final Boolean skipShutdown = null; + return this.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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginPowerOff( + String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown, Context context) { + return this + .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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void powerOff(String resourceGroupName, String 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void powerOff( + String resourceGroupName, String 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> restartWithResponseAsync( + String resourceGroupName, String 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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .restart( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Restarts a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> restartWithResponseAsync( + String resourceGroupName, String 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 = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .restart( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + apiVersion, + this.client.getSubscriptionId(), + accept, + 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginRestartAsync( + String resourceGroupName, String vmScaleSetName, String instanceId) { + Mono>> mono = restartWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginRestartAsync( + String resourceGroupName, String 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRestart( + String resourceGroupName, String vmScaleSetName, String instanceId) { + return this.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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRestart( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + return this.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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restartAsync(String resourceGroupName, String 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restartAsync( + String resourceGroupName, String 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void restart(String resourceGroupName, String 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void restart(String resourceGroupName, String 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startWithResponseAsync( + String resourceGroupName, String 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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .start( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Starts a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startWithResponseAsync( + String resourceGroupName, String 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 = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .start( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + apiVersion, + this.client.getSubscriptionId(), + accept, + 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginStartAsync( + String resourceGroupName, String vmScaleSetName, String instanceId) { + Mono>> mono = startWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginStartAsync( + String resourceGroupName, String 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStart( + String resourceGroupName, String vmScaleSetName, String instanceId) { + return this.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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStart( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + return this.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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startAsync(String resourceGroupName, String 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startAsync(String resourceGroupName, String 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void start(String resourceGroupName, String 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void start(String resourceGroupName, String 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> 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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .redeploy( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> 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 = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .redeploy( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + apiVersion, + this.client.getSubscriptionId(), + accept, + 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> 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, 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRedeploy( + String resourceGroupName, String vmScaleSetName, String instanceId) { + return this.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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRedeploy( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + return this.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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono 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 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 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 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 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. **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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .retrieveBootDiagnosticsData( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + sasUriExpirationTimeInMinutes, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param sasUriExpirationTimeInMinutes Expiration duration in minutes for the SAS URIs with a value between 1 to + * 1440 minutes. **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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2023-03-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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono retrieveBootDiagnosticsDataAsync( + String resourceGroupName, String vmScaleSetName, String instanceId) { + final Integer sasUriExpirationTimeInMinutes = null; + return retrieveBootDiagnosticsDataWithResponseAsync( + resourceGroupName, vmScaleSetName, instanceId, sasUriExpirationTimeInMinutes) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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. **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 along with {@link Response}. + */ + @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(); + } + + /** + * 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 retrieveBootDiagnosticsDataWithResponse( + resourceGroupName, vmScaleSetName, instanceId, sasUriExpirationTimeInMinutes, Context.NONE) + .getValue(); + } + + /** + * 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> 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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .performMaintenance( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Performs maintenance on a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> 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 = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .performMaintenance( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + apiVersion, + this.client.getSubscriptionId(), + accept, + 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> 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, 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginPerformMaintenance( + String resourceGroupName, String vmScaleSetName, String instanceId) { + return this.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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginPerformMaintenance( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + return this + .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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono 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 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 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 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 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> 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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .simulateEviction( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to simulate the eviction of spot virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> 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 = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .simulateEviction( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + apiVersion, + this.client.getSubscriptionId(), + accept, + 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono simulateEvictionAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + return simulateEvictionWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId) + .flatMap(ignored -> 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response simulateEvictionWithResponse( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + return simulateEvictionWithResponseAsync(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 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 simulateEviction(String resourceGroupName, String vmScaleSetName, String instanceId) { + simulateEvictionWithResponse(resourceGroupName, vmScaleSetName, instanceId, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 body along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json, text/json"; + return FluxUtil + .withContext( + context -> + service + .runCommand( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Run command on a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param parameters Parameters supplied to the Run command operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RunCommandResultInner> beginRunCommand( + String resourceGroupName, String vmScaleSetName, String instanceId, RunCommandInput parameters) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RunCommandResultInner> beginRunCommand( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + RunCommandInput parameters, + Context context) { + return this + .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 body on successful completion of {@link Mono}. + */ + @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 body on successful completion of {@link Mono}. + */ + @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 URL to get the next list of items + *

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 Scale Set VMs operation response along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/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..e33f8a1950837 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetVMsImpl.java @@ -0,0 +1,291 @@ +// Copyright (c) Microsoft Corporation. All rights 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; + +public final class VirtualMachineScaleSetVMsImpl implements VirtualMachineScaleSetVMs { + private static 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) { + 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) { + 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 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 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 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 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 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) { + 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 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 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 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 Response simulateEvictionWithResponse( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + return this + .serviceClient() + .simulateEvictionWithResponse(resourceGroupName, vmScaleSetName, instanceId, context); + } + + public void simulateEviction(String resourceGroupName, String vmScaleSetName, String instanceId) { + this.serviceClient().simulateEviction(resourceGroupName, vmScaleSetName, instanceId); + } + + 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..76b725470e7d7 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetsClientImpl.java @@ -0,0 +1,7030 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.compute.generated.fluent.VirtualMachineScaleSetsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.RecoveryWalkResponseInner; +import com.azure.resourcemanager.compute.generated.fluent.models.UpgradeOperationHistoricalStatusInfoInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetInstanceViewInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetSkuInner; +import com.azure.resourcemanager.compute.generated.models.ApiErrorException; +import com.azure.resourcemanager.compute.generated.models.ExpandTypesForGetVMScaleSets; +import com.azure.resourcemanager.compute.generated.models.OrchestrationServiceStateInput; +import com.azure.resourcemanager.compute.generated.models.VMScaleSetConvertToSinglePlacementGroupInput; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetListOSUpgradeHistory; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetListResult; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetListSkusResult; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetListWithLinkResult; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetReimageParameters; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetUpdate; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMInstanceIDs; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMInstanceRequiredIDs; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in VirtualMachineScaleSetsClient. */ +public final class VirtualMachineScaleSetsClientImpl implements VirtualMachineScaleSetsClient { + /** 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") + public 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(ApiErrorException.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(ApiErrorException.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({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ApiErrorException.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, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmScaleSetName") String vmScaleSetName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") ExpandTypesForGetVMScaleSets expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/deallocate") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> deallocate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmScaleSetName") String vmScaleSetName, + @QueryParam("hibernate") Boolean hibernate, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/delete") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.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, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/instanceView") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.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(ApiErrorException.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(ApiErrorException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/skus") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.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(ApiErrorException.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({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/poweroff") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.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, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/restart") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.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, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/start") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.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, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reapply") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> reapply( + @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"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/redeploy") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.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, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/performMaintenance") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.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, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/manualupgrade") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.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, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimage") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.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, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimageall") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.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, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/forceRecoveryServiceFabricPlatformUpdateDomainWalk") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.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, + @QueryParam("zone") String zone, + @QueryParam("placementGroupId") String placementGroupId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/convertToSinglePlacementGroup") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.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, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/setOrchestrationServiceState") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.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, + @HeaderParam("Accept") String accept, + 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(ApiErrorException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> listAllNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.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(ApiErrorException.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 along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByLocation( + this.client.getEndpoint(), + location, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all the VM scale sets under the specified subscription for the specified location. + * + * @param location The location for which VM scale sets under the subscription are queried. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the VM scale sets under the specified subscription for the specified location along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @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 = "2023-03-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 as paginated response + * with {@link PagedFlux}. + */ + @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 as paginated response + * with {@link PagedFlux}. + */ + @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 as paginated response + * with {@link PagedIterable}. + */ + @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 as paginated response + * with {@link PagedIterable}. + */ + @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 ApiErrorException thrown if the 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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set to create or update. + * @param parameters The scale set object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the 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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 = "2023-03-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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of describes a Virtual Machine Scale Set. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of describes a Virtual Machine Scale Set. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes a Virtual Machine Scale Set. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualMachineScaleSetInner> beginCreateOrUpdate( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetInner parameters) { + return this.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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes a Virtual Machine Scale Set. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualMachineScaleSetInner> beginCreateOrUpdate( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetInner parameters, Context context) { + return this.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 ApiErrorException thrown if the 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 on successful completion of {@link Mono}. + */ + @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 ApiErrorException thrown if the 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 on successful completion of {@link Mono}. + */ + @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 ApiErrorException thrown if the 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 ApiErrorException thrown if the 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 ApiErrorException thrown if the 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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set to create or update. + * @param parameters The scale set object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the 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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 = "2023-03-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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of describes a Virtual Machine Scale Set. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of describes a Virtual Machine Scale Set. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes a Virtual Machine Scale Set. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualMachineScaleSetInner> beginUpdate( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters) { + return this.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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes a Virtual Machine Scale Set. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualMachineScaleSetInner> beginUpdate( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters, Context context) { + return this.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 ApiErrorException thrown if the 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 on successful completion of {@link Mono}. + */ + @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 ApiErrorException thrown if the 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 on successful completion of {@link Mono}. + */ + @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 ApiErrorException thrown if the 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 ApiErrorException thrown if the 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String 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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + forceDeletion, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param forceDeletion Optional parameter to force delete a VM scale set. (Feature in Preview). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String 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 = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + forceDeletion, + apiVersion, + this.client.getSubscriptionId(), + accept, + 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String vmScaleSetName, Boolean forceDeletion) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, vmScaleSetName, forceDeletion); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String vmScaleSetName) { + final Boolean forceDeletion = null; + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, vmScaleSetName, forceDeletion); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String vmScaleSetName) { + final Boolean forceDeletion = null; + return this.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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String vmScaleSetName, Boolean forceDeletion, Context context) { + return this.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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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) { + 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 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, Boolean forceDeletion, Context context) { + deleteAsync(resourceGroupName, vmScaleSetName, forceDeletion, context).block(); + } + + /** + * Display information about a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param expand The expand expression to apply on the operation. 'UserData' retrieves the UserData property of the + * VM scale set that was provided by the user during the VM scale set Create/Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the 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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String vmScaleSetName, ExpandTypesForGetVMScaleSets expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Display information about a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param expand The expand expression to apply on the operation. 'UserData' retrieves the UserData property of the + * VM scale set that was provided by the user during the VM scale set Create/Update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the 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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String vmScaleSetName, ExpandTypesForGetVMScaleSets expand, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context); + } + + /** + * Display information about a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String vmScaleSetName) { + final ExpandTypesForGetVMScaleSets expand = null; + return getByResourceGroupWithResponseAsync(resourceGroupName, vmScaleSetName, expand) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Display information about a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param expand The expand expression to apply on the operation. 'UserData' retrieves the UserData property of the + * VM scale set that was provided by the user during the VM scale set Create/Update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String vmScaleSetName, ExpandTypesForGetVMScaleSets expand, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, vmScaleSetName, expand, 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineScaleSetInner getByResourceGroup(String resourceGroupName, String vmScaleSetName) { + final ExpandTypesForGetVMScaleSets expand = null; + return getByResourceGroupWithResponse(resourceGroupName, vmScaleSetName, expand, Context.NONE).getValue(); + } + + /** + * 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 hibernate Optional parameter to hibernate a virtual machine from the VM scale set. (This feature is + * available for VMSS with Flexible OrchestrationMode only). + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deallocateWithResponseAsync( + String resourceGroupName, + String vmScaleSetName, + Boolean hibernate, + 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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .deallocate( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + hibernate, + apiVersion, + this.client.getSubscriptionId(), + vmInstanceIDs, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute + * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param hibernate Optional parameter to hibernate a virtual machine from the VM scale set. (This feature is + * available for VMSS with Flexible OrchestrationMode only). + * @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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deallocateWithResponseAsync( + String resourceGroupName, + String vmScaleSetName, + Boolean hibernate, + 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 = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .deallocate( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + hibernate, + apiVersion, + this.client.getSubscriptionId(), + vmInstanceIDs, + accept, + 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 hibernate Optional parameter to hibernate a virtual machine from the VM scale set. (This feature is + * available for VMSS with Flexible OrchestrationMode only). + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeallocateAsync( + String resourceGroupName, + String vmScaleSetName, + Boolean hibernate, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { + Mono>> mono = + deallocateWithResponseAsync(resourceGroupName, vmScaleSetName, hibernate, vmInstanceIDs); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeallocateAsync(String resourceGroupName, String vmScaleSetName) { + final Boolean hibernate = null; + final VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; + Mono>> mono = + deallocateWithResponseAsync(resourceGroupName, vmScaleSetName, hibernate, vmInstanceIDs); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, 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 hibernate Optional parameter to hibernate a virtual machine from the VM scale set. (This feature is + * available for VMSS with Flexible OrchestrationMode only). + * @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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeallocateAsync( + String resourceGroupName, + String vmScaleSetName, + Boolean hibernate, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deallocateWithResponseAsync(resourceGroupName, vmScaleSetName, hibernate, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDeallocate(String resourceGroupName, String vmScaleSetName) { + final Boolean hibernate = null; + final VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; + return this.beginDeallocateAsync(resourceGroupName, vmScaleSetName, hibernate, 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 hibernate Optional parameter to hibernate a virtual machine from the VM scale set. (This feature is + * available for VMSS with Flexible OrchestrationMode only). + * @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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDeallocate( + String resourceGroupName, + String vmScaleSetName, + Boolean hibernate, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context) { + return this + .beginDeallocateAsync(resourceGroupName, vmScaleSetName, hibernate, 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 hibernate Optional parameter to hibernate a virtual machine from the VM scale set. (This feature is + * available for VMSS with Flexible OrchestrationMode only). + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deallocateAsync( + String resourceGroupName, + String vmScaleSetName, + Boolean hibernate, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { + return beginDeallocateAsync(resourceGroupName, vmScaleSetName, hibernate, 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deallocateAsync(String resourceGroupName, String vmScaleSetName) { + final Boolean hibernate = null; + final VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; + return beginDeallocateAsync(resourceGroupName, vmScaleSetName, hibernate, 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 hibernate Optional parameter to hibernate a virtual machine from the VM scale set. (This feature is + * available for VMSS with Flexible OrchestrationMode only). + * @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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deallocateAsync( + String resourceGroupName, + String vmScaleSetName, + Boolean hibernate, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context) { + return beginDeallocateAsync(resourceGroupName, vmScaleSetName, hibernate, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 deallocate(String resourceGroupName, String vmScaleSetName) { + final Boolean hibernate = null; + final VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; + deallocateAsync(resourceGroupName, vmScaleSetName, hibernate, 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 hibernate Optional parameter to hibernate a virtual machine from the VM scale set. (This feature is + * available for VMSS with Flexible OrchestrationMode only). + * @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 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 deallocate( + String resourceGroupName, + String vmScaleSetName, + Boolean hibernate, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context) { + deallocateAsync(resourceGroupName, vmScaleSetName, hibernate, 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> 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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .deleteInstances( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + forceDeletion, + apiVersion, + this.client.getSubscriptionId(), + vmInstanceIDs, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param forceDeletion Optional parameter to force delete virtual machines from the VM scale set. (Feature in + * Preview). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> 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 = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .deleteInstances( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + forceDeletion, + apiVersion, + this.client.getSubscriptionId(), + vmInstanceIDs, + accept, + 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> 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, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteInstancesAsync( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs) { + final Boolean forceDeletion = null; + Mono>> mono = + deleteInstancesWithResponseAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, forceDeletion); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDeleteInstances( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs) { + final Boolean forceDeletion = null; + return this + .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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDeleteInstances( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs, + Boolean forceDeletion, + Context context) { + return this + .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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteInstances( + String resourceGroupName, String 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteInstances( + String resourceGroupName, + String 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 ApiErrorException 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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getInstanceView( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the status of a VM scale set instance. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 = "2023-03-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 ApiErrorException 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getInstanceViewAsync( + String resourceGroupName, String vmScaleSetName) { + return getInstanceViewWithResponseAsync(resourceGroupName, vmScaleSetName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 ApiErrorException 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getInstanceViewWithResponse( + String resourceGroupName, String vmScaleSetName, Context context) { + return getInstanceViewWithResponseAsync(resourceGroupName, vmScaleSetName, 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 ApiErrorException 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 getInstanceViewWithResponse(resourceGroupName, vmScaleSetName, Context.NONE).getValue(); + } + + /** + * 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 ApiErrorException thrown if 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of all VM scale sets under a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2023-03-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 ApiErrorException thrown if 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 as paginated response with {@link PagedFlux}. + */ + @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 ApiErrorException thrown if 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 as paginated response with {@link PagedFlux}. + */ + @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 ApiErrorException thrown if 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 as paginated response with {@link PagedIterable}. + */ + @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 ApiErrorException thrown if 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 as paginated response with {@link PagedIterable}. + */ + @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 ApiErrorException thrown if 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 along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink + * property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM + * Scale Sets. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if 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 along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2023-03-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 ApiErrorException thrown if 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 as paginated + * response with {@link PagedFlux}. + */ + @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 ApiErrorException thrown if 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 as paginated + * response with {@link PagedFlux}. + */ + @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 ApiErrorException thrown if 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 as paginated + * response with {@link PagedIterable}. + */ + @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 ApiErrorException thrown if 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 as paginated + * response with {@link PagedIterable}. + */ + @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 ApiErrorException thrown if 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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listSkus( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for + * each SKU. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if 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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 = "2023-03-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 ApiErrorException thrown if 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 as paginated response with {@link PagedFlux}. + */ + @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 ApiErrorException thrown if 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 as paginated response with {@link PagedFlux}. + */ + @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 ApiErrorException thrown if 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 as paginated response with {@link PagedIterable}. + */ + @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 ApiErrorException thrown if 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 as paginated response with {@link PagedIterable}. + */ + @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 ApiErrorException 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 along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getOSUpgradeHistory( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets list of OS upgrades on a VM scale set instance. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @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 = "2023-03-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 ApiErrorException 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 as paginated response with {@link PagedFlux}. + */ + @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 ApiErrorException 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 as paginated response with {@link PagedFlux}. + */ + @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 ApiErrorException 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 as paginated response with {@link PagedIterable}. + */ + @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 ApiErrorException 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 as paginated response with {@link PagedIterable}. + */ + @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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> 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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .powerOff( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + skipShutdown, + apiVersion, + this.client.getSubscriptionId(), + vmInstanceIDs, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you + * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * specified. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> 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 = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .powerOff( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + skipShutdown, + apiVersion, + this.client.getSubscriptionId(), + vmInstanceIDs, + accept, + 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> 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, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginPowerOffAsync(String resourceGroupName, String vmScaleSetName) { + final Boolean skipShutdown = null; + final VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; + Mono>> mono = + powerOffWithResponseAsync(resourceGroupName, vmScaleSetName, skipShutdown, vmInstanceIDs); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginPowerOff(String resourceGroupName, String vmScaleSetName) { + final Boolean skipShutdown = null; + final VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; + return this.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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginPowerOff( + String resourceGroupName, + String vmScaleSetName, + Boolean skipShutdown, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context) { + return this + .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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void powerOff(String resourceGroupName, String 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void powerOff( + String resourceGroupName, + String 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> restartWithResponseAsync( + String resourceGroupName, String 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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .restart( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + vmInstanceIDs, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Restarts one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> restartWithResponseAsync( + String resourceGroupName, + String 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 = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .restart( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + vmInstanceIDs, + accept, + 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginRestartAsync( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { + Mono>> mono = + restartWithResponseAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginRestartAsync(String resourceGroupName, String vmScaleSetName) { + final VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; + Mono>> mono = + restartWithResponseAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginRestartAsync( + String resourceGroupName, + String 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRestart(String resourceGroupName, String vmScaleSetName) { + final VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; + return this.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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRestart( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context) { + return this.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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restartAsync( + String resourceGroupName, String 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restartAsync(String resourceGroupName, String 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restartAsync( + String resourceGroupName, + String 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void restart(String resourceGroupName, String 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void restart( + String resourceGroupName, + String 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startWithResponseAsync( + String resourceGroupName, String 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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .start( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + vmInstanceIDs, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Starts one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startWithResponseAsync( + String resourceGroupName, + String 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 = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .start( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + vmInstanceIDs, + accept, + 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginStartAsync( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { + Mono>> mono = + startWithResponseAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginStartAsync(String resourceGroupName, String vmScaleSetName) { + final VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; + Mono>> mono = + startWithResponseAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginStartAsync( + String resourceGroupName, + String 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStart(String resourceGroupName, String vmScaleSetName) { + final VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; + return this.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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStart( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context) { + return this.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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startAsync( + String resourceGroupName, String 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startAsync(String resourceGroupName, String 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startAsync( + String resourceGroupName, + String 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void start(String resourceGroupName, String 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void start( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context) { + startAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, context).block(); + } + + /** + * Reapplies the Virtual Machine Scale Set Virtual Machine Profile to the Virtual Machine Instances. + * + * @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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> reapplyWithResponseAsync(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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .reapply( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Reapplies the Virtual Machine Scale Set Virtual Machine Profile to the Virtual Machine Instances. + * + * @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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> reapplyWithResponseAsync( + 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 = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .reapply( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Reapplies the Virtual Machine Scale Set Virtual Machine Profile to the Virtual Machine Instances. + * + * @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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginReapplyAsync(String resourceGroupName, String vmScaleSetName) { + Mono>> mono = reapplyWithResponseAsync(resourceGroupName, vmScaleSetName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Reapplies the Virtual Machine Scale Set Virtual Machine Profile to the Virtual Machine Instances. + * + * @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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginReapplyAsync( + String resourceGroupName, String vmScaleSetName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = reapplyWithResponseAsync(resourceGroupName, vmScaleSetName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Reapplies the Virtual Machine Scale Set Virtual Machine Profile to the Virtual Machine Instances. + * + * @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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginReapply(String resourceGroupName, String vmScaleSetName) { + return this.beginReapplyAsync(resourceGroupName, vmScaleSetName).getSyncPoller(); + } + + /** + * Reapplies the Virtual Machine Scale Set Virtual Machine Profile to the Virtual Machine Instances. + * + * @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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginReapply( + String resourceGroupName, String vmScaleSetName, Context context) { + return this.beginReapplyAsync(resourceGroupName, vmScaleSetName, context).getSyncPoller(); + } + + /** + * Reapplies the Virtual Machine Scale Set Virtual Machine Profile to the Virtual Machine Instances. + * + * @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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono reapplyAsync(String resourceGroupName, String vmScaleSetName) { + return beginReapplyAsync(resourceGroupName, vmScaleSetName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Reapplies the Virtual Machine Scale Set Virtual Machine Profile to the Virtual Machine Instances. + * + * @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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono reapplyAsync(String resourceGroupName, String vmScaleSetName, Context context) { + return beginReapplyAsync(resourceGroupName, vmScaleSetName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Reapplies the Virtual Machine Scale Set Virtual Machine Profile to the Virtual Machine Instances. + * + * @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 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 vmScaleSetName) { + reapplyAsync(resourceGroupName, vmScaleSetName).block(); + } + + /** + * Reapplies the Virtual Machine Scale Set Virtual Machine Profile to the Virtual Machine Instances. + * + * @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 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 vmScaleSetName, Context context) { + reapplyAsync(resourceGroupName, vmScaleSetName, 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> 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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .redeploy( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + vmInstanceIDs, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them + * back on. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> 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 = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .redeploy( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + vmInstanceIDs, + accept, + 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> 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, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginRedeployAsync(String resourceGroupName, String vmScaleSetName) { + final VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; + Mono>> mono = + redeployWithResponseAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRedeploy(String resourceGroupName, String vmScaleSetName) { + final VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; + return this.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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRedeploy( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context) { + return this.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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 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 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 redeploy( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context) { + redeployAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, context).block(); + } + + /** + * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not + * eligible for perform maintenance will be failed. Please refer to best practices for more details: + * https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> 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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .performMaintenance( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + vmInstanceIDs, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not + * eligible for perform maintenance will be failed. Please refer to best practices for more details: + * https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> 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 = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .performMaintenance( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + vmInstanceIDs, + accept, + context); + } + + /** + * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not + * eligible for perform maintenance will be failed. Please refer to best practices for more details: + * https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> 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, 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/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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginPerformMaintenanceAsync( + String resourceGroupName, String vmScaleSetName) { + final VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; + Mono>> mono = + performMaintenanceWithResponseAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, 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/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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginPerformMaintenanceAsync( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + performMaintenanceWithResponseAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not + * eligible for perform maintenance will be failed. Please refer to best practices for more details: + * https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginPerformMaintenance(String resourceGroupName, String vmScaleSetName) { + final VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; + return this.beginPerformMaintenanceAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs).getSyncPoller(); + } + + /** + * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not + * eligible for perform maintenance will be failed. Please refer to best practices for more details: + * https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginPerformMaintenance( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context) { + return this + .beginPerformMaintenanceAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, context) + .getSyncPoller(); + } + + /** + * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not + * eligible for perform maintenance will be failed. Please refer to best practices for more details: + * https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono performMaintenanceAsync( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { + return beginPerformMaintenanceAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not + * eligible for perform maintenance will be failed. Please refer to best practices for more details: + * https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono performMaintenanceAsync(String resourceGroupName, String vmScaleSetName) { + final VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; + return beginPerformMaintenanceAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not + * eligible for perform maintenance will be failed. Please refer to best practices for more details: + * https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono performMaintenanceAsync( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context) { + return beginPerformMaintenanceAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not + * eligible for perform maintenance will be failed. Please refer to best practices for more details: + * https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 performMaintenance(String resourceGroupName, String vmScaleSetName) { + final VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; + performMaintenanceAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs).block(); + } + + /** + * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not + * eligible for perform maintenance will be failed. Please refer to best practices for more details: + * https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> 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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateInstances( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + vmInstanceIDs, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> 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 = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateInstances( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + vmInstanceIDs, + accept, + 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> 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, 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginUpdateInstances( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs) { + return this.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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginUpdateInstances( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs, + Context context) { + return this + .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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono 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 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 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 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 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> 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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .reimage( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + vmScaleSetReimageInput, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a + * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial + * state. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmScaleSetReimageInput Parameters for Reimaging VM ScaleSet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> 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 = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .reimage( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + vmScaleSetReimageInput, + accept, + 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> 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, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginReimageAsync(String resourceGroupName, String vmScaleSetName) { + final VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput = null; + Mono>> mono = + reimageWithResponseAsync(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginReimage(String resourceGroupName, String vmScaleSetName) { + final VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput = null; + return this.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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginReimage( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput, + Context context) { + return this + .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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void reimage(String resourceGroupName, String 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void reimage( + String resourceGroupName, + String 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> 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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .reimageAll( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + vmInstanceIDs, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only + * supported for managed disks. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> 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 = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .reimageAll( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + vmInstanceIDs, + accept, + 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> 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, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginReimageAllAsync(String resourceGroupName, String vmScaleSetName) { + final VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; + Mono>> mono = + reimageAllWithResponseAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginReimageAll(String resourceGroupName, String vmScaleSetName) { + final VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; + return this.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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginReimageAll( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context) { + return this.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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 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 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 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. + * @param zone The zone in which the manual recovery walk is requested for cross zone virtual machine scale set. + * @param placementGroupId The placement group id for which the manual recovery walk is requested. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + forceRecoveryServiceFabricPlatformUpdateDomainWalkWithResponseAsync( + String resourceGroupName, + String vmScaleSetName, + int platformUpdateDomain, + String zone, + String placementGroupId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .forceRecoveryServiceFabricPlatformUpdateDomainWalk( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + platformUpdateDomain, + zone, + placementGroupId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param platformUpdateDomain The platform update domain for which a manual recovery walk is requested. + * @param zone The zone in which the manual recovery walk is requested for cross zone virtual machine scale set. + * @param placementGroupId The placement group id for which the manual recovery walk is requested. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + forceRecoveryServiceFabricPlatformUpdateDomainWalkWithResponseAsync( + String resourceGroupName, + String vmScaleSetName, + int platformUpdateDomain, + String zone, + String placementGroupId, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.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 = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .forceRecoveryServiceFabricPlatformUpdateDomainWalk( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + platformUpdateDomain, + zone, + placementGroupId, + 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 ApiErrorException 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono forceRecoveryServiceFabricPlatformUpdateDomainWalkAsync( + String resourceGroupName, String vmScaleSetName, int platformUpdateDomain) { + final String zone = null; + final String placementGroupId = null; + return forceRecoveryServiceFabricPlatformUpdateDomainWalkWithResponseAsync( + resourceGroupName, vmScaleSetName, platformUpdateDomain, zone, placementGroupId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 zone The zone in which the manual recovery walk is requested for cross zone virtual machine scale set. + * @param placementGroupId The placement group id for which the manual recovery walk is requested. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response forceRecoveryServiceFabricPlatformUpdateDomainWalkWithResponse( + String resourceGroupName, + String vmScaleSetName, + int platformUpdateDomain, + String zone, + String placementGroupId, + Context context) { + return forceRecoveryServiceFabricPlatformUpdateDomainWalkWithResponseAsync( + resourceGroupName, vmScaleSetName, platformUpdateDomain, zone, placementGroupId, 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 ApiErrorException 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) { + final String zone = null; + final String placementGroupId = null; + return forceRecoveryServiceFabricPlatformUpdateDomainWalkWithResponse( + resourceGroupName, vmScaleSetName, platformUpdateDomain, zone, placementGroupId, Context.NONE) + .getValue(); + } + + /** + * 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> 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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .convertToSinglePlacementGroup( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Converts SinglePlacementGroup property to false for a existing virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set to create or update. + * @param parameters The input object for ConvertToSinglePlacementGroup API. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> 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 = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .convertToSinglePlacementGroup( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono convertToSinglePlacementGroupAsync( + String resourceGroupName, String vmScaleSetName, VMScaleSetConvertToSinglePlacementGroupInput parameters) { + return convertToSinglePlacementGroupWithResponseAsync(resourceGroupName, vmScaleSetName, parameters) + .flatMap(ignored -> 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response convertToSinglePlacementGroupWithResponse( + String resourceGroupName, + String vmScaleSetName, + VMScaleSetConvertToSinglePlacementGroupInput parameters, + Context context) { + return convertToSinglePlacementGroupWithResponseAsync(resourceGroupName, vmScaleSetName, parameters, 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 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 convertToSinglePlacementGroup( + String resourceGroupName, String vmScaleSetName, VMScaleSetConvertToSinglePlacementGroupInput parameters) { + convertToSinglePlacementGroupWithResponse(resourceGroupName, vmScaleSetName, parameters, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> 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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .setOrchestrationServiceState( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Changes ServiceState property for a given service. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set to create or update. + * @param parameters The input object for SetOrchestrationServiceState API. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> 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 = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .setOrchestrationServiceState( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> 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, 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginSetOrchestrationServiceState( + String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateInput parameters) { + return this + .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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginSetOrchestrationServiceState( + String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateInput parameters, Context context) { + return this + .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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono 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 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 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 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 setOrchestrationServiceState( + String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateInput parameters, Context context) { + setOrchestrationServiceStateAsync(resourceGroupName, vmScaleSetName, parameters, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByLocationNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByLocationNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 URL to get the next list of items + *

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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listAllNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 URL to get the next list of items + *

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 Virtual Machine Scale Set List Skus operation response along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSkusNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listSkusNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 URL to get the next list of items + *

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 list of Virtual Machine Scale Set OS Upgrade History operation response along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getOSUpgradeHistoryNextSinglePageAsync( + String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.getOSUpgradeHistoryNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @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..dc1bdc0f14078 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetsImpl.java @@ -0,0 +1,459 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.VirtualMachineScaleSetsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.RecoveryWalkResponseInner; +import com.azure.resourcemanager.compute.generated.fluent.models.UpgradeOperationHistoricalStatusInfoInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetInstanceViewInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetSkuInner; +import com.azure.resourcemanager.compute.generated.models.ExpandTypesForGetVMScaleSets; +import com.azure.resourcemanager.compute.generated.models.OrchestrationServiceStateInput; +import com.azure.resourcemanager.compute.generated.models.RecoveryWalkResponse; +import com.azure.resourcemanager.compute.generated.models.UpgradeOperationHistoricalStatusInfo; +import com.azure.resourcemanager.compute.generated.models.VMScaleSetConvertToSinglePlacementGroupInput; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSet; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetInstanceView; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetReimageParameters; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetSku; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMInstanceIDs; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMInstanceRequiredIDs; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSets; + +public final class VirtualMachineScaleSetsImpl implements VirtualMachineScaleSets { + private static 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) { + this.serviceClient().delete(resourceGroupName, vmScaleSetName); + } + + public void delete(String resourceGroupName, String vmScaleSetName, Boolean forceDeletion, Context context) { + this.serviceClient().delete(resourceGroupName, vmScaleSetName, forceDeletion, context); + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String vmScaleSetName, ExpandTypesForGetVMScaleSets expand, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, vmScaleSetName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VirtualMachineScaleSetImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public 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 void deallocate(String resourceGroupName, String vmScaleSetName) { + this.serviceClient().deallocate(resourceGroupName, vmScaleSetName); + } + + public void deallocate( + String resourceGroupName, + String vmScaleSetName, + Boolean hibernate, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context) { + this.serviceClient().deallocate(resourceGroupName, vmScaleSetName, hibernate, vmInstanceIDs, context); + } + + 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 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 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 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) { + 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) { + 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) { + 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 reapply(String resourceGroupName, String vmScaleSetName) { + this.serviceClient().reapply(resourceGroupName, vmScaleSetName); + } + + public void reapply(String resourceGroupName, String vmScaleSetName, Context context) { + this.serviceClient().reapply(resourceGroupName, vmScaleSetName, context); + } + + 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) { + 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) { + 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) { + this.serviceClient().reimageAll(resourceGroupName, vmScaleSetName); + } + + public void reimageAll( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context) { + this.serviceClient().reimageAll(resourceGroupName, vmScaleSetName, vmInstanceIDs, context); + } + + public Response forceRecoveryServiceFabricPlatformUpdateDomainWalkWithResponse( + String resourceGroupName, + String vmScaleSetName, + int platformUpdateDomain, + String zone, + String placementGroupId, + Context context) { + Response inner = + this + .serviceClient() + .forceRecoveryServiceFabricPlatformUpdateDomainWalkWithResponse( + resourceGroupName, vmScaleSetName, platformUpdateDomain, zone, placementGroupId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RecoveryWalkResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + 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 convertToSinglePlacementGroupWithResponse( + String resourceGroupName, + String vmScaleSetName, + VMScaleSetConvertToSinglePlacementGroupInput parameters, + Context context) { + return this + .serviceClient() + .convertToSinglePlacementGroupWithResponse(resourceGroupName, vmScaleSetName, parameters, context); + } + + public void convertToSinglePlacementGroup( + String resourceGroupName, String vmScaleSetName, VMScaleSetConvertToSinglePlacementGroupInput parameters) { + this.serviceClient().convertToSinglePlacementGroup(resourceGroupName, vmScaleSetName, parameters); + } + + public void setOrchestrationServiceState( + String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateInput parameters) { + this.serviceClient().setOrchestrationServiceState(resourceGroupName, vmScaleSetName, parameters); + } + + public void setOrchestrationServiceState( + String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateInput parameters, Context context) { + this.serviceClient().setOrchestrationServiceState(resourceGroupName, vmScaleSetName, parameters, context); + } + + public VirtualMachineScaleSet getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String vmScaleSetName = Utils.getValueFromIdByName(id, "virtualMachineScaleSets"); + if (vmScaleSetName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualMachineScaleSets'.", + id))); + } + ExpandTypesForGetVMScaleSets localExpand = null; + return this + .getByResourceGroupWithResponse(resourceGroupName, vmScaleSetName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse( + String id, ExpandTypesForGetVMScaleSets expand, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String vmScaleSetName = Utils.getValueFromIdByName(id, "virtualMachineScaleSets"); + if (vmScaleSetName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualMachineScaleSets'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, vmScaleSetName, expand, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String vmScaleSetName = Utils.getValueFromIdByName(id, "virtualMachineScaleSets"); + if (vmScaleSetName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualMachineScaleSets'.", + id))); + } + Boolean localForceDeletion = null; + this.delete(resourceGroupName, vmScaleSetName, localForceDeletion, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Boolean forceDeletion, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String vmScaleSetName = Utils.getValueFromIdByName(id, "virtualMachineScaleSets"); + if (vmScaleSetName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualMachineScaleSets'.", + id))); + } + this.delete(resourceGroupName, vmScaleSetName, forceDeletion, context); + } + + private VirtualMachineScaleSetsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } + + public VirtualMachineScaleSetImpl define(String name) { + return new VirtualMachineScaleSetImpl(name, this.manager()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineSizeImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineSizeImpl.java new file mode 100644 index 0000000000000..ced2bf309289c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineSizeImpl.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineSizeInner; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineSize; + +public final class VirtualMachineSizeImpl implements VirtualMachineSize { + private VirtualMachineSizeInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + VirtualMachineSizeImpl( + VirtualMachineSizeInner innerObject, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public Integer numberOfCores() { + return this.innerModel().numberOfCores(); + } + + public Integer osDiskSizeInMB() { + return this.innerModel().osDiskSizeInMB(); + } + + public Integer resourceDiskSizeInMB() { + return this.innerModel().resourceDiskSizeInMB(); + } + + public Integer memoryInMB() { + return this.innerModel().memoryInMB(); + } + + public Integer maxDataDiskCount() { + return this.innerModel().maxDataDiskCount(); + } + + public VirtualMachineSizeInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineSizesClientImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineSizesClientImpl.java new file mode 100644 index 0000000000000..ac6fa180e2510 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineSizesClientImpl.java @@ -0,0 +1,215 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.resourcemanager.compute.generated.fluent.VirtualMachineSizesClient; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineSizeInner; +import com.azure.resourcemanager.compute.generated.models.ApiErrorException; +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 { + /** 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") + public interface VirtualMachineSizesService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/vmSizes") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * This API is deprecated. Use [Resources Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list). + * + * @param location The location upon which virtual-machine-sizes is queried. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + location, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This API is deprecated. Use [Resources Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list). + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), location, apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * This API is deprecated. Use [Resources Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list). + * + * @param location The location upon which virtual-machine-sizes is queried. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String location) { + return new PagedFlux<>(() -> listSinglePageAsync(location)); + } + + /** + * This API is deprecated. Use [Resources Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list). + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String location, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(location, context)); + } + + /** + * This API is deprecated. Use [Resources Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list). + * + * @param location The location upon which virtual-machine-sizes is queried. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location) { + return new PagedIterable<>(listAsync(location)); + } + + /** + * This API is deprecated. Use [Resources Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list). + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + @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..1bd5ce6bd36e3 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineSizesImpl.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.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; + +public final class VirtualMachineSizesImpl implements VirtualMachineSizes { + private static 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..3e9802b747bae --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineUpdateImpl.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.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.ApplicationProfile; +import com.azure.resourcemanager.compute.generated.models.BillingProfile; +import com.azure.resourcemanager.compute.generated.models.CapacityReservationProfile; +import com.azure.resourcemanager.compute.generated.models.DiagnosticsProfile; +import com.azure.resourcemanager.compute.generated.models.HardwareProfile; +import com.azure.resourcemanager.compute.generated.models.NetworkProfile; +import com.azure.resourcemanager.compute.generated.models.OSProfile; +import com.azure.resourcemanager.compute.generated.models.Plan; +import com.azure.resourcemanager.compute.generated.models.ScheduledEventsProfile; +import com.azure.resourcemanager.compute.generated.models.SecurityProfile; +import com.azure.resourcemanager.compute.generated.models.StorageProfile; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineEvictionPolicyTypes; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineIdentity; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineInstanceView; +import com.azure.resourcemanager.compute.generated.models.VirtualMachinePriorityTypes; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineUpdate; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class VirtualMachineUpdateImpl implements VirtualMachineUpdate { + private VirtualMachineUpdateInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + VirtualMachineUpdateImpl( + VirtualMachineUpdateInner innerObject, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Plan plan() { + return this.innerModel().plan(); + } + + public VirtualMachineIdentity identity() { + return this.innerModel().identity(); + } + + public List zones() { + List inner = this.innerModel().zones(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public HardwareProfile hardwareProfile() { + return this.innerModel().hardwareProfile(); + } + + public StorageProfile storageProfile() { + return this.innerModel().storageProfile(); + } + + public AdditionalCapabilities additionalCapabilities() { + return this.innerModel().additionalCapabilities(); + } + + public OSProfile osProfile() { + return this.innerModel().osProfile(); + } + + public NetworkProfile networkProfile() { + return this.innerModel().networkProfile(); + } + + public SecurityProfile securityProfile() { + return this.innerModel().securityProfile(); + } + + public DiagnosticsProfile diagnosticsProfile() { + return this.innerModel().diagnosticsProfile(); + } + + public SubResource availabilitySet() { + return this.innerModel().availabilitySet(); + } + + public SubResource virtualMachineScaleSet() { + return this.innerModel().virtualMachineScaleSet(); + } + + public SubResource proximityPlacementGroup() { + return this.innerModel().proximityPlacementGroup(); + } + + public VirtualMachinePriorityTypes priority() { + return this.innerModel().priority(); + } + + public VirtualMachineEvictionPolicyTypes evictionPolicy() { + return this.innerModel().evictionPolicy(); + } + + public BillingProfile billingProfile() { + return this.innerModel().billingProfile(); + } + + public SubResource host() { + return this.innerModel().host(); + } + + public SubResource hostGroup() { + return this.innerModel().hostGroup(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public VirtualMachineInstanceView instanceView() { + VirtualMachineInstanceViewInner inner = this.innerModel().instanceView(); + if (inner != null) { + return new VirtualMachineInstanceViewImpl(inner, this.manager()); + } else { + return null; + } + } + + public String licenseType() { + return this.innerModel().licenseType(); + } + + public String vmId() { + return this.innerModel().vmId(); + } + + public String extensionsTimeBudget() { + return this.innerModel().extensionsTimeBudget(); + } + + public Integer platformFaultDomain() { + return this.innerModel().platformFaultDomain(); + } + + public ScheduledEventsProfile scheduledEventsProfile() { + return this.innerModel().scheduledEventsProfile(); + } + + public String userData() { + return this.innerModel().userData(); + } + + public CapacityReservationProfile capacityReservation() { + return this.innerModel().capacityReservation(); + } + + public ApplicationProfile applicationProfile() { + return this.innerModel().applicationProfile(); + } + + public OffsetDateTime timeCreated() { + return this.innerModel().timeCreated(); + } + + 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..d220d4f8d6545 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachinesClientImpl.java @@ -0,0 +1,6502 @@ +// Copyright (c) Microsoft Corporation. All rights 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.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.ExpandTypeForListVMs; +import com.azure.resourcemanager.compute.generated.models.ExpandTypesForListVMs; +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 { + /** 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") + public interface VirtualMachinesService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/virtualMachines") + @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"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/capture") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.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(ApiErrorException.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(ApiErrorException.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({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ApiErrorException.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, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.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(ApiErrorException.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({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/convertToManagedDisks") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> convertToManagedDisks( + @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}/deallocate") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> deallocate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmName") String vmName, + @QueryParam("hibernate") Boolean hibernate, + @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}/generalize") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> generalize( + @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"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("$filter") String filter, + @QueryParam("$expand") ExpandTypeForListVMs expand, + @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(ApiErrorException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("statusOnly") String statusOnly, + @QueryParam("$filter") String filter, + @QueryParam("$expand") ExpandTypesForListVMs expand, + @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(ApiErrorException.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({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/powerOff") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.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, + @HeaderParam("Accept") String accept, + 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({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/restart") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> restart( + @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}/start") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> start( + @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}/redeploy") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> redeploy( + @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}/reimage") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.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, + @HeaderParam("Accept") String accept, + 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({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/performMaintenance") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> performMaintenance( + @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}/simulateEviction") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> simulateEviction( + @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}/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(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(ApiErrorException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> listAllNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * 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 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 virtual machines under the specified subscription for the specified location along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByLocation( + this.client.getEndpoint(), + location, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all the virtual machines under the specified subscription for the specified location. + * + * @param location The location for which virtual machines under the subscription are queried. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 virtual machines under the specified subscription for the specified location along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @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 = "2023-03-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 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 virtual machines under the specified subscription for the specified location as paginated + * response with {@link PagedFlux}. + */ + @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 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 virtual machines under the specified subscription for the specified location as paginated + * response with {@link PagedFlux}. + */ + @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 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 virtual machines under the specified subscription for the specified location as paginated + * response with {@link PagedIterable}. + */ + @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 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 virtual machines under the specified subscription for the specified location as paginated + * response with {@link PagedIterable}. + */ + @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 ApiErrorException 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .capture( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar + * VMs. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Capture Virtual Machine operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2023-03-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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of output of virtual machine capture operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of output of virtual machine capture operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of output of virtual machine capture operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualMachineCaptureResultInner> beginCapture( + String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters) { + return this.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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of output of virtual machine capture operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualMachineCaptureResultInner> beginCapture( + String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters, Context context) { + return this.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 ApiErrorException 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 on successful completion of {@link Mono}. + */ + @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 ApiErrorException 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 on successful completion of {@link Mono}. + */ + @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 ApiErrorException 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 ApiErrorException 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to create or update a virtual machine. Please note some properties can be set only during virtual + * machine creation. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Create Virtual Machine operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-03-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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of describes a Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of describes a Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes a Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualMachineInner> beginCreateOrUpdate( + String resourceGroupName, String vmName, VirtualMachineInner parameters) { + return this.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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes a Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualMachineInner> beginCreateOrUpdate( + String resourceGroupName, String vmName, VirtualMachineInner parameters, Context context) { + return this.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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine on successful completion of {@link Mono}. + */ + @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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine on successful completion of {@link Mono}. + */ + @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 ApiErrorException thrown if the 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 ApiErrorException thrown if the 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to update a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Update Virtual Machine operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-03-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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of describes a Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of describes a Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes a Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualMachineInner> beginUpdate( + String resourceGroupName, String vmName, VirtualMachineUpdateInner parameters) { + return this.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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of describes a Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualMachineInner> beginUpdate( + String resourceGroupName, String vmName, VirtualMachineUpdateInner parameters, Context context) { + return this.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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine on successful completion of {@link Mono}. + */ + @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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine on successful completion of {@link Mono}. + */ + @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 ApiErrorException thrown if the 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 ApiErrorException thrown if the 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String 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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + vmName, + forceDeletion, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to delete a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param forceDeletion Optional parameter to force delete virtual machines. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String 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 = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + vmName, + forceDeletion, + apiVersion, + this.client.getSubscriptionId(), + accept, + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String vmName, Boolean forceDeletion) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, vmName, forceDeletion); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String vmName) { + final Boolean forceDeletion = null; + Mono>> mono = deleteWithResponseAsync(resourceGroupName, vmName, forceDeletion); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String vmName) { + final Boolean forceDeletion = null; + return this.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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String vmName, Boolean forceDeletion, Context context) { + return this.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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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) { + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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, Boolean forceDeletion, Context context) { + deleteAsync(resourceGroupName, vmName, forceDeletion, context).block(); + } + + /** + * Retrieves information about the model view or the instance view of a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param expand The expand expression to apply on the operation. 'InstanceView' retrieves a snapshot of the runtime + * properties of the virtual machine that is managed by the platform and can change outside of control plane + * operations. 'UserData' retrieves the UserData property as part of the VM model view that was provided by the + * user during the VM Create/Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + vmName, + expand, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves information about the model view or the instance view of a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param expand The expand expression to apply on the operation. 'InstanceView' retrieves a snapshot of the runtime + * properties of the virtual machine that is managed by the platform and can change outside of control plane + * operations. 'UserData' retrieves the UserData property as part of the VM model view that was provided by the + * user during the VM Create/Update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-03-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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String vmName) { + final InstanceViewTypes expand = null; + return getByResourceGroupWithResponseAsync(resourceGroupName, vmName, expand) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieves information about the model view or the instance view of a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param expand The expand expression to apply on the operation. 'InstanceView' retrieves a snapshot of the runtime + * properties of the virtual machine that is managed by the platform and can change outside of control plane + * operations. 'UserData' retrieves the UserData property as part of the VM model view that was provided by the + * user during the VM Create/Update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine along with {@link Response}. + */ + @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 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 ApiErrorException thrown if the 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 getByResourceGroupWithResponse(resourceGroupName, vmName, expand, Context.NONE).getValue(); + } + + /** + * 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 ApiErrorException 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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .instanceView( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves information about the run-time state of a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 = "2023-03-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 ApiErrorException 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono instanceViewAsync(String resourceGroupName, String vmName) { + return instanceViewWithResponseAsync(resourceGroupName, vmName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 ApiErrorException 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response instanceViewWithResponse( + String resourceGroupName, String vmName, Context context) { + return instanceViewWithResponseAsync(resourceGroupName, vmName, 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 ApiErrorException 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 instanceViewWithResponse(resourceGroupName, vmName, Context.NONE).getValue(); + } + + /** + * 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> 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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .convertToManagedDisks( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before + * invoking this operation. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> 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 = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .convertToManagedDisks( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + accept, + 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginConvertToManagedDisksAsync( + String resourceGroupName, String vmName) { + Mono>> mono = convertToManagedDisksWithResponseAsync(resourceGroupName, vmName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginConvertToManagedDisks(String resourceGroupName, String vmName) { + return this.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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginConvertToManagedDisks( + String resourceGroupName, String vmName, Context context) { + return this.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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono 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 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 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 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 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. + * @param hibernate Optional parameter to hibernate a virtual machine. (Feature in Preview). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deallocateWithResponseAsync( + String resourceGroupName, String vmName, Boolean hibernate) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .deallocate( + this.client.getEndpoint(), + resourceGroupName, + vmName, + hibernate, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources + * that this virtual machine uses. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param hibernate Optional parameter to hibernate a virtual machine. (Feature in Preview). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deallocateWithResponseAsync( + String resourceGroupName, String vmName, Boolean hibernate, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.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 = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .deallocate( + this.client.getEndpoint(), + resourceGroupName, + vmName, + hibernate, + apiVersion, + this.client.getSubscriptionId(), + accept, + 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. + * @param hibernate Optional parameter to hibernate a virtual machine. (Feature in Preview). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeallocateAsync( + String resourceGroupName, String vmName, Boolean hibernate) { + Mono>> mono = deallocateWithResponseAsync(resourceGroupName, vmName, hibernate); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeallocateAsync(String resourceGroupName, String vmName) { + final Boolean hibernate = null; + Mono>> mono = deallocateWithResponseAsync(resourceGroupName, vmName, hibernate); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, 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 hibernate Optional parameter to hibernate a virtual machine. (Feature in Preview). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeallocateAsync( + String resourceGroupName, String vmName, Boolean hibernate, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deallocateWithResponseAsync(resourceGroupName, vmName, hibernate, 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDeallocate(String resourceGroupName, String vmName) { + final Boolean hibernate = null; + return this.beginDeallocateAsync(resourceGroupName, vmName, hibernate).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 hibernate Optional parameter to hibernate a virtual machine. (Feature in Preview). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDeallocate( + String resourceGroupName, String vmName, Boolean hibernate, Context context) { + return this.beginDeallocateAsync(resourceGroupName, vmName, hibernate, 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. + * @param hibernate Optional parameter to hibernate a virtual machine. (Feature in Preview). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deallocateAsync(String resourceGroupName, String vmName, Boolean hibernate) { + return beginDeallocateAsync(resourceGroupName, vmName, hibernate) + .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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deallocateAsync(String resourceGroupName, String vmName) { + final Boolean hibernate = null; + return beginDeallocateAsync(resourceGroupName, vmName, hibernate) + .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 hibernate Optional parameter to hibernate a virtual machine. (Feature in Preview). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deallocateAsync(String resourceGroupName, String vmName, Boolean hibernate, Context context) { + return beginDeallocateAsync(resourceGroupName, vmName, hibernate, 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 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 deallocate(String resourceGroupName, String vmName) { + final Boolean hibernate = null; + deallocateAsync(resourceGroupName, vmName, hibernate).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 hibernate Optional parameter to hibernate a virtual machine. (Feature in Preview). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 deallocate(String resourceGroupName, String vmName, Boolean hibernate, Context context) { + deallocateAsync(resourceGroupName, vmName, hibernate, context).block(); + } + + /** + * Sets the OS state of the virtual machine to generalized. It is recommended to sysprep the virtual machine before + * performing this operation. For Windows, please refer to [Create a managed image of a generalized VM in + * Azure](https://docs.microsoft.com/azure/virtual-machines/windows/capture-image-resource). For Linux, please refer + * to [How to create an image of a virtual machine or + * VHD](https://docs.microsoft.com/azure/virtual-machines/linux/capture-image). + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> 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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .generalize( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Sets the OS state of the virtual machine to generalized. It is recommended to sysprep the virtual machine before + * performing this operation. For Windows, please refer to [Create a managed image of a generalized VM in + * Azure](https://docs.microsoft.com/azure/virtual-machines/windows/capture-image-resource). For Linux, please refer + * to [How to create an image of a virtual machine or + * VHD](https://docs.microsoft.com/azure/virtual-machines/linux/capture-image). + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> 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 = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .generalize( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Sets the OS state of the virtual machine to generalized. It is recommended to sysprep the virtual machine before + * performing this operation. For Windows, please refer to [Create a managed image of a generalized VM in + * Azure](https://docs.microsoft.com/azure/virtual-machines/windows/capture-image-resource). For Linux, please refer + * to [How to create an image of a virtual machine or + * VHD](https://docs.microsoft.com/azure/virtual-machines/linux/capture-image). + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono generalizeAsync(String resourceGroupName, String vmName) { + return generalizeWithResponseAsync(resourceGroupName, vmName).flatMap(ignored -> Mono.empty()); + } + + /** + * Sets the OS state of the virtual machine to generalized. It is recommended to sysprep the virtual machine before + * performing this operation. For Windows, please refer to [Create a managed image of a generalized VM in + * Azure](https://docs.microsoft.com/azure/virtual-machines/windows/capture-image-resource). For Linux, please refer + * to [How to create an image of a virtual machine or + * VHD](https://docs.microsoft.com/azure/virtual-machines/linux/capture-image). + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response generalizeWithResponse(String resourceGroupName, String vmName, Context context) { + return generalizeWithResponseAsync(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. For Windows, please refer to [Create a managed image of a generalized VM in + * Azure](https://docs.microsoft.com/azure/virtual-machines/windows/capture-image-resource). For Linux, please refer + * to [How to create an image of a virtual machine or + * VHD](https://docs.microsoft.com/azure/virtual-machines/linux/capture-image). + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 generalize(String resourceGroupName, String vmName) { + generalizeWithResponse(resourceGroupName, vmName, Context.NONE); + } + + /** + * 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 filter The system query option to filter VMs returned in the response. Allowed value is + * 'virtualMachineScaleSet/id' eq + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}'. + * @param expand The expand expression to apply on operation. 'instanceView' enables fetching run time status of all + * Virtual Machines, this can only be specified if a valid $filter option is specified. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, String filter, ExpandTypeForListVMs expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + filter, + expand, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 filter The system query option to filter VMs returned in the response. Allowed value is + * 'virtualMachineScaleSet/id' eq + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}'. + * @param expand The expand expression to apply on operation. 'instanceView' enables fetching run time status of all + * Virtual Machines, this can only be specified if a valid $filter option is specified. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, String filter, ExpandTypeForListVMs expand, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + filter, + expand, + 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. + * @param filter The system query option to filter VMs returned in the response. Allowed value is + * 'virtualMachineScaleSet/id' eq + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}'. + * @param expand The expand expression to apply on operation. 'instanceView' enables fetching run time status of all + * Virtual Machines, this can only be specified if a valid $filter option is specified. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, String filter, ExpandTypeForListVMs expand) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, expand), + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + final String filter = null; + final ExpandTypeForListVMs expand = null; + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, expand), + 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 filter The system query option to filter VMs returned in the response. Allowed value is + * 'virtualMachineScaleSet/id' eq + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}'. + * @param expand The expand expression to apply on operation. 'instanceView' enables fetching run time status of all + * Virtual Machines, this can only be specified if a valid $filter option is specified. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, String filter, ExpandTypeForListVMs expand, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, expand, 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 ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + final String filter = null; + final ExpandTypeForListVMs expand = null; + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter, expand)); + } + + /** + * 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 filter The system query option to filter VMs returned in the response. Allowed value is + * 'virtualMachineScaleSet/id' eq + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}'. + * @param expand The expand expression to apply on operation. 'instanceView' enables fetching run time status of all + * Virtual Machines, this can only be specified if a valid $filter option is specified. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup( + String resourceGroupName, String filter, ExpandTypeForListVMs expand, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter, expand, 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. + * @param filter The system query option to filter VMs returned in the response. Allowed value is + * 'virtualMachineScaleSet/id' eq + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}'. + * @param expand The expand expression to apply on operation. 'instanceView' enables fetching run time status of all + * Virtual Machines, this can only be specified if a valid $filter option is specified. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String statusOnly, String filter, ExpandTypesForListVMs 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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + statusOnly, + filter, + expand, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all of the 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 filter The system query option to filter VMs returned in the response. Allowed value is + * 'virtualMachineScaleSet/id' eq + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}'. + * @param expand The expand expression to apply on operation. 'instanceView' enables fetching run time status of all + * Virtual Machines, this can only be specified if a valid $filter option is specified. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String statusOnly, String filter, ExpandTypesForListVMs 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 = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + statusOnly, + filter, + expand, + 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. + * @param filter The system query option to filter VMs returned in the response. Allowed value is + * 'virtualMachineScaleSet/id' eq + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}'. + * @param expand The expand expression to apply on operation. 'instanceView' enables fetching run time status of all + * Virtual Machines, this can only be specified if a valid $filter option is specified. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String statusOnly, String filter, ExpandTypesForListVMs expand) { + return new PagedFlux<>( + () -> listSinglePageAsync(statusOnly, filter, expand), 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 ApiErrorException thrown 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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + final String statusOnly = null; + final String filter = null; + final ExpandTypesForListVMs expand = null; + return new PagedFlux<>( + () -> listSinglePageAsync(statusOnly, filter, expand), 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 filter The system query option to filter VMs returned in the response. Allowed value is + * 'virtualMachineScaleSet/id' eq + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}'. + * @param expand The expand expression to apply on operation. 'instanceView' enables fetching run time status of all + * Virtual Machines, this can only be specified if a valid $filter option is specified. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String statusOnly, String filter, ExpandTypesForListVMs expand, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(statusOnly, filter, expand, 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 ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + final String statusOnly = null; + final String filter = null; + final ExpandTypesForListVMs expand = null; + return new PagedIterable<>(listAsync(statusOnly, filter, expand)); + } + + /** + * 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 filter The system query option to filter VMs returned in the response. Allowed value is + * 'virtualMachineScaleSet/id' eq + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}'. + * @param expand The expand expression to apply on operation. 'instanceView' enables fetching run time status of all + * Virtual Machines, this can only be specified if a valid $filter option is specified. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String statusOnly, String filter, ExpandTypesForListVMs expand, Context context) { + return new PagedIterable<>(listAsync(statusOnly, filter, expand, 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 ApiErrorException thrown 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listAvailableSizes( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all available virtual machine sizes to which the specified virtual machine can be resized. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 = "2023-03-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 ApiErrorException thrown 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 as paginated response with {@link PagedFlux}. + */ + @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 ApiErrorException thrown 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 as paginated response with {@link PagedFlux}. + */ + @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 ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + @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 ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + @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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> 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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .powerOff( + this.client.getEndpoint(), + resourceGroupName, + vmName, + skipShutdown, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same + * provisioned resources. You are still charged for this virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * specified. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> 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 = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .powerOff( + this.client.getEndpoint(), + resourceGroupName, + vmName, + skipShutdown, + apiVersion, + this.client.getSubscriptionId(), + accept, + 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> 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, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginPowerOffAsync(String resourceGroupName, String vmName) { + final Boolean skipShutdown = null; + Mono>> mono = powerOffWithResponseAsync(resourceGroupName, vmName, skipShutdown); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginPowerOff(String resourceGroupName, String vmName) { + final Boolean skipShutdown = null; + return this.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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginPowerOff( + String resourceGroupName, String vmName, Boolean skipShutdown, Context context) { + return this.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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void powerOff(String resourceGroupName, String 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void powerOff(String resourceGroupName, String 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .reapply( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to reapply a virtual machine's state. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginReapply(String resourceGroupName, String vmName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginReapply(String resourceGroupName, String vmName, Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> restartWithResponseAsync(String resourceGroupName, String 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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .restart( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to restart a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> restartWithResponseAsync( + String resourceGroupName, String 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 = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .restart( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + accept, + 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginRestartAsync(String resourceGroupName, String vmName) { + Mono>> mono = restartWithResponseAsync(resourceGroupName, vmName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginRestartAsync( + String resourceGroupName, String 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRestart(String resourceGroupName, String vmName) { + return this.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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRestart(String resourceGroupName, String vmName, Context context) { + return this.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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restartAsync(String resourceGroupName, String 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restartAsync(String resourceGroupName, String 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void restart(String resourceGroupName, String 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void restart(String resourceGroupName, String 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startWithResponseAsync(String resourceGroupName, String 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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .start( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to start a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startWithResponseAsync( + String resourceGroupName, String 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 = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .start( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + accept, + 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginStartAsync(String resourceGroupName, String vmName) { + Mono>> mono = startWithResponseAsync(resourceGroupName, vmName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginStartAsync( + String resourceGroupName, String 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStart(String resourceGroupName, String vmName) { + return this.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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStart(String resourceGroupName, String vmName, Context context) { + return this.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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startAsync(String resourceGroupName, String 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startAsync(String resourceGroupName, String 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void start(String resourceGroupName, String 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void start(String resourceGroupName, String 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> 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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .redeploy( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Shuts down the virtual machine, moves it to a new node, and powers it back on. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> 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 = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .redeploy( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + accept, + 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginRedeployAsync(String resourceGroupName, String vmName) { + Mono>> mono = redeployWithResponseAsync(resourceGroupName, vmName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRedeploy(String resourceGroupName, String vmName) { + return this.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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRedeploy(String resourceGroupName, String vmName, Context context) { + return this.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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono 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 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 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 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 redeploy(String resourceGroupName, String vmName, Context context) { + redeployAsync(resourceGroupName, vmName, context).block(); + } + + /** + * Reimages (upgrade the operating system) a virtual machine 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. NOTE: The retaining of old + * OS disk depends on the value of deleteOption of OS disk. If deleteOption is detach, the old OS disk will be + * preserved after reimage. If deleteOption is delete, the old OS disk will be deleted after reimage. The + * deleteOption of the OS disk should be updated accordingly before performing the reimage. + * + * @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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> 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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .reimage( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Reimages (upgrade the operating system) a virtual machine 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. NOTE: The retaining of old + * OS disk depends on the value of deleteOption of OS disk. If deleteOption is detach, the old OS disk will be + * preserved after reimage. If deleteOption is delete, the old OS disk will be deleted after reimage. The + * deleteOption of the OS disk should be updated accordingly before performing the reimage. + * + * @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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> 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 = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .reimage( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Reimages (upgrade the operating system) a virtual machine 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. NOTE: The retaining of old + * OS disk depends on the value of deleteOption of OS disk. If deleteOption is detach, the old OS disk will be + * preserved after reimage. If deleteOption is delete, the old OS disk will be deleted after reimage. The + * deleteOption of the OS disk should be updated accordingly before performing the reimage. + * + * @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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> 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, this.client.getContext()); + } + + /** + * Reimages (upgrade the operating system) a virtual machine 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. NOTE: The retaining of old + * OS disk depends on the value of deleteOption of OS disk. If deleteOption is detach, the old OS disk will be + * preserved after reimage. If deleteOption is delete, the old OS disk will be deleted after reimage. The + * deleteOption of the OS disk should be updated accordingly before performing the reimage. + * + * @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginReimageAsync(String resourceGroupName, String vmName) { + final VirtualMachineReimageParameters parameters = null; + Mono>> mono = reimageWithResponseAsync(resourceGroupName, vmName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Reimages (upgrade the operating system) a virtual machine 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. NOTE: The retaining of old + * OS disk depends on the value of deleteOption of OS disk. If deleteOption is detach, the old OS disk will be + * preserved after reimage. If deleteOption is delete, the old OS disk will be deleted after reimage. The + * deleteOption of the OS disk should be updated accordingly before performing the reimage. + * + * @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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> 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 (upgrade the operating system) a virtual machine 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. NOTE: The retaining of old + * OS disk depends on the value of deleteOption of OS disk. If deleteOption is detach, the old OS disk will be + * preserved after reimage. If deleteOption is delete, the old OS disk will be deleted after reimage. The + * deleteOption of the OS disk should be updated accordingly before performing the reimage. + * + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginReimage(String resourceGroupName, String vmName) { + final VirtualMachineReimageParameters parameters = null; + return this.beginReimageAsync(resourceGroupName, vmName, parameters).getSyncPoller(); + } + + /** + * Reimages (upgrade the operating system) a virtual machine 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. NOTE: The retaining of old + * OS disk depends on the value of deleteOption of OS disk. If deleteOption is detach, the old OS disk will be + * preserved after reimage. If deleteOption is delete, the old OS disk will be deleted after reimage. The + * deleteOption of the OS disk should be updated accordingly before performing the reimage. + * + * @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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginReimage( + String resourceGroupName, String vmName, VirtualMachineReimageParameters parameters, Context context) { + return this.beginReimageAsync(resourceGroupName, vmName, parameters, context).getSyncPoller(); + } + + /** + * Reimages (upgrade the operating system) a virtual machine 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. NOTE: The retaining of old + * OS disk depends on the value of deleteOption of OS disk. If deleteOption is detach, the old OS disk will be + * preserved after reimage. If deleteOption is delete, the old OS disk will be deleted after reimage. The + * deleteOption of the OS disk should be updated accordingly before performing the reimage. + * + * @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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono reimageAsync( + String resourceGroupName, String vmName, VirtualMachineReimageParameters parameters) { + return beginReimageAsync(resourceGroupName, vmName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Reimages (upgrade the operating system) a virtual machine 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. NOTE: The retaining of old + * OS disk depends on the value of deleteOption of OS disk. If deleteOption is detach, the old OS disk will be + * preserved after reimage. If deleteOption is delete, the old OS disk will be deleted after reimage. The + * deleteOption of the OS disk should be updated accordingly before performing the reimage. + * + * @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 A {@link Mono} that completes when a successful response is received. + */ + @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 (upgrade the operating system) a virtual machine 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. NOTE: The retaining of old + * OS disk depends on the value of deleteOption of OS disk. If deleteOption is detach, the old OS disk will be + * preserved after reimage. If deleteOption is delete, the old OS disk will be deleted after reimage. The + * deleteOption of the OS disk should be updated accordingly before performing the reimage. + * + * @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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono reimageAsync( + String resourceGroupName, String vmName, VirtualMachineReimageParameters parameters, Context context) { + return beginReimageAsync(resourceGroupName, vmName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Reimages (upgrade the operating system) a virtual machine 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. NOTE: The retaining of old + * OS disk depends on the value of deleteOption of OS disk. If deleteOption is detach, the old OS disk will be + * preserved after reimage. If deleteOption is delete, the old OS disk will be deleted after reimage. The + * deleteOption of the OS disk should be updated accordingly before performing the reimage. + * + * @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 reimage(String resourceGroupName, String vmName) { + final VirtualMachineReimageParameters parameters = null; + reimageAsync(resourceGroupName, vmName, parameters).block(); + } + + /** + * Reimages (upgrade the operating system) a virtual machine 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. NOTE: The retaining of old + * OS disk depends on the value of deleteOption of OS disk. If deleteOption is detach, the old OS disk will be + * preserved after reimage. If deleteOption is delete, the old OS disk will be deleted after reimage. The + * deleteOption of the OS disk should be updated accordingly before performing the reimage. + * + * @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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void reimage( + String resourceGroupName, String 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. **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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .retrieveBootDiagnosticsData( + this.client.getEndpoint(), + resourceGroupName, + vmName, + sasUriExpirationTimeInMinutes, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to retrieve SAS URIs for a virtual machine's boot diagnostic logs. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param sasUriExpirationTimeInMinutes Expiration duration in minutes for the SAS URIs with a value between 1 to + * 1440 minutes. **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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2023-03-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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono retrieveBootDiagnosticsDataAsync( + String resourceGroupName, String vmName) { + final Integer sasUriExpirationTimeInMinutes = null; + return retrieveBootDiagnosticsDataWithResponseAsync(resourceGroupName, vmName, sasUriExpirationTimeInMinutes) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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. **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 along with {@link Response}. + */ + @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 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 retrieveBootDiagnosticsDataWithResponse( + resourceGroupName, vmName, sasUriExpirationTimeInMinutes, Context.NONE) + .getValue(); + } + + /** + * 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> 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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .performMaintenance( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to perform maintenance on a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> 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 = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .performMaintenance( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + accept, + 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginPerformMaintenanceAsync(String resourceGroupName, String vmName) { + Mono>> mono = performMaintenanceWithResponseAsync(resourceGroupName, vmName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginPerformMaintenance(String resourceGroupName, String vmName) { + return this.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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginPerformMaintenance( + String resourceGroupName, String vmName, Context context) { + return this.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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono 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 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 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 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 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> 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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .simulateEviction( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to simulate the eviction of spot virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> 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 = "2023-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .simulateEviction( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + accept, + 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono simulateEvictionAsync(String resourceGroupName, String vmName) { + return simulateEvictionWithResponseAsync(resourceGroupName, vmName).flatMap(ignored -> 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response simulateEvictionWithResponse(String resourceGroupName, String vmName, Context context) { + return simulateEvictionWithResponseAsync(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 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 simulateEviction(String resourceGroupName, String vmName) { + simulateEvictionWithResponse(resourceGroupName, vmName, Context.NONE); + } + + /** + * 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 along with {@link Response} on successful completion + * of {@link Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .assessPatches( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Assess patches on the VM. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the properties of an AssessPatches result along with {@link Response} on successful completion + * of {@link Mono}. + */ + @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 = "2023-03-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 the {@link PollerFlux} for polling of describes the properties of an AssessPatches result. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + 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 the {@link PollerFlux} for polling of describes the properties of an AssessPatches result. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of describes the properties of an AssessPatches result. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualMachineAssessPatchesResultInner> + beginAssessPatches(String resourceGroupName, String vmName) { + return this.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 the {@link SyncPoller} for polling of describes the properties of an AssessPatches result. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualMachineAssessPatchesResultInner> + beginAssessPatches(String resourceGroupName, String vmName, Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .installPatches( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + installPatchesInput, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Installs patches on the VM. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param installPatchesInput Input for InstallPatches as directly received by the API. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result summary of an installation operation along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2023-03-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 {@link PollerFlux} for polling of the result summary of an installation operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + 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 {@link PollerFlux} for polling of the result summary of an installation operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of the result summary of an installation operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualMachineInstallPatchesResultInner> + beginInstallPatches( + String resourceGroupName, String vmName, VirtualMachineInstallPatchesParameters installPatchesInput) { + return this.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 {@link SyncPoller} for polling of the result summary of an installation operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualMachineInstallPatchesResultInner> + beginInstallPatches( + String resourceGroupName, + String vmName, + VirtualMachineInstallPatchesParameters installPatchesInput, + Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 body along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-03-01"; + final String accept = "application/json, text/json"; + return FluxUtil + .withContext( + context -> + service + .runCommand( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Run command on the VM. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Run command operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2023-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RunCommandResultInner> beginRunCommand( + String resourceGroupName, String vmName, RunCommandInput parameters) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RunCommandResultInner> beginRunCommand( + String resourceGroupName, String vmName, RunCommandInput parameters, Context context) { + return this.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 body on successful completion of {@link Mono}. + */ + @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 body on successful completion of {@link Mono}. + */ + @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 URL to get the next list of items + *

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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByLocationNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByLocationNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 URL to get the next list of items + *

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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listAllNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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..c8d28536b9394 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachinesImpl.java @@ -0,0 +1,447 @@ +// Copyright (c) Microsoft Corporation. All rights 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.ExpandTypeForListVMs; +import com.azure.resourcemanager.compute.generated.models.ExpandTypesForListVMs; +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; + +public final class VirtualMachinesImpl implements VirtualMachines { + private static 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) { + this.serviceClient().delete(resourceGroupName, vmName); + } + + public void delete(String resourceGroupName, String vmName, Boolean forceDeletion, Context context) { + this.serviceClient().delete(resourceGroupName, vmName, forceDeletion, context); + } + + 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 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 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 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 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, Boolean hibernate, Context context) { + this.serviceClient().deallocate(resourceGroupName, vmName, hibernate, context); + } + + public Response generalizeWithResponse(String resourceGroupName, String vmName, Context context) { + return this.serviceClient().generalizeWithResponse(resourceGroupName, vmName, context); + } + + public void generalize(String resourceGroupName, String vmName) { + this.serviceClient().generalize(resourceGroupName, vmName); + } + + 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, String filter, ExpandTypeForListVMs expand, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, filter, expand, 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, String filter, ExpandTypesForListVMs expand, Context context) { + PagedIterable inner = this.serviceClient().list(statusOnly, filter, expand, 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) { + 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) { + this.serviceClient().reimage(resourceGroupName, vmName); + } + + public void reimage( + String resourceGroupName, String vmName, VirtualMachineReimageParameters parameters, Context context) { + this.serviceClient().reimage(resourceGroupName, vmName, parameters, context); + } + + 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 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 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 Response simulateEvictionWithResponse(String resourceGroupName, String vmName, Context context) { + return this.serviceClient().simulateEvictionWithResponse(resourceGroupName, vmName, context); + } + + public void simulateEviction(String resourceGroupName, String vmName) { + this.serviceClient().simulateEviction(resourceGroupName, vmName); + } + + 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/VmImagesInEdgeZoneListResultImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VmImagesInEdgeZoneListResultImpl.java new file mode 100644 index 0000000000000..236cc83bcacba --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VmImagesInEdgeZoneListResultImpl.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineImageResourceInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VmImagesInEdgeZoneListResultInner; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineImageResource; +import com.azure.resourcemanager.compute.generated.models.VmImagesInEdgeZoneListResult; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class VmImagesInEdgeZoneListResultImpl implements VmImagesInEdgeZoneListResult { + private VmImagesInEdgeZoneListResultInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + VmImagesInEdgeZoneListResultImpl( + VmImagesInEdgeZoneListResultInner 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 VirtualMachineImageResourceImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public VmImagesInEdgeZoneListResultInner 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/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..825d1d2a739cc --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AccessLevel.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.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 a new instance of AccessLevel value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AccessLevel() { + } + + /** + * 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); + } + + /** + * Gets known AccessLevel values. + * + * @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..9c5bfb05d00ed --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AccessUri.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.resourcemanager.compute.generated.fluent.models.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 securityDataAccessSas property: A SAS uri for accessing a VM guest state. + * + * @return the securityDataAccessSas value. + */ + String securityDataAccessSas(); + + /** + * 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..14e260652331b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AdditionalCapabilities.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.fasterxml.jackson.annotation.JsonProperty; + +/** Enables or disables a capability on the virtual machine or virtual machine scale set. */ +@Fluent +public final class AdditionalCapabilities { + /* + * 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; + + /* + * The flag that enables or disables hibernation capability on the VM. + */ + @JsonProperty(value = "hibernationEnabled") + private Boolean hibernationEnabled; + + /** Creates an instance of AdditionalCapabilities class. */ + public AdditionalCapabilities() { + } + + /** + * 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; + } + + /** + * Get the hibernationEnabled property: The flag that enables or disables hibernation capability on the VM. + * + * @return the hibernationEnabled value. + */ + public Boolean hibernationEnabled() { + return this.hibernationEnabled; + } + + /** + * Set the hibernationEnabled property: The flag that enables or disables hibernation capability on the VM. + * + * @param hibernationEnabled the hibernationEnabled value to set. + * @return the AdditionalCapabilities object itself. + */ + public AdditionalCapabilities withHibernationEnabled(Boolean hibernationEnabled) { + this.hibernationEnabled = hibernationEnabled; + 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..aea7eb18598fb --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AdditionalUnattendContent.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +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 { + /* + * 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; + + /** Creates an instance of AdditionalUnattendContent class. */ + public AdditionalUnattendContent() { + } + + /** + * 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..c93cfd061516b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AggregatedReplicationState.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** This is the aggregated replication status based on all the regional replication status flags. */ +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 a new instance of AggregatedReplicationState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AggregatedReplicationState() { + } + + /** + * 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); + } + + /** + * Gets known AggregatedReplicationState values. + * + * @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/AlternativeOption.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AlternativeOption.java new file mode 100644 index 0000000000000..7144d9a84154f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AlternativeOption.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.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the alternative option specified by the Publisher for this image when this image is deprecated. */ +@Fluent +public final class AlternativeOption { + /* + * Describes the type of the alternative option. + */ + @JsonProperty(value = "type") + private AlternativeType type; + + /* + * Indicates the alternative option value specified by the Publisher. This is the Offer name when the type is Offer + * or the Plan name when the type is Plan. + */ + @JsonProperty(value = "value") + private String value; + + /** Creates an instance of AlternativeOption class. */ + public AlternativeOption() { + } + + /** + * Get the type property: Describes the type of the alternative option. + * + * @return the type value. + */ + public AlternativeType type() { + return this.type; + } + + /** + * Set the type property: Describes the type of the alternative option. + * + * @param type the type value to set. + * @return the AlternativeOption object itself. + */ + public AlternativeOption withType(AlternativeType type) { + this.type = type; + return this; + } + + /** + * Get the value property: Indicates the alternative option value specified by the Publisher. This is the Offer name + * when the type is Offer or the Plan name when the type is Plan. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: Indicates the alternative option value specified by the Publisher. This is the Offer name + * when the type is Offer or the Plan name when the type is Plan. + * + * @param value the value value to set. + * @return the AlternativeOption object itself. + */ + public AlternativeOption 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/AlternativeType.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AlternativeType.java new file mode 100644 index 0000000000000..9c8c2b8c95907 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AlternativeType.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Describes the type of the alternative option. */ +public final class AlternativeType extends ExpandableStringEnum { + /** Static value None for AlternativeType. */ + public static final AlternativeType NONE = fromString("None"); + + /** Static value Offer for AlternativeType. */ + public static final AlternativeType OFFER = fromString("Offer"); + + /** Static value Plan for AlternativeType. */ + public static final AlternativeType PLAN = fromString("Plan"); + + /** + * Creates a new instance of AlternativeType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AlternativeType() { + } + + /** + * Creates or finds a AlternativeType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AlternativeType. + */ + @JsonCreator + public static AlternativeType fromString(String name) { + return fromString(name, AlternativeType.class); + } + + /** + * Gets known AlternativeType values. + * + * @return known AlternativeType values. + */ + public static Collection values() { + return values(AlternativeType.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..2950e7a00f4f6 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ApiEntityReference.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.fasterxml.jackson.annotation.JsonProperty; + +/** The API entity reference. */ +@Fluent +public final class ApiEntityReference { + /* + * The ARM resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... + */ + @JsonProperty(value = "id") + private String id; + + /** Creates an instance of ApiEntityReference class. */ + public ApiEntityReference() { + } + + /** + * 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..f2b12f5394180 --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** An error response from the Compute service. */ +@Immutable +public final class ApiError extends ManagementError { + /* + * The Api inner error + */ + @JsonProperty(value = "innererror", access = JsonProperty.Access.WRITE_ONLY) + private InnerError innererror; + + /** Creates an instance of ApiError class. */ + public ApiError() { + } + + /** + * 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..0bb8a6ebdcc1d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ApiErrorException.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.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); + } + + /** {@inheritDoc} */ + @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/ApplicationProfile.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ApplicationProfile.java new file mode 100644 index 0000000000000..648109e848eb3 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ApplicationProfile.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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Contains the list of gallery applications that should be made available to the VM/VMSS. */ +@Fluent +public final class ApplicationProfile { + /* + * Specifies the gallery applications that should be made available to the VM/VMSS + */ + @JsonProperty(value = "galleryApplications") + private List galleryApplications; + + /** Creates an instance of ApplicationProfile class. */ + public ApplicationProfile() { + } + + /** + * Get the galleryApplications property: Specifies the gallery applications that should be made available to the + * VM/VMSS. + * + * @return the galleryApplications value. + */ + public List galleryApplications() { + return this.galleryApplications; + } + + /** + * Set the galleryApplications property: Specifies the gallery applications that should be made available to the + * VM/VMSS. + * + * @param galleryApplications the galleryApplications value to set. + * @return the ApplicationProfile object itself. + */ + public ApplicationProfile withGalleryApplications(List galleryApplications) { + this.galleryApplications = galleryApplications; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (galleryApplications() != null) { + galleryApplications().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Architecture.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Architecture.java new file mode 100644 index 0000000000000..2f60e280aeb45 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Architecture.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; + +/** The architecture of the image. Applicable to OS disks only. */ +public final class Architecture extends ExpandableStringEnum { + /** Static value x64 for Architecture. */ + public static final Architecture X64 = fromString("x64"); + + /** Static value Arm64 for Architecture. */ + public static final Architecture ARM64 = fromString("Arm64"); + + /** + * Creates a new instance of Architecture value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Architecture() { + } + + /** + * Creates or finds a Architecture from its string representation. + * + * @param name a name to look for. + * @return the corresponding Architecture. + */ + @JsonCreator + public static Architecture fromString(String name) { + return fromString(name, Architecture.class); + } + + /** + * Gets known Architecture values. + * + * @return known Architecture values. + */ + public static Collection values() { + return values(Architecture.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ArchitectureTypes.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ArchitectureTypes.java new file mode 100644 index 0000000000000..24b0ba045f645 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ArchitectureTypes.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; + +/** Specifies the Architecture Type. */ +public final class ArchitectureTypes extends ExpandableStringEnum { + /** Static value x64 for ArchitectureTypes. */ + public static final ArchitectureTypes X64 = fromString("x64"); + + /** Static value Arm64 for ArchitectureTypes. */ + public static final ArchitectureTypes ARM64 = fromString("Arm64"); + + /** + * Creates a new instance of ArchitectureTypes value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ArchitectureTypes() { + } + + /** + * Creates or finds a ArchitectureTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding ArchitectureTypes. + */ + @JsonCreator + public static ArchitectureTypes fromString(String name) { + return fromString(name, ArchitectureTypes.class); + } + + /** + * Gets known ArchitectureTypes values. + * + * @return known ArchitectureTypes values. + */ + public static Collection values() { + return values(ArchitectureTypes.class); + } +} 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..7eb3a1187a540 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AutomaticOSUpgradePolicy.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The configuration parameters used for performing automatic OS upgrade. */ +@Fluent +public final class AutomaticOSUpgradePolicy { + /* + * 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; + + /* + * Indicates whether rolling upgrade policy should be used during Auto OS Upgrade. Default value is false. Auto OS + * Upgrade will fallback to the default policy if no policy is defined on the VMSS. + */ + @JsonProperty(value = "useRollingUpgradePolicy") + private Boolean useRollingUpgradePolicy; + + /** Creates an instance of AutomaticOSUpgradePolicy class. */ + public AutomaticOSUpgradePolicy() { + } + + /** + * 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. 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. 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; + } + + /** + * Get the useRollingUpgradePolicy property: Indicates whether rolling upgrade policy should be used during Auto OS + * Upgrade. Default value is false. Auto OS Upgrade will fallback to the default policy if no policy is defined on + * the VMSS. + * + * @return the useRollingUpgradePolicy value. + */ + public Boolean useRollingUpgradePolicy() { + return this.useRollingUpgradePolicy; + } + + /** + * Set the useRollingUpgradePolicy property: Indicates whether rolling upgrade policy should be used during Auto OS + * Upgrade. Default value is false. Auto OS Upgrade will fallback to the default policy if no policy is defined on + * the VMSS. + * + * @param useRollingUpgradePolicy the useRollingUpgradePolicy value to set. + * @return the AutomaticOSUpgradePolicy object itself. + */ + public AutomaticOSUpgradePolicy withUseRollingUpgradePolicy(Boolean useRollingUpgradePolicy) { + this.useRollingUpgradePolicy = useRollingUpgradePolicy; + 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..1d40835108996 --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** Describes automatic OS upgrade properties on the image. */ +@Fluent +public final class AutomaticOSUpgradeProperties { + /* + * Specifies whether automatic OS upgrade is supported on the image. + */ + @JsonProperty(value = "automaticOSUpgradeSupported", required = true) + private boolean automaticOSUpgradeSupported; + + /** Creates an instance of AutomaticOSUpgradeProperties class. */ + public AutomaticOSUpgradeProperties() { + } + + /** + * 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..cd6ca44c56def --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AutomaticRepairsPolicy.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.fasterxml.jackson.annotation.JsonProperty; + +/** Specifies the configuration parameters for automatic repairs on the virtual machine scale set. */ +@Fluent +public final class AutomaticRepairsPolicy { + /* + * 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 10 minutes (PT10M), which is also the + * default value. The maximum allowed grace period is 90 minutes (PT90M). + */ + @JsonProperty(value = "gracePeriod") + private String gracePeriod; + + /* + * Type of repair action (replace, restart, reimage) that will be used for repairing unhealthy virtual machines in + * the scale set. Default value is replace. + */ + @JsonProperty(value = "repairAction") + private RepairAction repairAction; + + /** Creates an instance of AutomaticRepairsPolicy class. */ + public AutomaticRepairsPolicy() { + } + + /** + * 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 10 minutes + * (PT10M), 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 10 minutes + * (PT10M), 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; + } + + /** + * Get the repairAction property: Type of repair action (replace, restart, reimage) that will be used for repairing + * unhealthy virtual machines in the scale set. Default value is replace. + * + * @return the repairAction value. + */ + public RepairAction repairAction() { + return this.repairAction; + } + + /** + * Set the repairAction property: Type of repair action (replace, restart, reimage) that will be used for repairing + * unhealthy virtual machines in the scale set. Default value is replace. + * + * @param repairAction the repairAction value to set. + * @return the AutomaticRepairsPolicy object itself. + */ + public AutomaticRepairsPolicy withRepairAction(RepairAction repairAction) { + this.repairAction = repairAction; + 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..033a51ffff5f8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AvailabilitySet.java @@ -0,0 +1,368 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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. 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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * 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. Minimum api-version: 2018-04-01.. + * + * @param proximityPlacementGroup Specifies information about the proximity placement group that the + * availability set should be assigned to. 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. Minimum api-version: 2018-04-01.. + * + * @param proximityPlacementGroup Specifies information about the proximity placement group that the + * availability set should be assigned to. 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..8b41106b381ca --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AvailabilitySetListResult.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.azure.resourcemanager.compute.generated.fluent.models.AvailabilitySetInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List Availability Set operation response. */ +@Fluent +public final class AvailabilitySetListResult { + /* + * 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; + + /** Creates an instance of AvailabilitySetListResult class. */ + public AvailabilitySetListResult() { + } + + /** + * 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()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AvailabilitySetListResult.class); +} 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..5a9c3e471ea50 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AvailabilitySetUpdate.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.management.SubResource; +import com.azure.resourcemanager.compute.generated.fluent.models.AvailabilitySetProperties; +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. + */ +@Fluent +public final class AvailabilitySetUpdate extends UpdateResource { + /* + * The instance view of a resource. + */ + @JsonProperty(value = "properties") + private AvailabilitySetProperties innerProperties; + + /* + * Sku of the availability set + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** Creates an instance of AvailabilitySetUpdate class. */ + public AvailabilitySetUpdate() { + } + + /** + * Get the innerProperties property: The instance view of a resource. + * + * @return the innerProperties value. + */ + private AvailabilitySetProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** {@inheritDoc} */ + @Override + public AvailabilitySetUpdate withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the platformUpdateDomainCount property: Update Domain count. + * + * @return the platformUpdateDomainCount value. + */ + public Integer platformUpdateDomainCount() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new AvailabilitySetProperties(); + } + this.innerProperties().withPlatformUpdateDomainCount(platformUpdateDomainCount); + return this; + } + + /** + * Get the platformFaultDomainCount property: Fault Domain count. + * + * @return the platformFaultDomainCount value. + */ + public Integer platformFaultDomainCount() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new AvailabilitySetProperties(); + } + this.innerProperties().withPlatformFaultDomainCount(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new AvailabilitySetProperties(); + } + this.innerProperties().withVirtualMachines(virtualMachines); + return this; + } + + /** + * Get the proximityPlacementGroup property: Specifies information about the proximity placement group that the + * availability set should be assigned to. Minimum api-version: 2018-04-01. + * + * @return the proximityPlacementGroup value. + */ + public SubResource proximityPlacementGroup() { + return this.innerProperties() == null ? null : this.innerProperties().proximityPlacementGroup(); + } + + /** + * Set the proximityPlacementGroup property: Specifies information about the proximity placement group that the + * availability set should be assigned to. Minimum api-version: 2018-04-01. + * + * @param proximityPlacementGroup the proximityPlacementGroup value to set. + * @return the AvailabilitySetUpdate object itself. + */ + public AvailabilitySetUpdate withProximityPlacementGroup(SubResource proximityPlacementGroup) { + if (this.innerProperties() == null) { + this.innerProperties = new AvailabilitySetProperties(); + } + this.innerProperties().withProximityPlacementGroup(proximityPlacementGroup); + return this; + } + + /** + * Get the statuses property: The resource status information. + * + * @return the statuses value. + */ + public List statuses() { + return this.innerProperties() == null ? null : this.innerProperties().statuses(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + if (sku() != null) { + sku().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..c80ba1a6f1615 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AvailabilitySets.java @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of AvailabilitySets. */ +public interface AvailabilitySets { + /** + * 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByResourceGroupWithResponse( + String resourceGroupName, String availabilitySetName, 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.resourcemanager.compute.generated.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 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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 along + * with {@link Response}. + */ + Response getByResourceGroupWithResponse( + 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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); + + /** + * Lists all availability sets in 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 Availability Set operation response as paginated response with {@link PagedIterable}. + */ + 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.resourcemanager.compute.generated.models.ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + 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.resourcemanager.compute.generated.models.ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + 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.resourcemanager.compute.generated.models.ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + 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.resourcemanager.compute.generated.models.ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + 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.resourcemanager.compute.generated.models.ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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 along + * with {@link Response}. + */ + 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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 along + * with {@link Response}. + */ + 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.resourcemanager.compute.generated.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 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response 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..f84407f6af247 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AvailablePatchSummary.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed 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.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 { + /* + * 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; + + /** Creates an instance of AvailablePatchSummary class. */ + public AvailablePatchSummary() { + } + + /** + * 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..67e9ed4742433 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/BillingProfile.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.fasterxml.jackson.annotation.JsonProperty; + +/** Specifies the billing related details of a Azure Spot VM or VMSS. Minimum api-version: 2019-03-01. */ +@Fluent +public final class BillingProfile { + /* + * 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; + + /** Creates an instance of BillingProfile class. */ + public BillingProfile() { + } + + /** + * 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..9b33e6855d213 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/BootDiagnostics.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.fasterxml.jackson.annotation.JsonProperty; + +/** + * 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. + */ +@Fluent +public final class BootDiagnostics { + /* + * 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; + + /** Creates an instance of BootDiagnostics class. */ + public BootDiagnostics() { + } + + /** + * 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. 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. 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..45b96f7c23939 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/BootDiagnosticsInstanceView.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.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The instance view of a virtual machine boot diagnostics. */ +@Immutable +public final class BootDiagnosticsInstanceView { + /* + * 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; + + /** Creates an instance of BootDiagnosticsInstanceView class. */ + public BootDiagnosticsInstanceView() { + } + + /** + * Get the consoleScreenshotBlobUri property: The console screenshot blob URI. **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. **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. **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..5a5e14e632361 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CachingTypes.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.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Specifies the caching requirements. Possible values are: **None,** **ReadOnly,** **ReadWrite.** The default values + * are: **None for Standard storage. ReadOnly for Premium storage**. + */ +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) { + if (value == null) { + return null; + } + CachingTypes[] items = CachingTypes.values(); + for (CachingTypes item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservation.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservation.java new file mode 100644 index 0000000000000..8c2b6bd2195d8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservation.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.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.CapacityReservationInner; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of CapacityReservation. */ +public interface CapacityReservation { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the sku property: SKU of the resource for which capacity needs be reserved. The SKU name and capacity is + * required to be set. Currently VM Skus with the capability called 'CapacityReservationSupported' set to true are + * supported. Refer to List Microsoft.Compute SKUs in a region + * (https://docs.microsoft.com/rest/api/compute/resourceskus/list) for supported values. + * + * @return the sku value. + */ + Sku sku(); + + /** + * Gets the zones property: Availability Zone to use for this capacity reservation. The zone has to be single value + * and also should be part for the list of zones specified during the capacity reservation group creation. The zone + * can be assigned only during creation. If not provided, the reservation supports only non-zonal deployments. If + * provided, enforces VM/VMSS using this capacity reservation to be in same zone. + * + * @return the zones value. + */ + List zones(); + + /** + * Gets the reservationId property: A unique id generated and assigned to the capacity reservation by the platform + * which does not change throughout the lifetime of the resource. + * + * @return the reservationId value. + */ + String reservationId(); + + /** + * Gets the platformFaultDomainCount property: Specifies the value of fault domain count that Capacity Reservation + * supports for requested VM size. **Note:** The fault domain count specified for a resource (like virtual machines + * scale set) must be less than or equal to this value if it deploys using capacity reservation. Minimum + * api-version: 2022-08-01. + * + * @return the platformFaultDomainCount value. + */ + Integer platformFaultDomainCount(); + + /** + * Gets the virtualMachinesAssociated property: A list of all virtual machine resource ids that are associated with + * the capacity reservation. + * + * @return the virtualMachinesAssociated value. + */ + List virtualMachinesAssociated(); + + /** + * Gets the provisioningTime property: The date time when the capacity reservation was last updated. + * + * @return the provisioningTime value. + */ + OffsetDateTime provisioningTime(); + + /** + * Gets the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the instanceView property: The Capacity reservation instance view. + * + * @return the instanceView value. + */ + CapacityReservationInstanceView instanceView(); + + /** + * Gets the timeCreated property: Specifies the time at which the Capacity Reservation resource was created. Minimum + * api-version: 2021-11-01. + * + * @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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.compute.generated.fluent.models.CapacityReservationInner object. + * + * @return the inner object. + */ + CapacityReservationInner innerModel(); + + /** The entirety of the CapacityReservation definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithSku, + DefinitionStages.WithCreate { + } + /** The CapacityReservation definition stages. */ + interface DefinitionStages { + /** The first stage of the CapacityReservation definition. */ + interface Blank extends WithLocation { + } + /** The stage of the CapacityReservation definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + /** The stage of the CapacityReservation definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, capacityReservationGroupName. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @return the next definition stage. + */ + WithSku withExistingCapacityReservationGroup(String resourceGroupName, String capacityReservationGroupName); + } + /** The stage of the CapacityReservation definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: SKU of the resource for which capacity needs be reserved. The SKU name and + * capacity is required to be set. Currently VM Skus with the capability called + * 'CapacityReservationSupported' set to true are supported. Refer to List Microsoft.Compute SKUs in a + * region (https://docs.microsoft.com/rest/api/compute/resourceskus/list) for supported values.. + * + * @param sku SKU of the resource for which capacity needs be reserved. The SKU name and capacity is + * required to be set. Currently VM Skus with the capability called 'CapacityReservationSupported' set + * to true are supported. Refer to List Microsoft.Compute SKUs in a region + * (https://docs.microsoft.com/rest/api/compute/resourceskus/list) for supported values. + * @return the next definition stage. + */ + WithCreate withSku(Sku sku); + } + /** + * The stage of the CapacityReservation definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithZones { + /** + * Executes the create request. + * + * @return the created resource. + */ + CapacityReservation create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + CapacityReservation create(Context context); + } + /** The stage of the CapacityReservation definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the CapacityReservation definition allowing to specify zones. */ + interface WithZones { + /** + * Specifies the zones property: Availability Zone to use for this capacity reservation. The zone has to be + * single value and also should be part for the list of zones specified during the capacity reservation + * group creation. The zone can be assigned only during creation. If not provided, the reservation supports + * only non-zonal deployments. If provided, enforces VM/VMSS using this capacity reservation to be in same + * zone.. + * + * @param zones Availability Zone to use for this capacity reservation. The zone has to be single value and + * also should be part for the list of zones specified during the capacity reservation group creation. + * The zone can be assigned only during creation. If not provided, the reservation supports only + * non-zonal deployments. If provided, enforces VM/VMSS using this capacity reservation to be in same + * zone. + * @return the next definition stage. + */ + WithCreate withZones(List zones); + } + } + /** + * Begins update for the CapacityReservation resource. + * + * @return the stage of resource update. + */ + CapacityReservation.Update update(); + + /** The template for CapacityReservation update. */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithSku { + /** + * Executes the update request. + * + * @return the updated resource. + */ + CapacityReservation apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + CapacityReservation apply(Context context); + } + /** The CapacityReservation update stages. */ + interface UpdateStages { + /** The stage of the CapacityReservation update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the CapacityReservation update allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: SKU of the resource for which capacity needs be reserved. The SKU name and + * capacity is required to be set. Currently VM Skus with the capability called + * 'CapacityReservationSupported' set to true are supported. Refer to List Microsoft.Compute SKUs in a + * region (https://docs.microsoft.com/rest/api/compute/resourceskus/list) for supported values.. + * + * @param sku SKU of the resource for which capacity needs be reserved. The SKU name and capacity is + * required to be set. Currently VM Skus with the capability called 'CapacityReservationSupported' set + * to true are supported. Refer to List Microsoft.Compute SKUs in a region + * (https://docs.microsoft.com/rest/api/compute/resourceskus/list) for supported values. + * @return the next definition stage. + */ + Update withSku(Sku sku); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + CapacityReservation refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + CapacityReservation refresh(Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationGroup.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationGroup.java new file mode 100644 index 0000000000000..fc533361b284c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationGroup.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.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.CapacityReservationGroupInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of CapacityReservationGroup. */ +public interface CapacityReservationGroup { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the zones property: Availability Zones to use for this capacity reservation group. The zones can be assigned + * only during creation. If not provided, the group supports only regional resources in the region. If provided, + * enforces each capacity reservation in the group to be in one of the zones. + * + * @return the zones value. + */ + List zones(); + + /** + * Gets the capacityReservations property: A list of all capacity reservation resource ids that belong to capacity + * reservation group. + * + * @return the capacityReservations value. + */ + List capacityReservations(); + + /** + * Gets the virtualMachinesAssociated property: A list of references to all virtual machines associated to the + * capacity reservation group. + * + * @return the virtualMachinesAssociated value. + */ + List virtualMachinesAssociated(); + + /** + * Gets the instanceView property: The capacity reservation group instance view which has the list of instance views + * for all the capacity reservations that belong to the capacity reservation group. + * + * @return the instanceView value. + */ + CapacityReservationGroupInstanceView instanceView(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.compute.generated.fluent.models.CapacityReservationGroupInner object. + * + * @return the inner object. + */ + CapacityReservationGroupInner innerModel(); + + /** The entirety of the CapacityReservationGroup definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The CapacityReservationGroup definition stages. */ + interface DefinitionStages { + /** The first stage of the CapacityReservationGroup definition. */ + interface Blank extends WithLocation { + } + /** The stage of the CapacityReservationGroup definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the CapacityReservationGroup definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the CapacityReservationGroup definition which contains all the minimum required properties for + * the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithZones { + /** + * Executes the create request. + * + * @return the created resource. + */ + CapacityReservationGroup create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + CapacityReservationGroup create(Context context); + } + /** The stage of the CapacityReservationGroup definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the CapacityReservationGroup definition allowing to specify zones. */ + interface WithZones { + /** + * Specifies the zones property: Availability Zones to use for this capacity reservation group. The zones + * can be assigned only during creation. If not provided, the group supports only regional resources in the + * region. If provided, enforces each capacity reservation in the group to be in one of the zones.. + * + * @param zones Availability Zones to use for this capacity reservation group. The zones can be assigned + * only during creation. If not provided, the group supports only regional resources in the region. If + * provided, enforces each capacity reservation in the group to be in one of the zones. + * @return the next definition stage. + */ + WithCreate withZones(List zones); + } + } + /** + * Begins update for the CapacityReservationGroup resource. + * + * @return the stage of resource update. + */ + CapacityReservationGroup.Update update(); + + /** The template for CapacityReservationGroup update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + CapacityReservationGroup apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + CapacityReservationGroup apply(Context context); + } + /** The CapacityReservationGroup update stages. */ + interface UpdateStages { + /** The stage of the CapacityReservationGroup update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + CapacityReservationGroup refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + CapacityReservationGroup refresh(Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationGroupInstanceView.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationGroupInstanceView.java new file mode 100644 index 0000000000000..a079059078ea5 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationGroupInstanceView.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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The CapacityReservationGroupInstanceView model. */ +@Immutable +public final class CapacityReservationGroupInstanceView { + /* + * List of instance view of the capacity reservations under the capacity reservation group. + */ + @JsonProperty(value = "capacityReservations", access = JsonProperty.Access.WRITE_ONLY) + private List capacityReservations; + + /** Creates an instance of CapacityReservationGroupInstanceView class. */ + public CapacityReservationGroupInstanceView() { + } + + /** + * Get the capacityReservations property: List of instance view of the capacity reservations under the capacity + * reservation group. + * + * @return the capacityReservations value. + */ + public List capacityReservations() { + return this.capacityReservations; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (capacityReservations() != null) { + capacityReservations().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationGroupInstanceViewTypes.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationGroupInstanceViewTypes.java new file mode 100644 index 0000000000000..e2ccf0e5a555e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationGroupInstanceViewTypes.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for CapacityReservationGroupInstanceViewTypes. */ +public final class CapacityReservationGroupInstanceViewTypes + extends ExpandableStringEnum { + /** Static value instanceView for CapacityReservationGroupInstanceViewTypes. */ + public static final CapacityReservationGroupInstanceViewTypes INSTANCE_VIEW = fromString("instanceView"); + + /** + * Creates a new instance of CapacityReservationGroupInstanceViewTypes value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CapacityReservationGroupInstanceViewTypes() { + } + + /** + * Creates or finds a CapacityReservationGroupInstanceViewTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding CapacityReservationGroupInstanceViewTypes. + */ + @JsonCreator + public static CapacityReservationGroupInstanceViewTypes fromString(String name) { + return fromString(name, CapacityReservationGroupInstanceViewTypes.class); + } + + /** + * Gets known CapacityReservationGroupInstanceViewTypes values. + * + * @return known CapacityReservationGroupInstanceViewTypes values. + */ + public static Collection values() { + return values(CapacityReservationGroupInstanceViewTypes.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationGroupListResult.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationGroupListResult.java new file mode 100644 index 0000000000000..88ec15068ac9a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationGroupListResult.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.azure.resourcemanager.compute.generated.fluent.models.CapacityReservationGroupInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List capacity reservation group with resource group response. */ +@Fluent +public final class CapacityReservationGroupListResult { + /* + * The list of capacity reservation groups + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The URI to fetch the next page of capacity reservation groups. Call ListNext() with this URI to fetch the next + * page of capacity reservation groups. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of CapacityReservationGroupListResult class. */ + public CapacityReservationGroupListResult() { + } + + /** + * Get the value property: The list of capacity reservation groups. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of capacity reservation groups. + * + * @param value the value value to set. + * @return the CapacityReservationGroupListResult object itself. + */ + public CapacityReservationGroupListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URI to fetch the next page of capacity reservation groups. Call ListNext() with + * this URI to fetch the next page of capacity reservation groups. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URI to fetch the next page of capacity reservation groups. Call ListNext() with + * this URI to fetch the next page of capacity reservation groups. + * + * @param nextLink the nextLink value to set. + * @return the CapacityReservationGroupListResult object itself. + */ + public CapacityReservationGroupListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property value in model CapacityReservationGroupListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CapacityReservationGroupListResult.class); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationGroupUpdate.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationGroupUpdate.java new file mode 100644 index 0000000000000..10a44d162c8c5 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationGroupUpdate.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.resourcemanager.compute.generated.fluent.models.CapacityReservationGroupProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Specifies information about the capacity reservation group. Only tags can be updated. */ +@Fluent +public final class CapacityReservationGroupUpdate extends UpdateResource { + /* + * capacity reservation group Properties. + */ + @JsonProperty(value = "properties") + private CapacityReservationGroupProperties innerProperties; + + /** Creates an instance of CapacityReservationGroupUpdate class. */ + public CapacityReservationGroupUpdate() { + } + + /** + * Get the innerProperties property: capacity reservation group Properties. + * + * @return the innerProperties value. + */ + private CapacityReservationGroupProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public CapacityReservationGroupUpdate withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the capacityReservations property: A list of all capacity reservation resource ids that belong to capacity + * reservation group. + * + * @return the capacityReservations value. + */ + public List capacityReservations() { + return this.innerProperties() == null ? null : this.innerProperties().capacityReservations(); + } + + /** + * Get the virtualMachinesAssociated property: A list of references to all virtual machines associated to the + * capacity reservation group. + * + * @return the virtualMachinesAssociated value. + */ + public List virtualMachinesAssociated() { + return this.innerProperties() == null ? null : this.innerProperties().virtualMachinesAssociated(); + } + + /** + * Get the instanceView property: The capacity reservation group instance view which has the list of instance views + * for all the capacity reservations that belong to the capacity reservation group. + * + * @return the instanceView value. + */ + public CapacityReservationGroupInstanceView instanceView() { + return this.innerProperties() == null ? null : this.innerProperties().instanceView(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationGroups.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationGroups.java new file mode 100644 index 0000000000000..6658d8b6c6e1a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationGroups.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.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of CapacityReservationGroups. */ +public interface CapacityReservationGroups { + /** + * The operation to delete a capacity reservation group. This operation is allowed only if all the associated + * resources are disassociated from the reservation group and all capacity reservations under the reservation group + * have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByResourceGroupWithResponse( + String resourceGroupName, String capacityReservationGroupName, Context context); + + /** + * The operation to delete a capacity reservation group. This operation is allowed only if all the associated + * resources are disassociated from the reservation group and all capacity reservations under the reservation group + * have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String capacityReservationGroupName); + + /** + * The operation that retrieves information about a capacity reservation group. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param expand The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance + * views of the capacity reservations under the capacity reservation group which is a snapshot of the runtime + * properties of a capacity reservation that is managed by the platform and can change outside of control plane + * operations. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation group that the capacity reservations should be + * assigned to along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, + String capacityReservationGroupName, + CapacityReservationGroupInstanceViewTypes expand, + Context context); + + /** + * The operation that retrieves information about a capacity reservation group. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation group that the capacity reservations should be + * assigned to. + */ + CapacityReservationGroup getByResourceGroup(String resourceGroupName, String capacityReservationGroupName); + + /** + * Lists all of the capacity reservation groups in the specified resource group. Use the nextLink property in the + * response to get the next page of capacity reservation groups. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List capacity reservation group with resource group response as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all of the capacity reservation groups in the specified resource group. Use the nextLink property in the + * response to get the next page of capacity reservation groups. + * + * @param resourceGroupName The name of the resource group. + * @param expand The expand expression to apply on the operation. Based on the expand param(s) specified we return + * Virtual Machine or ScaleSet VM Instance or both resource Ids which are associated to capacity reservation + * group in the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List capacity reservation group with resource group response as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByResourceGroup( + String resourceGroupName, ExpandTypesForGetCapacityReservationGroups expand, Context context); + + /** + * Lists all of the capacity reservation groups in the subscription. Use the nextLink property in the response to + * get the next page of capacity reservation groups. + * + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List capacity reservation group with resource group response as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(); + + /** + * Lists all of the capacity reservation groups in the subscription. Use the nextLink property in the response to + * get the next page of capacity reservation groups. + * + * @param expand The expand expression to apply on the operation. Based on the expand param(s) specified we return + * Virtual Machine or ScaleSet VM Instance or both resource Ids which are associated to capacity reservation + * group in the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List capacity reservation group with resource group response as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(ExpandTypesForGetCapacityReservationGroups expand, Context context); + + /** + * The operation that retrieves information about a capacity reservation group. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation group that the capacity reservations should be + * assigned to along with {@link Response}. + */ + CapacityReservationGroup getById(String id); + + /** + * The operation that retrieves information about a capacity reservation group. + * + * @param id the resource ID. + * @param expand The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance + * views of the capacity reservations under the capacity reservation group which is a snapshot of the runtime + * properties of a capacity reservation that is managed by the platform and can change outside of control plane + * operations. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation group that the capacity reservations should be + * assigned to along with {@link Response}. + */ + Response getByIdWithResponse( + String id, CapacityReservationGroupInstanceViewTypes expand, Context context); + + /** + * The operation to delete a capacity reservation group. This operation is allowed only if all the associated + * resources are disassociated from the reservation group and all capacity reservations under the reservation group + * have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * The operation to delete a capacity reservation group. This operation is allowed only if all the associated + * resources are disassociated from the reservation group and all capacity reservations under the reservation group + * have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new CapacityReservationGroup resource. + * + * @param name resource name. + * @return the first stage of the new CapacityReservationGroup definition. + */ + CapacityReservationGroup.DefinitionStages.Blank define(String name); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationInstanceView.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationInstanceView.java new file mode 100644 index 0000000000000..84cbd10439b6b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationInstanceView.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * The instance view of a capacity reservation that provides as snapshot of the runtime properties of the capacity + * reservation that is managed by the platform and can change outside of control plane operations. + */ +@Fluent +public class CapacityReservationInstanceView { + /* + * Unutilized capacity of the capacity reservation. + */ + @JsonProperty(value = "utilizationInfo") + private CapacityReservationUtilization utilizationInfo; + + /* + * The resource status information. + */ + @JsonProperty(value = "statuses") + private List statuses; + + /** Creates an instance of CapacityReservationInstanceView class. */ + public CapacityReservationInstanceView() { + } + + /** + * Get the utilizationInfo property: Unutilized capacity of the capacity reservation. + * + * @return the utilizationInfo value. + */ + public CapacityReservationUtilization utilizationInfo() { + return this.utilizationInfo; + } + + /** + * Set the utilizationInfo property: Unutilized capacity of the capacity reservation. + * + * @param utilizationInfo the utilizationInfo value to set. + * @return the CapacityReservationInstanceView object itself. + */ + public CapacityReservationInstanceView withUtilizationInfo(CapacityReservationUtilization utilizationInfo) { + this.utilizationInfo = utilizationInfo; + return this; + } + + /** + * Get the statuses property: The resource status information. + * + * @return the statuses value. + */ + public List statuses() { + return this.statuses; + } + + /** + * Set the statuses property: The resource status information. + * + * @param statuses the statuses value to set. + * @return the CapacityReservationInstanceView object itself. + */ + public CapacityReservationInstanceView withStatuses(List statuses) { + this.statuses = statuses; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (utilizationInfo() != null) { + utilizationInfo().validate(); + } + if (statuses() != null) { + statuses().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationInstanceViewTypes.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationInstanceViewTypes.java new file mode 100644 index 0000000000000..e5abb0ea6181a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationInstanceViewTypes.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for CapacityReservationInstanceViewTypes. */ +public final class CapacityReservationInstanceViewTypes + extends ExpandableStringEnum { + /** Static value instanceView for CapacityReservationInstanceViewTypes. */ + public static final CapacityReservationInstanceViewTypes INSTANCE_VIEW = fromString("instanceView"); + + /** + * Creates a new instance of CapacityReservationInstanceViewTypes value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CapacityReservationInstanceViewTypes() { + } + + /** + * Creates or finds a CapacityReservationInstanceViewTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding CapacityReservationInstanceViewTypes. + */ + @JsonCreator + public static CapacityReservationInstanceViewTypes fromString(String name) { + return fromString(name, CapacityReservationInstanceViewTypes.class); + } + + /** + * Gets known CapacityReservationInstanceViewTypes values. + * + * @return known CapacityReservationInstanceViewTypes values. + */ + public static Collection values() { + return values(CapacityReservationInstanceViewTypes.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationInstanceViewWithName.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationInstanceViewWithName.java new file mode 100644 index 0000000000000..bac36196483a5 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationInstanceViewWithName.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * The instance view of a capacity reservation that includes the name of the capacity reservation. It is used for the + * response to the instance view of a capacity reservation group. + */ +@Fluent +public final class CapacityReservationInstanceViewWithName extends CapacityReservationInstanceView { + /* + * The name of the capacity reservation. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** Creates an instance of CapacityReservationInstanceViewWithName class. */ + public CapacityReservationInstanceViewWithName() { + } + + /** + * Get the name property: The name of the capacity reservation. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** {@inheritDoc} */ + @Override + public CapacityReservationInstanceViewWithName withUtilizationInfo(CapacityReservationUtilization utilizationInfo) { + super.withUtilizationInfo(utilizationInfo); + return this; + } + + /** {@inheritDoc} */ + @Override + public CapacityReservationInstanceViewWithName withStatuses(List statuses) { + super.withStatuses(statuses); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationListResult.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationListResult.java new file mode 100644 index 0000000000000..820806c14f273 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationListResult.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.azure.resourcemanager.compute.generated.fluent.models.CapacityReservationInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list capacity reservation operation response. */ +@Fluent +public final class CapacityReservationListResult { + /* + * The list of capacity reservations + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The URI to fetch the next page of capacity reservations. Call ListNext() with this URI to fetch the next page of + * capacity reservations. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of CapacityReservationListResult class. */ + public CapacityReservationListResult() { + } + + /** + * Get the value property: The list of capacity reservations. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of capacity reservations. + * + * @param value the value value to set. + * @return the CapacityReservationListResult object itself. + */ + public CapacityReservationListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URI to fetch the next page of capacity reservations. Call ListNext() with this URI + * to fetch the next page of capacity reservations. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URI to fetch the next page of capacity reservations. Call ListNext() with this URI + * to fetch the next page of capacity reservations. + * + * @param nextLink the nextLink value to set. + * @return the CapacityReservationListResult object itself. + */ + public CapacityReservationListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property value in model CapacityReservationListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CapacityReservationListResult.class); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationProfile.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationProfile.java new file mode 100644 index 0000000000000..952752516516a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationProfile.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.management.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The parameters of a capacity reservation Profile. */ +@Fluent +public final class CapacityReservationProfile { + /* + * Specifies the capacity reservation group resource id that should be used for allocating the virtual machine or + * scaleset vm instances provided enough capacity has been reserved. Please refer to + * https://aka.ms/CapacityReservation for more details. + */ + @JsonProperty(value = "capacityReservationGroup") + private SubResource capacityReservationGroup; + + /** Creates an instance of CapacityReservationProfile class. */ + public CapacityReservationProfile() { + } + + /** + * Get the capacityReservationGroup property: Specifies the capacity reservation group resource id that should be + * used for allocating the virtual machine or scaleset vm instances provided enough capacity has been reserved. + * Please refer to https://aka.ms/CapacityReservation for more details. + * + * @return the capacityReservationGroup value. + */ + public SubResource capacityReservationGroup() { + return this.capacityReservationGroup; + } + + /** + * Set the capacityReservationGroup property: Specifies the capacity reservation group resource id that should be + * used for allocating the virtual machine or scaleset vm instances provided enough capacity has been reserved. + * Please refer to https://aka.ms/CapacityReservation for more details. + * + * @param capacityReservationGroup the capacityReservationGroup value to set. + * @return the CapacityReservationProfile object itself. + */ + public CapacityReservationProfile withCapacityReservationGroup(SubResource capacityReservationGroup) { + this.capacityReservationGroup = capacityReservationGroup; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationUpdate.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationUpdate.java new file mode 100644 index 0000000000000..509b2b30c5dde --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationUpdate.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.resourcemanager.compute.generated.fluent.models.CapacityReservationProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** Specifies information about the capacity reservation. Only tags and sku.capacity can be updated. */ +@Fluent +public final class CapacityReservationUpdate extends UpdateResource { + /* + * Properties of the Capacity reservation. + */ + @JsonProperty(value = "properties") + private CapacityReservationProperties innerProperties; + + /* + * SKU of the resource for which capacity needs be reserved. The SKU name and capacity is required to be set. + * Currently VM Skus with the capability called 'CapacityReservationSupported' set to true are supported. Refer to + * List Microsoft.Compute SKUs in a region (https://docs.microsoft.com/rest/api/compute/resourceskus/list) for + * supported values. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** Creates an instance of CapacityReservationUpdate class. */ + public CapacityReservationUpdate() { + } + + /** + * Get the innerProperties property: Properties of the Capacity reservation. + * + * @return the innerProperties value. + */ + private CapacityReservationProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the sku property: SKU of the resource for which capacity needs be reserved. The SKU name and capacity is + * required to be set. Currently VM Skus with the capability called 'CapacityReservationSupported' set to true are + * supported. Refer to List Microsoft.Compute SKUs in a region + * (https://docs.microsoft.com/rest/api/compute/resourceskus/list) for supported values. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: SKU of the resource for which capacity needs be reserved. The SKU name and capacity is + * required to be set. Currently VM Skus with the capability called 'CapacityReservationSupported' set to true are + * supported. Refer to List Microsoft.Compute SKUs in a region + * (https://docs.microsoft.com/rest/api/compute/resourceskus/list) for supported values. + * + * @param sku the sku value to set. + * @return the CapacityReservationUpdate object itself. + */ + public CapacityReservationUpdate withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** {@inheritDoc} */ + @Override + public CapacityReservationUpdate withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the reservationId property: A unique id generated and assigned to the capacity reservation by the platform + * which does not change throughout the lifetime of the resource. + * + * @return the reservationId value. + */ + public String reservationId() { + return this.innerProperties() == null ? null : this.innerProperties().reservationId(); + } + + /** + * Get the platformFaultDomainCount property: Specifies the value of fault domain count that Capacity Reservation + * supports for requested VM size. **Note:** The fault domain count specified for a resource (like virtual machines + * scale set) must be less than or equal to this value if it deploys using capacity reservation. Minimum + * api-version: 2022-08-01. + * + * @return the platformFaultDomainCount value. + */ + public Integer platformFaultDomainCount() { + return this.innerProperties() == null ? null : this.innerProperties().platformFaultDomainCount(); + } + + /** + * Get the virtualMachinesAssociated property: A list of all virtual machine resource ids that are associated with + * the capacity reservation. + * + * @return the virtualMachinesAssociated value. + */ + public List virtualMachinesAssociated() { + return this.innerProperties() == null ? null : this.innerProperties().virtualMachinesAssociated(); + } + + /** + * Get the provisioningTime property: The date time when the capacity reservation was last updated. + * + * @return the provisioningTime value. + */ + public OffsetDateTime provisioningTime() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningTime(); + } + + /** + * Get the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the instanceView property: The Capacity reservation instance view. + * + * @return the instanceView value. + */ + public CapacityReservationInstanceView instanceView() { + return this.innerProperties() == null ? null : this.innerProperties().instanceView(); + } + + /** + * Get the timeCreated property: Specifies the time at which the Capacity Reservation resource was created. Minimum + * api-version: 2021-11-01. + * + * @return the timeCreated value. + */ + public OffsetDateTime timeCreated() { + return this.innerProperties() == null ? null : this.innerProperties().timeCreated(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + if (sku() != null) { + sku().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationUtilization.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationUtilization.java new file mode 100644 index 0000000000000..847640582e7de --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationUtilization.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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Represents the capacity reservation utilization in terms of resources allocated. */ +@Immutable +public final class CapacityReservationUtilization { + /* + * The value provides the current capacity of the VM size which was reserved successfully and for which the + * customer is getting billed. Minimum api-version: 2022-08-01. + */ + @JsonProperty(value = "currentCapacity", access = JsonProperty.Access.WRITE_ONLY) + private Integer currentCapacity; + + /* + * A list of all virtual machines resource ids allocated against the capacity reservation. + */ + @JsonProperty(value = "virtualMachinesAllocated", access = JsonProperty.Access.WRITE_ONLY) + private List virtualMachinesAllocated; + + /** Creates an instance of CapacityReservationUtilization class. */ + public CapacityReservationUtilization() { + } + + /** + * Get the currentCapacity property: The value provides the current capacity of the VM size which was reserved + * successfully and for which the customer is getting billed. Minimum api-version: 2022-08-01. + * + * @return the currentCapacity value. + */ + public Integer currentCapacity() { + return this.currentCapacity; + } + + /** + * Get the virtualMachinesAllocated property: A list of all virtual machines resource ids allocated against the + * capacity reservation. + * + * @return the virtualMachinesAllocated value. + */ + public List virtualMachinesAllocated() { + return this.virtualMachinesAllocated; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (virtualMachinesAllocated() != null) { + virtualMachinesAllocated().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservations.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservations.java new file mode 100644 index 0000000000000..1160c3236e860 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservations.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of CapacityReservations. */ +public interface CapacityReservations { + /** + * The operation to delete a capacity reservation. This operation is allowed only when all the associated resources + * are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more + * details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String capacityReservationGroupName, String capacityReservationName); + + /** + * The operation to delete a capacity reservation. This operation is allowed only when all the associated resources + * are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more + * details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete( + String resourceGroupName, String capacityReservationGroupName, String capacityReservationName, Context context); + + /** + * The operation that retrieves information about the capacity reservation. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param expand The expand expression to apply on the operation. 'InstanceView' retrieves a snapshot of the runtime + * properties of the capacity reservation that is managed by the platform and can change outside of control + * plane operations. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + CapacityReservationInstanceViewTypes expand, + Context context); + + /** + * The operation that retrieves information about the capacity reservation. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation. + */ + CapacityReservation get( + String resourceGroupName, String capacityReservationGroupName, String capacityReservationName); + + /** + * Lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in + * the response to get the next page of capacity reservations. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list capacity reservation operation response as paginated response with {@link PagedIterable}. + */ + PagedIterable listByCapacityReservationGroup( + String resourceGroupName, String capacityReservationGroupName); + + /** + * Lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in + * the response to get the next page of capacity reservations. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list capacity reservation operation response as paginated response with {@link PagedIterable}. + */ + PagedIterable listByCapacityReservationGroup( + String resourceGroupName, String capacityReservationGroupName, Context context); + + /** + * The operation that retrieves information about the capacity reservation. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation along with {@link Response}. + */ + CapacityReservation getById(String id); + + /** + * The operation that retrieves information about the capacity reservation. + * + * @param id the resource ID. + * @param expand The expand expression to apply on the operation. 'InstanceView' retrieves a snapshot of the runtime + * properties of the capacity reservation that is managed by the platform and can change outside of control + * plane operations. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation along with {@link Response}. + */ + Response getByIdWithResponse( + String id, CapacityReservationInstanceViewTypes expand, Context context); + + /** + * The operation to delete a capacity reservation. This operation is allowed only when all the associated resources + * are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more + * details. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * The operation to delete a capacity reservation. This operation is allowed only when all the associated resources + * are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more + * details. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new CapacityReservation resource. + * + * @param name resource name. + * @return the first stage of the new CapacityReservation definition. + */ + CapacityReservation.DefinitionStages.Blank define(String name); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudService.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudService.java new file mode 100644 index 0000000000000..0c2a81b973f94 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudService.java @@ -0,0 +1,389 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.CloudServiceInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of CloudService. */ +public interface CloudService { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: Cloud service properties. + * + * @return the properties value. + */ + CloudServiceProperties properties(); + + /** + * Gets the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the zones property: List of logical availability zone of the resource. List should contain only 1 zone where + * cloud service should be provisioned. This field is optional. + * + * @return the zones value. + */ + List zones(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.compute.generated.fluent.models.CloudServiceInner object. + * + * @return the inner object. + */ + CloudServiceInner innerModel(); + + /** The entirety of the CloudService definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The CloudService definition stages. */ + interface DefinitionStages { + /** The first stage of the CloudService definition. */ + interface Blank extends WithLocation { + } + /** The stage of the CloudService definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the CloudService definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName Name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the CloudService definition which contains all the minimum required properties for the resource + * to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithProperties, + DefinitionStages.WithSystemData, + DefinitionStages.WithZones { + /** + * Executes the create request. + * + * @return the created resource. + */ + CloudService create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + CloudService create(Context context); + } + /** The stage of the CloudService definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the CloudService definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Cloud service properties. + * + * @param properties Cloud service properties. + * @return the next definition stage. + */ + WithCreate withProperties(CloudServiceProperties properties); + } + /** The stage of the CloudService definition allowing to specify systemData. */ + interface WithSystemData { + /** + * Specifies the systemData property: The system meta data relating to this resource.. + * + * @param systemData The system meta data relating to this resource. + * @return the next definition stage. + */ + WithCreate withSystemData(SystemData systemData); + } + /** The stage of the CloudService definition allowing to specify zones. */ + interface WithZones { + /** + * Specifies the zones property: List of logical availability zone of the resource. List should contain only + * 1 zone where cloud service should be provisioned. This field is optional.. + * + * @param zones List of logical availability zone of the resource. List should contain only 1 zone where + * cloud service should be provisioned. This field is optional. + * @return the next definition stage. + */ + WithCreate withZones(List zones); + } + } + /** + * Begins update for the CloudService resource. + * + * @return the stage of resource update. + */ + CloudService.Update update(); + + /** The template for CloudService update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + CloudService apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + CloudService apply(Context context); + } + /** The CloudService update stages. */ + interface UpdateStages { + /** The stage of the CloudService update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + CloudService refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + CloudService refresh(Context context); + + /** + * Starts the cloud service. + * + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(); + + /** + * Starts the cloud service. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(Context context); + + /** + * Power off the cloud service. Note that resources are still attached and you are getting charged for the + * resources. + * + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void powerOff(); + + /** + * Power off the cloud service. Note that resources are still attached and you are getting charged for the + * resources. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void powerOff(Context context); + + /** + * Restarts one or more role instances in a cloud service. + * + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void restart(); + + /** + * Restarts one or more role instances in a cloud service. + * + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void restart(RoleInstances parameters, Context context); + + /** + * Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. + * + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void reimage(); + + /** + * Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. + * + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void reimage(RoleInstances parameters, Context context); + + /** + * Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes + * the storage resources that are used by them. If you do not want to initialize storage resources, you can use + * Reimage Role Instances. + * + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void rebuild(); + + /** + * Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes + * the storage resources that are used by them. If you do not want to initialize storage resources, you can use + * Reimage Role Instances. + * + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void rebuild(RoleInstances parameters, Context context); + + /** + * Deletes role instances in a cloud service. + * + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteInstances(); + + /** + * Deletes role instances in a cloud service. + * + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteInstances(RoleInstances parameters, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceExtensionProfile.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceExtensionProfile.java new file mode 100644 index 0000000000000..7cdf82591d8b8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceExtensionProfile.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a cloud service extension profile. */ +@Fluent +public final class CloudServiceExtensionProfile { + /* + * List of extensions for the cloud service. + */ + @JsonProperty(value = "extensions") + private List extensions; + + /** Creates an instance of CloudServiceExtensionProfile class. */ + public CloudServiceExtensionProfile() { + } + + /** + * Get the extensions property: List of extensions for the cloud service. + * + * @return the extensions value. + */ + public List extensions() { + return this.extensions; + } + + /** + * Set the extensions property: List of extensions for the cloud service. + * + * @param extensions the extensions value to set. + * @return the CloudServiceExtensionProfile object itself. + */ + public CloudServiceExtensionProfile withExtensions(List extensions) { + this.extensions = extensions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (extensions() != null) { + extensions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceExtensionProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceExtensionProperties.java new file mode 100644 index 0000000000000..f8e14a4ab36b3 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceExtensionProperties.java @@ -0,0 +1,321 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Extension Properties. */ +@Fluent +public final class CloudServiceExtensionProperties { + /* + * The name of the extension handler publisher. + */ + @JsonProperty(value = "publisher") + private String publisher; + + /* + * Specifies the type of the extension. + */ + @JsonProperty(value = "type") + private String type; + + /* + * Specifies the version of the extension. Specifies the version of the extension. If this element is not specified + * or an asterisk (*) is used as the value, the latest version of the extension is used. If the value is specified + * with a major version number and an asterisk as the minor version number (X.), the latest minor version of the + * specified major version is selected. If a major version number and a minor version number are specified (X.Y), + * the specific extension version is selected. If a version is specified, an auto-upgrade is performed on the role + * instance. + */ + @JsonProperty(value = "typeHandlerVersion") + private String typeHandlerVersion; + + /* + * Explicitly specify whether platform can automatically upgrade typeHandlerVersion to higher minor versions when + * they become available. + */ + @JsonProperty(value = "autoUpgradeMinorVersion") + private Boolean autoUpgradeMinorVersion; + + /* + * Public settings for the extension. For JSON extensions, this is the JSON settings for the extension. For XML + * Extension (like RDP), this is the XML setting for the extension. + */ + @JsonProperty(value = "settings") + private Object settings; + + /* + * Protected settings for the extension which are encrypted before sent to the role instance. + */ + @JsonProperty(value = "protectedSettings") + private Object protectedSettings; + + /* + * Protected settings for the extension, referenced using KeyVault which are encrypted before sent to the role + * instance. + */ + @JsonProperty(value = "protectedSettingsFromKeyVault") + private CloudServiceVaultAndSecretReference protectedSettingsFromKeyVault; + + /* + * Tag to force apply the provided public and protected settings. + * Changing the tag value allows for re-running the extension without changing any of the public or protected + * settings. + * If forceUpdateTag is not changed, updates to public or protected settings would still be applied by the handler. + * If neither forceUpdateTag nor any of public or protected settings change, extension would flow to the role + * instance with the same sequence-number, and + * it is up to handler implementation whether to re-run it or not + */ + @JsonProperty(value = "forceUpdateTag") + private String forceUpdateTag; + + /* + * The provisioning state, which only appears in the response. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * Optional list of roles to apply this extension. If property is not specified or '*' is specified, extension is + * applied to all roles in the cloud service. + */ + @JsonProperty(value = "rolesAppliedTo") + private List rolesAppliedTo; + + /** Creates an instance of CloudServiceExtensionProperties class. */ + public CloudServiceExtensionProperties() { + } + + /** + * Get the publisher property: The name of the extension handler publisher. + * + * @return the publisher value. + */ + public String publisher() { + return this.publisher; + } + + /** + * Set the publisher property: The name of the extension handler publisher. + * + * @param publisher the publisher value to set. + * @return the CloudServiceExtensionProperties object itself. + */ + public CloudServiceExtensionProperties withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get the type property: Specifies the type of the extension. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: Specifies the type of the extension. + * + * @param type the type value to set. + * @return the CloudServiceExtensionProperties object itself. + */ + public CloudServiceExtensionProperties withType(String type) { + this.type = type; + return this; + } + + /** + * Get the typeHandlerVersion property: Specifies the version of the extension. Specifies the version of the + * extension. If this element is not specified or an asterisk (*) is used as the value, the latest version of the + * extension is used. If the value is specified with a major version number and an asterisk as the minor version + * number (X.), the latest minor version of the specified major version is selected. If a major version number and a + * minor version number are specified (X.Y), the specific extension version is selected. If a version is specified, + * an auto-upgrade is performed on the role instance. + * + * @return the typeHandlerVersion value. + */ + public String typeHandlerVersion() { + return this.typeHandlerVersion; + } + + /** + * Set the typeHandlerVersion property: Specifies the version of the extension. Specifies the version of the + * extension. If this element is not specified or an asterisk (*) is used as the value, the latest version of the + * extension is used. If the value is specified with a major version number and an asterisk as the minor version + * number (X.), the latest minor version of the specified major version is selected. If a major version number and a + * minor version number are specified (X.Y), the specific extension version is selected. If a version is specified, + * an auto-upgrade is performed on the role instance. + * + * @param typeHandlerVersion the typeHandlerVersion value to set. + * @return the CloudServiceExtensionProperties object itself. + */ + public CloudServiceExtensionProperties withTypeHandlerVersion(String typeHandlerVersion) { + this.typeHandlerVersion = typeHandlerVersion; + return this; + } + + /** + * Get the autoUpgradeMinorVersion property: Explicitly specify whether platform can automatically upgrade + * typeHandlerVersion to higher minor versions when they become available. + * + * @return the autoUpgradeMinorVersion value. + */ + public Boolean autoUpgradeMinorVersion() { + return this.autoUpgradeMinorVersion; + } + + /** + * Set the autoUpgradeMinorVersion property: Explicitly specify whether platform can automatically upgrade + * typeHandlerVersion to higher minor versions when they become available. + * + * @param autoUpgradeMinorVersion the autoUpgradeMinorVersion value to set. + * @return the CloudServiceExtensionProperties object itself. + */ + public CloudServiceExtensionProperties withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { + this.autoUpgradeMinorVersion = autoUpgradeMinorVersion; + return this; + } + + /** + * Get the settings property: Public settings for the extension. For JSON extensions, this is the JSON settings for + * the extension. For XML Extension (like RDP), this is the XML setting for the extension. + * + * @return the settings value. + */ + public Object settings() { + return this.settings; + } + + /** + * Set the settings property: Public settings for the extension. For JSON extensions, this is the JSON settings for + * the extension. For XML Extension (like RDP), this is the XML setting for the extension. + * + * @param settings the settings value to set. + * @return the CloudServiceExtensionProperties object itself. + */ + public CloudServiceExtensionProperties withSettings(Object settings) { + this.settings = settings; + return this; + } + + /** + * Get the protectedSettings property: Protected settings for the extension which are encrypted before sent to the + * role instance. + * + * @return the protectedSettings value. + */ + public Object protectedSettings() { + return this.protectedSettings; + } + + /** + * Set the protectedSettings property: Protected settings for the extension which are encrypted before sent to the + * role instance. + * + * @param protectedSettings the protectedSettings value to set. + * @return the CloudServiceExtensionProperties object itself. + */ + public CloudServiceExtensionProperties withProtectedSettings(Object protectedSettings) { + this.protectedSettings = protectedSettings; + return this; + } + + /** + * Get the protectedSettingsFromKeyVault property: Protected settings for the extension, referenced using KeyVault + * which are encrypted before sent to the role instance. + * + * @return the protectedSettingsFromKeyVault value. + */ + public CloudServiceVaultAndSecretReference protectedSettingsFromKeyVault() { + return this.protectedSettingsFromKeyVault; + } + + /** + * Set the protectedSettingsFromKeyVault property: Protected settings for the extension, referenced using KeyVault + * which are encrypted before sent to the role instance. + * + * @param protectedSettingsFromKeyVault the protectedSettingsFromKeyVault value to set. + * @return the CloudServiceExtensionProperties object itself. + */ + public CloudServiceExtensionProperties withProtectedSettingsFromKeyVault( + CloudServiceVaultAndSecretReference protectedSettingsFromKeyVault) { + this.protectedSettingsFromKeyVault = protectedSettingsFromKeyVault; + return this; + } + + /** + * Get the forceUpdateTag property: Tag to force apply the provided public and protected settings. Changing the tag + * value allows for re-running the extension without changing any of the public or protected settings. If + * forceUpdateTag is not changed, updates to public or protected settings would still be applied by the handler. If + * neither forceUpdateTag nor any of public or protected settings change, extension would flow to the role instance + * with the same sequence-number, and it is up to handler implementation whether to re-run it or not. + * + * @return the forceUpdateTag value. + */ + public String forceUpdateTag() { + return this.forceUpdateTag; + } + + /** + * Set the forceUpdateTag property: Tag to force apply the provided public and protected settings. Changing the tag + * value allows for re-running the extension without changing any of the public or protected settings. If + * forceUpdateTag is not changed, updates to public or protected settings would still be applied by the handler. If + * neither forceUpdateTag nor any of public or protected settings change, extension would flow to the role instance + * with the same sequence-number, and it is up to handler implementation whether to re-run it or not. + * + * @param forceUpdateTag the forceUpdateTag value to set. + * @return the CloudServiceExtensionProperties object itself. + */ + public CloudServiceExtensionProperties withForceUpdateTag(String forceUpdateTag) { + this.forceUpdateTag = forceUpdateTag; + return this; + } + + /** + * Get the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the rolesAppliedTo property: Optional list of roles to apply this extension. If property is not specified or + * '*' is specified, extension is applied to all roles in the cloud service. + * + * @return the rolesAppliedTo value. + */ + public List rolesAppliedTo() { + return this.rolesAppliedTo; + } + + /** + * Set the rolesAppliedTo property: Optional list of roles to apply this extension. If property is not specified or + * '*' is specified, extension is applied to all roles in the cloud service. + * + * @param rolesAppliedTo the rolesAppliedTo value to set. + * @return the CloudServiceExtensionProperties object itself. + */ + public CloudServiceExtensionProperties withRolesAppliedTo(List rolesAppliedTo) { + this.rolesAppliedTo = rolesAppliedTo; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (protectedSettingsFromKeyVault() != null) { + protectedSettingsFromKeyVault().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceInstanceView.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceInstanceView.java new file mode 100644 index 0000000000000..0eb16bb0a7b33 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceInstanceView.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.resourcemanager.compute.generated.fluent.models.CloudServiceInstanceViewInner; +import java.util.List; + +/** An immutable client-side representation of CloudServiceInstanceView. */ +public interface CloudServiceInstanceView { + /** + * Gets the roleInstance property: Instance view statuses. + * + * @return the roleInstance value. + */ + InstanceViewStatusesSummary roleInstance(); + + /** + * Gets the sdkVersion property: The version of the SDK that was used to generate the package for the cloud service. + * + * @return the sdkVersion value. + */ + String sdkVersion(); + + /** + * Gets the privateIds property: Specifies a list of unique identifiers generated internally for the cloud service. + * <br /><br /> NOTE: If you are using Azure Diagnostics extension, this property can be used as + * 'DeploymentId' for querying details. + * + * @return the privateIds value. + */ + List privateIds(); + + /** + * Gets the statuses property: The statuses property. + * + * @return the statuses value. + */ + List statuses(); + + /** + * Gets the inner com.azure.resourcemanager.compute.generated.fluent.models.CloudServiceInstanceViewInner object. + * + * @return the inner object. + */ + CloudServiceInstanceViewInner innerModel(); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceListResult.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceListResult.java new file mode 100644 index 0000000000000..a8c635591e792 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceListResult.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.azure.resourcemanager.compute.generated.fluent.models.CloudServiceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list operation result. */ +@Fluent +public final class CloudServiceListResult { + /* + * The list of resources. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The URI to fetch the next page of resources. Use this to get the next page of resources. Do this till nextLink + * is null to fetch all the resources. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of CloudServiceListResult class. */ + public CloudServiceListResult() { + } + + /** + * Get the value property: The list of resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of resources. + * + * @param value the value value to set. + * @return the CloudServiceListResult object itself. + */ + public CloudServiceListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URI to fetch the next page of resources. Use this to get the next page of + * resources. Do this till nextLink is null to fetch all the resources. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URI to fetch the next page of resources. Use this to get the next page of + * resources. Do this till nextLink is null to fetch all the resources. + * + * @param nextLink the nextLink value to set. + * @return the CloudServiceListResult object itself. + */ + public CloudServiceListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model CloudServiceListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CloudServiceListResult.class); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceNetworkProfile.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceNetworkProfile.java new file mode 100644 index 0000000000000..43d1797718b49 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceNetworkProfile.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Network Profile for the cloud service. */ +@Fluent +public final class CloudServiceNetworkProfile { + /* + * List of Load balancer configurations. Cloud service can have up to two load balancer configurations, + * corresponding to a Public Load Balancer and an Internal Load Balancer. + */ + @JsonProperty(value = "loadBalancerConfigurations") + private List loadBalancerConfigurations; + + /* + * Slot type for the cloud service. + * Possible values are

**Production**

**Staging**

+ * If not specified, the default value is Production. + */ + @JsonProperty(value = "slotType") + private CloudServiceSlotType slotType; + + /* + * The id reference of the cloud service containing the target IP with which the subject cloud service can perform + * a swap. This property cannot be updated once it is set. The swappable cloud service referred by this id must be + * present otherwise an error will be thrown. + */ + @JsonProperty(value = "swappableCloudService") + private SubResource swappableCloudService; + + /** Creates an instance of CloudServiceNetworkProfile class. */ + public CloudServiceNetworkProfile() { + } + + /** + * Get the loadBalancerConfigurations property: List of Load balancer configurations. Cloud service can have up to + * two load balancer configurations, corresponding to a Public Load Balancer and an Internal Load Balancer. + * + * @return the loadBalancerConfigurations value. + */ + public List loadBalancerConfigurations() { + return this.loadBalancerConfigurations; + } + + /** + * Set the loadBalancerConfigurations property: List of Load balancer configurations. Cloud service can have up to + * two load balancer configurations, corresponding to a Public Load Balancer and an Internal Load Balancer. + * + * @param loadBalancerConfigurations the loadBalancerConfigurations value to set. + * @return the CloudServiceNetworkProfile object itself. + */ + public CloudServiceNetworkProfile withLoadBalancerConfigurations( + List loadBalancerConfigurations) { + this.loadBalancerConfigurations = loadBalancerConfigurations; + return this; + } + + /** + * Get the slotType property: Slot type for the cloud service. Possible values are <br /><br + * />**Production**<br /><br />**Staging**<br /><br /> If not specified, the default + * value is Production. + * + * @return the slotType value. + */ + public CloudServiceSlotType slotType() { + return this.slotType; + } + + /** + * Set the slotType property: Slot type for the cloud service. Possible values are <br /><br + * />**Production**<br /><br />**Staging**<br /><br /> If not specified, the default + * value is Production. + * + * @param slotType the slotType value to set. + * @return the CloudServiceNetworkProfile object itself. + */ + public CloudServiceNetworkProfile withSlotType(CloudServiceSlotType slotType) { + this.slotType = slotType; + return this; + } + + /** + * Get the swappableCloudService property: The id reference of the cloud service containing the target IP with which + * the subject cloud service can perform a swap. This property cannot be updated once it is set. The swappable cloud + * service referred by this id must be present otherwise an error will be thrown. + * + * @return the swappableCloudService value. + */ + public SubResource swappableCloudService() { + return this.swappableCloudService; + } + + /** + * Set the swappableCloudService property: The id reference of the cloud service containing the target IP with which + * the subject cloud service can perform a swap. This property cannot be updated once it is set. The swappable cloud + * service referred by this id must be present otherwise an error will be thrown. + * + * @param swappableCloudService the swappableCloudService value to set. + * @return the CloudServiceNetworkProfile object itself. + */ + public CloudServiceNetworkProfile withSwappableCloudService(SubResource swappableCloudService) { + this.swappableCloudService = swappableCloudService; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (loadBalancerConfigurations() != null) { + loadBalancerConfigurations().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceOperatingSystems.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceOperatingSystems.java new file mode 100644 index 0000000000000..2bbdec6776e44 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceOperatingSystems.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.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of CloudServiceOperatingSystems. */ +public interface CloudServiceOperatingSystems { + /** + * Gets properties of a guest operating system version that can be specified in the XML service configuration + * (.cscfg) for a cloud service. + * + * @param location Name of the location that the OS version pertains to. + * @param osVersionName Name of the OS version. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a guest operating system version that can be specified in the XML service configuration + * (.cscfg) for a cloud service along with {@link Response}. + */ + Response getOSVersionWithResponse(String location, String osVersionName, Context context); + + /** + * Gets properties of a guest operating system version that can be specified in the XML service configuration + * (.cscfg) for a cloud service. + * + * @param location Name of the location that the OS version pertains to. + * @param osVersionName Name of the OS version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a guest operating system version that can be specified in the XML service configuration + * (.cscfg) for a cloud service. + */ + OSVersion getOSVersion(String location, String osVersionName); + + /** + * Gets a list of all guest operating system versions available to be specified in the XML service configuration + * (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS versions. Do this + * till nextLink is null to fetch all the OS versions. + * + * @param location Name of the location that the OS versions pertain to. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all guest operating system versions available to be specified in the XML service configuration + * (.cscfg) for a cloud service as paginated response with {@link PagedIterable}. + */ + PagedIterable listOSVersions(String location); + + /** + * Gets a list of all guest operating system versions available to be specified in the XML service configuration + * (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS versions. Do this + * till nextLink is null to fetch all the OS versions. + * + * @param location Name of the location that the OS versions pertain to. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all guest operating system versions available to be specified in the XML service configuration + * (.cscfg) for a cloud service as paginated response with {@link PagedIterable}. + */ + PagedIterable listOSVersions(String location, Context context); + + /** + * Gets properties of a guest operating system family that can be specified in the XML service configuration + * (.cscfg) for a cloud service. + * + * @param location Name of the location that the OS family pertains to. + * @param osFamilyName Name of the OS family. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a guest operating system family that can be specified in the XML service configuration + * (.cscfg) for a cloud service along with {@link Response}. + */ + Response getOSFamilyWithResponse(String location, String osFamilyName, Context context); + + /** + * Gets properties of a guest operating system family that can be specified in the XML service configuration + * (.cscfg) for a cloud service. + * + * @param location Name of the location that the OS family pertains to. + * @param osFamilyName Name of the OS family. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a guest operating system family that can be specified in the XML service configuration + * (.cscfg) for a cloud service. + */ + OSFamily getOSFamily(String location, String osFamilyName); + + /** + * Gets a list of all guest operating system families available to be specified in the XML service configuration + * (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS Families. Do this + * till nextLink is null to fetch all the OS Families. + * + * @param location Name of the location that the OS families pertain to. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all guest operating system families available to be specified in the XML service configuration + * (.cscfg) for a cloud service as paginated response with {@link PagedIterable}. + */ + PagedIterable listOSFamilies(String location); + + /** + * Gets a list of all guest operating system families available to be specified in the XML service configuration + * (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS Families. Do this + * till nextLink is null to fetch all the OS Families. + * + * @param location Name of the location that the OS families pertain to. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all guest operating system families available to be specified in the XML service configuration + * (.cscfg) for a cloud service as paginated response with {@link PagedIterable}. + */ + PagedIterable listOSFamilies(String location, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceOsProfile.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceOsProfile.java new file mode 100644 index 0000000000000..3c504be2a57d6 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceOsProfile.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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes the OS profile for the cloud service. */ +@Fluent +public final class CloudServiceOsProfile { + /* + * Specifies set of certificates that should be installed onto the role instances. + */ + @JsonProperty(value = "secrets") + private List secrets; + + /** Creates an instance of CloudServiceOsProfile class. */ + public CloudServiceOsProfile() { + } + + /** + * Get the secrets property: Specifies set of certificates that should be installed onto the role instances. + * + * @return the secrets value. + */ + public List secrets() { + return this.secrets; + } + + /** + * Set the secrets property: Specifies set of certificates that should be installed onto the role instances. + * + * @param secrets the secrets value to set. + * @return the CloudServiceOsProfile object itself. + */ + public CloudServiceOsProfile withSecrets(List secrets) { + this.secrets = secrets; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (secrets() != null) { + secrets().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceProperties.java new file mode 100644 index 0000000000000..2b991db356ed0 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceProperties.java @@ -0,0 +1,368 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Cloud service properties. */ +@Fluent +public final class CloudServiceProperties { + /* + * Specifies a URL that refers to the location of the service package in the Blob service. The service package URL + * can be Shared Access Signature (SAS) URI from any storage account. + * This is a write-only property and is not returned in GET calls. + */ + @JsonProperty(value = "packageUrl") + private String packageUrl; + + /* + * Specifies the XML service configuration (.cscfg) for the cloud service. + */ + @JsonProperty(value = "configuration") + private String configuration; + + /* + * Specifies a URL that refers to the location of the service configuration in the Blob service. The service + * package URL can be Shared Access Signature (SAS) URI from any storage account. + * This is a write-only property and is not returned in GET calls. + */ + @JsonProperty(value = "configurationUrl") + private String configurationUrl; + + /* + * (Optional) Indicates whether to start the cloud service immediately after it is created. The default value is + * `true`. + * If false, the service model is still deployed, but the code is not run immediately. Instead, the service is + * PoweredOff until you call Start, at which time the service will be started. A deployed service still incurs + * charges, even if it is poweredoff. + */ + @JsonProperty(value = "startCloudService") + private Boolean startCloudService; + + /* + * (Optional) Indicates whether the role sku properties (roleProfile.roles.sku) specified in the model/template + * should override the role instance count and vm size specified in the .cscfg and .csdef respectively. + * The default value is `false`. + */ + @JsonProperty(value = "allowModelOverride") + private Boolean allowModelOverride; + + /* + * Update mode for the cloud service. Role instances are allocated to update domains when the service is deployed. + * Updates can be initiated manually in each update domain or initiated automatically in all update domains. + * Possible Values are

**Auto**

**Manual**

**Simultaneous**

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

**Standard**

**Basic** + */ + @JsonProperty(value = "tier") + private String tier; + + /* + * Specifies the number of role instances in the cloud service. + */ + @JsonProperty(value = "capacity") + private Long capacity; + + /** Creates an instance of CloudServiceRoleSku class. */ + public CloudServiceRoleSku() { + } + + /** + * Get the name property: The sku name. NOTE: If the new SKU is not supported on the hardware the cloud service is + * currently on, you need to delete and recreate the cloud service or move back to the old sku. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The sku name. NOTE: If the new SKU is not supported on the hardware the cloud service is + * currently on, you need to delete and recreate the cloud service or move back to the old sku. + * + * @param name the name value to set. + * @return the CloudServiceRoleSku object itself. + */ + public CloudServiceRoleSku withName(String name) { + this.name = name; + return this; + } + + /** + * Get the tier property: Specifies the tier of the cloud service. Possible Values are <br /><br /> + * **Standard** <br /><br /> **Basic**. + * + * @return the tier value. + */ + public String tier() { + return this.tier; + } + + /** + * Set the tier property: Specifies the tier of the cloud service. Possible Values are <br /><br /> + * **Standard** <br /><br /> **Basic**. + * + * @param tier the tier value to set. + * @return the CloudServiceRoleSku object itself. + */ + public CloudServiceRoleSku withTier(String tier) { + this.tier = tier; + return this; + } + + /** + * Get the capacity property: Specifies the number of role instances in the cloud service. + * + * @return the capacity value. + */ + public Long capacity() { + return this.capacity; + } + + /** + * Set the capacity property: Specifies the number of role instances in the cloud service. + * + * @param capacity the capacity value to set. + * @return the CloudServiceRoleSku object itself. + */ + public CloudServiceRoleSku withCapacity(Long capacity) { + this.capacity = capacity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceRoles.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceRoles.java new file mode 100644 index 0000000000000..2439e7cdc3b0c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceRoles.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of CloudServiceRoles. */ +public interface CloudServiceRoles { + /** + * Gets a role from a cloud service. + * + * @param roleName Name of the role. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a role from a cloud service along with {@link Response}. + */ + Response getWithResponse( + String roleName, String resourceGroupName, String cloudServiceName, Context context); + + /** + * Gets a role from a cloud service. + * + * @param roleName Name of the role. + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a role from a cloud service. + */ + CloudServiceRole get(String roleName, String resourceGroupName, String cloudServiceName); + + /** + * Gets a list of all roles in a cloud service. Use nextLink property in the response to get the next page of roles. + * Do this till nextLink is null to fetch all the roles. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all roles in a cloud service as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String cloudServiceName); + + /** + * Gets a list of all roles in a cloud service. Use nextLink property in the response to get the next page of roles. + * Do this till nextLink is null to fetch all the roles. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all roles in a cloud service as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String cloudServiceName, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceSlotType.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceSlotType.java new file mode 100644 index 0000000000000..f593a3307f105 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceSlotType.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Slot type for the cloud service. Possible values are <br /><br />**Production**<br /><br + * />**Staging**<br /><br /> If not specified, the default value is Production. + */ +public final class CloudServiceSlotType extends ExpandableStringEnum { + /** Static value Production for CloudServiceSlotType. */ + public static final CloudServiceSlotType PRODUCTION = fromString("Production"); + + /** Static value Staging for CloudServiceSlotType. */ + public static final CloudServiceSlotType STAGING = fromString("Staging"); + + /** + * Creates a new instance of CloudServiceSlotType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CloudServiceSlotType() { + } + + /** + * Creates or finds a CloudServiceSlotType from its string representation. + * + * @param name a name to look for. + * @return the corresponding CloudServiceSlotType. + */ + @JsonCreator + public static CloudServiceSlotType fromString(String name) { + return fromString(name, CloudServiceSlotType.class); + } + + /** + * Gets known CloudServiceSlotType values. + * + * @return known CloudServiceSlotType values. + */ + public static Collection values() { + return values(CloudServiceSlotType.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceUpdate.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceUpdate.java new file mode 100644 index 0000000000000..723e9fd29f222 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceUpdate.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.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The CloudServiceUpdate model. */ +@Fluent +public final class CloudServiceUpdate { + /* + * Resource tags + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** Creates an instance of CloudServiceUpdate class. */ + public CloudServiceUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the CloudServiceUpdate object itself. + */ + public CloudServiceUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceUpgradeMode.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceUpgradeMode.java new file mode 100644 index 0000000000000..f506261eabd4c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceUpgradeMode.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Update mode for the cloud service. Role instances are allocated to update domains when the service is deployed. + * Updates can be initiated manually in each update domain or initiated automatically in all update domains. Possible + * Values are <br /><br />**Auto**<br /><br />**Manual** <br /><br + * />**Simultaneous**<br /><br /> If not specified, the default value is Auto. If set to Manual, PUT + * UpdateDomain must be called to apply the update. If set to Auto, the update is automatically applied to each update + * domain in sequence. + */ +public final class CloudServiceUpgradeMode extends ExpandableStringEnum { + /** Static value Auto for CloudServiceUpgradeMode. */ + public static final CloudServiceUpgradeMode AUTO = fromString("Auto"); + + /** Static value Manual for CloudServiceUpgradeMode. */ + public static final CloudServiceUpgradeMode MANUAL = fromString("Manual"); + + /** Static value Simultaneous for CloudServiceUpgradeMode. */ + public static final CloudServiceUpgradeMode SIMULTANEOUS = fromString("Simultaneous"); + + /** + * Creates a new instance of CloudServiceUpgradeMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CloudServiceUpgradeMode() { + } + + /** + * Creates or finds a CloudServiceUpgradeMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding CloudServiceUpgradeMode. + */ + @JsonCreator + public static CloudServiceUpgradeMode fromString(String name) { + return fromString(name, CloudServiceUpgradeMode.class); + } + + /** + * Gets known CloudServiceUpgradeMode values. + * + * @return known CloudServiceUpgradeMode values. + */ + public static Collection values() { + return values(CloudServiceUpgradeMode.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceVaultAndSecretReference.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceVaultAndSecretReference.java new file mode 100644 index 0000000000000..5bd1ea9180aff --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceVaultAndSecretReference.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.management.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Protected settings for the extension, referenced using KeyVault which are encrypted before sent to the role instance. + */ +@Fluent +public final class CloudServiceVaultAndSecretReference { + /* + * The ARM Resource ID of the Key Vault + */ + @JsonProperty(value = "sourceVault") + private SubResource sourceVault; + + /* + * Secret URL which contains the protected settings of the extension + */ + @JsonProperty(value = "secretUrl") + private String secretUrl; + + /** Creates an instance of CloudServiceVaultAndSecretReference class. */ + public CloudServiceVaultAndSecretReference() { + } + + /** + * Get the sourceVault property: The ARM Resource ID of the Key Vault. + * + * @return the sourceVault value. + */ + public SubResource sourceVault() { + return this.sourceVault; + } + + /** + * Set the sourceVault property: The ARM Resource ID of the Key Vault. + * + * @param sourceVault the sourceVault value to set. + * @return the CloudServiceVaultAndSecretReference object itself. + */ + public CloudServiceVaultAndSecretReference withSourceVault(SubResource sourceVault) { + this.sourceVault = sourceVault; + return this; + } + + /** + * Get the secretUrl property: Secret URL which contains the protected settings of the extension. + * + * @return the secretUrl value. + */ + public String secretUrl() { + return this.secretUrl; + } + + /** + * Set the secretUrl property: Secret URL which contains the protected settings of the extension. + * + * @param secretUrl the secretUrl value to set. + * @return the CloudServiceVaultAndSecretReference object itself. + */ + public CloudServiceVaultAndSecretReference withSecretUrl(String secretUrl) { + this.secretUrl = secretUrl; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceVaultCertificate.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceVaultCertificate.java new file mode 100644 index 0000000000000..3c229bc81e0be --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceVaultCertificate.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.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a single certificate reference in a Key Vault, and where the certificate should reside on the role + * instance. + */ +@Fluent +public final class CloudServiceVaultCertificate { + /* + * This is the URL of a certificate that has been uploaded to Key Vault as a secret. + */ + @JsonProperty(value = "certificateUrl") + private String certificateUrl; + + /** Creates an instance of CloudServiceVaultCertificate class. */ + public CloudServiceVaultCertificate() { + } + + /** + * Get the certificateUrl property: This is the URL of a certificate that has been uploaded to Key Vault as a + * secret. + * + * @return the certificateUrl value. + */ + public String certificateUrl() { + return this.certificateUrl; + } + + /** + * Set the certificateUrl property: This is the URL of a certificate that has been uploaded to Key Vault as a + * secret. + * + * @param certificateUrl the certificateUrl value to set. + * @return the CloudServiceVaultCertificate object itself. + */ + public CloudServiceVaultCertificate withCertificateUrl(String certificateUrl) { + this.certificateUrl = certificateUrl; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceVaultSecretGroup.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceVaultSecretGroup.java new file mode 100644 index 0000000000000..651a1ca9839f0 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceVaultSecretGroup.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.management.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a set of certificates which are all in the same Key Vault. */ +@Fluent +public final class CloudServiceVaultSecretGroup { + /* + * 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; + + /** Creates an instance of CloudServiceVaultSecretGroup class. */ + public CloudServiceVaultSecretGroup() { + } + + /** + * Get the sourceVault property: The relative URL of the Key Vault containing all of the certificates in + * VaultCertificates. + * + * @return the sourceVault value. + */ + public SubResource sourceVault() { + return this.sourceVault; + } + + /** + * Set the sourceVault property: The relative URL of the Key Vault containing all of the certificates in + * VaultCertificates. + * + * @param sourceVault the sourceVault value to set. + * @return the CloudServiceVaultSecretGroup object itself. + */ + public CloudServiceVaultSecretGroup withSourceVault(SubResource sourceVault) { + this.sourceVault = sourceVault; + return this; + } + + /** + * Get the vaultCertificates property: The list of key vault references in SourceVault which contain certificates. + * + * @return the vaultCertificates value. + */ + public List vaultCertificates() { + return this.vaultCertificates; + } + + /** + * Set the vaultCertificates property: The list of key vault references in SourceVault which contain certificates. + * + * @param vaultCertificates the vaultCertificates value to set. + * @return the CloudServiceVaultSecretGroup object itself. + */ + public CloudServiceVaultSecretGroup withVaultCertificates(List vaultCertificates) { + this.vaultCertificates = vaultCertificates; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (vaultCertificates() != null) { + vaultCertificates().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServices.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServices.java new file mode 100644 index 0000000000000..c77d4c04cde33 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServices.java @@ -0,0 +1,364 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of CloudServices. */ +public interface CloudServices { + /** + * Deletes a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String cloudServiceName); + + /** + * Deletes a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String cloudServiceName, Context context); + + /** + * Display information about a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String cloudServiceName, Context context); + + /** + * Display information about a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service. + */ + CloudService getByResourceGroup(String resourceGroupName, String cloudServiceName); + + /** + * Gets the status of a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a cloud service along with {@link Response}. + */ + Response getInstanceViewWithResponse( + String resourceGroupName, String cloudServiceName, Context context); + + /** + * Gets the status of a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a cloud service. + */ + CloudServiceInstanceView getInstanceView(String resourceGroupName, String cloudServiceName); + + /** + * Gets a list of all cloud services in the subscription, regardless of the associated resource group. Use nextLink + * property in the response to get the next page of Cloud Services. Do this till nextLink is null to fetch all the + * Cloud Services. + * + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all cloud services in the subscription, regardless of the associated resource group as + * paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Gets a list of all cloud services in the subscription, regardless of the associated resource group. Use nextLink + * property in the response to get the next page of Cloud Services. Do this till nextLink is null to fetch all the + * Cloud Services. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all cloud services in the subscription, regardless of the associated resource group as + * paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Gets a list of all cloud services under a resource group. Use nextLink property in the response to get the next + * page of Cloud Services. Do this till nextLink is null to fetch all the Cloud Services. + * + * @param resourceGroupName Name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all cloud services under a resource group as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets a list of all cloud services under a resource group. Use nextLink property in the response to get the next + * page of Cloud Services. Do this till nextLink is null to fetch all the Cloud Services. + * + * @param resourceGroupName Name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all cloud services under a resource group as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Starts the cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(String resourceGroupName, String cloudServiceName); + + /** + * Starts the cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(String resourceGroupName, String cloudServiceName, Context context); + + /** + * Power off the cloud service. Note that resources are still attached and you are getting charged for the + * resources. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void powerOff(String resourceGroupName, String cloudServiceName); + + /** + * Power off the cloud service. Note that resources are still attached and you are getting charged for the + * resources. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void powerOff(String resourceGroupName, String cloudServiceName, Context context); + + /** + * Restarts one or more role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void restart(String resourceGroupName, String cloudServiceName); + + /** + * Restarts one or more role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void restart(String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context); + + /** + * Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void reimage(String resourceGroupName, String cloudServiceName); + + /** + * Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void reimage(String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context); + + /** + * Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes + * the storage resources that are used by them. If you do not want to initialize storage resources, you can use + * Reimage Role Instances. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void rebuild(String resourceGroupName, String cloudServiceName); + + /** + * Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes + * the storage resources that are used by them. If you do not want to initialize storage resources, you can use + * Reimage Role Instances. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void rebuild(String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context); + + /** + * Deletes role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteInstances(String resourceGroupName, String cloudServiceName); + + /** + * Deletes role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteInstances(String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context); + + /** + * Display information about a cloud service. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service along with {@link Response}. + */ + CloudService getById(String id); + + /** + * Display information about a cloud service. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a cloud service. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a cloud service. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new CloudService resource. + * + * @param name resource name. + * @return the first stage of the new CloudService definition. + */ + CloudService.DefinitionStages.Blank define(String name); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServicesUpdateDomains.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServicesUpdateDomains.java new file mode 100644 index 0000000000000..0b38e6c5456c4 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServicesUpdateDomains.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.UpdateDomainInner; + +/** Resource collection API of CloudServicesUpdateDomains. */ +public interface CloudServicesUpdateDomains { + /** + * Updates the role instances in the specified update domain. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param updateDomain Specifies an integer value that identifies the update domain. Update domains are identified + * with a zero-based index: the first update domain has an ID of 0, the second has an ID of 1, and so on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void walkUpdateDomain(String resourceGroupName, String cloudServiceName, int updateDomain); + + /** + * Updates the role instances in the specified update domain. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param updateDomain Specifies an integer value that identifies the update domain. Update domains are identified + * with a zero-based index: the first update domain has an ID of 0, the second has an ID of 1, and so on. + * @param parameters The update domain object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void walkUpdateDomain( + String resourceGroupName, + String cloudServiceName, + int updateDomain, + UpdateDomainInner parameters, + Context context); + + /** + * Gets the specified update domain of a cloud service. Use nextLink property in the response to get the next page + * of update domains. Do this till nextLink is null to fetch all the update domains. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param updateDomain Specifies an integer value that identifies the update domain. Update domains are identified + * with a zero-based index: the first update domain has an ID of 0, the second has an ID of 1, and so on. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified update domain of a cloud service along with {@link Response}. + */ + Response getUpdateDomainWithResponse( + String resourceGroupName, String cloudServiceName, int updateDomain, Context context); + + /** + * Gets the specified update domain of a cloud service. Use nextLink property in the response to get the next page + * of update domains. Do this till nextLink is null to fetch all the update domains. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param updateDomain Specifies an integer value that identifies the update domain. Update domains are identified + * with a zero-based index: the first update domain has an ID of 0, the second has an ID of 1, and so on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified update domain of a cloud service. + */ + UpdateDomain getUpdateDomain(String resourceGroupName, String cloudServiceName, int updateDomain); + + /** + * Gets a list of all update domains in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all update domains in a cloud service as paginated response with {@link PagedIterable}. + */ + PagedIterable listUpdateDomains(String resourceGroupName, String cloudServiceName); + + /** + * Gets a list of all update domains in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all update domains in a cloud service as paginated response with {@link PagedIterable}. + */ + PagedIterable listUpdateDomains(String resourceGroupName, String cloudServiceName, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CommunityGalleries.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CommunityGalleries.java new file mode 100644 index 0000000000000..2ca22ec870a46 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CommunityGalleries.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.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of CommunityGalleries. */ +public interface CommunityGalleries { + /** + * Get a community gallery by gallery public name. + * + * @param location Resource location. + * @param publicGalleryName The public name of the community 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 community gallery by gallery public name along with {@link Response}. + */ + Response getWithResponse(String location, String publicGalleryName, Context context); + + /** + * Get a community gallery by gallery public name. + * + * @param location Resource location. + * @param publicGalleryName The public name of the community 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 community gallery by gallery public name. + */ + CommunityGallery get(String location, String publicGalleryName); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CommunityGallery.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CommunityGallery.java new file mode 100644 index 0000000000000..be72d49959b99 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CommunityGallery.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.CommunityGalleryInner; + +/** An immutable client-side representation of CommunityGallery. */ +public interface CommunityGallery { + /** + * 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 type property: Resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the uniqueId property: The unique id of this community gallery. + * + * @return the uniqueId value. + */ + String uniqueId(); + + /** + * Gets the inner com.azure.resourcemanager.compute.generated.fluent.models.CommunityGalleryInner object. + * + * @return the inner object. + */ + CommunityGalleryInner innerModel(); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CommunityGalleryImage.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CommunityGalleryImage.java new file mode 100644 index 0000000000000..a40b415e7554d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CommunityGalleryImage.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.resourcemanager.compute.generated.fluent.models.CommunityGalleryImageInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** An immutable client-side representation of CommunityGalleryImage. */ +public interface CommunityGalleryImage { + /** + * 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 type property: Resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the uniqueId property: The unique id of this community 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 architecture property: The architecture of the image. Applicable to OS disks only. + * + * @return the architecture value. + */ + Architecture architecture(); + + /** + * Gets the privacyStatementUri property: Privacy statement uri for the current community gallery image. + * + * @return the privacyStatementUri value. + */ + String privacyStatementUri(); + + /** + * Gets the eula property: End-user license agreement for the current community gallery image. + * + * @return the eula value. + */ + String eula(); + + /** + * Gets the inner com.azure.resourcemanager.compute.generated.fluent.models.CommunityGalleryImageInner object. + * + * @return the inner object. + */ + CommunityGalleryImageInner innerModel(); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CommunityGalleryImageList.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CommunityGalleryImageList.java new file mode 100644 index 0000000000000..793c74809b9c1 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CommunityGalleryImageList.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.azure.resourcemanager.compute.generated.fluent.models.CommunityGalleryImageInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List Community Gallery Images operation response. */ +@Fluent +public final class CommunityGalleryImageList { + /* + * A list of community gallery images. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The uri to fetch the next page of community gallery images. Call ListNext() with this to fetch the next page of + * community gallery images. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of CommunityGalleryImageList class. */ + public CommunityGalleryImageList() { + } + + /** + * Get the value property: A list of community gallery images. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of community gallery images. + * + * @param value the value value to set. + * @return the CommunityGalleryImageList object itself. + */ + public CommunityGalleryImageList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The uri to fetch the next page of community gallery images. Call ListNext() with this + * to fetch the next page of community gallery images. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The uri to fetch the next page of community gallery images. Call ListNext() with this + * to fetch the next page of community gallery images. + * + * @param nextLink the nextLink value to set. + * @return the CommunityGalleryImageList object itself. + */ + public CommunityGalleryImageList 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 CommunityGalleryImageList")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CommunityGalleryImageList.class); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CommunityGalleryImageVersion.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CommunityGalleryImageVersion.java new file mode 100644 index 0000000000000..b8c2810c4b17d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CommunityGalleryImageVersion.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.models; + +import com.azure.resourcemanager.compute.generated.fluent.models.CommunityGalleryImageVersionInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of CommunityGalleryImageVersion. */ +public interface CommunityGalleryImageVersion { + /** + * 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 type property: Resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the uniqueId property: The unique id of this community 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 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. + */ + Boolean excludeFromLatest(); + + /** + * Gets the storageProfile property: Describes the storage profile of the image version. + * + * @return the storageProfile value. + */ + SharedGalleryImageVersionStorageProfile storageProfile(); + + /** + * Gets the inner com.azure.resourcemanager.compute.generated.fluent.models.CommunityGalleryImageVersionInner + * object. + * + * @return the inner object. + */ + CommunityGalleryImageVersionInner innerModel(); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CommunityGalleryImageVersionList.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CommunityGalleryImageVersionList.java new file mode 100644 index 0000000000000..d016018c36e10 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CommunityGalleryImageVersionList.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.azure.resourcemanager.compute.generated.fluent.models.CommunityGalleryImageVersionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List Community Gallery Image versions operation response. */ +@Fluent +public final class CommunityGalleryImageVersionList { + /* + * A list of community gallery image versions. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The uri to fetch the next page of community gallery image versions. Call ListNext() with this to fetch the next + * page of community gallery image versions. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of CommunityGalleryImageVersionList class. */ + public CommunityGalleryImageVersionList() { + } + + /** + * Get the value property: A list of community gallery image versions. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of community gallery image versions. + * + * @param value the value value to set. + * @return the CommunityGalleryImageVersionList object itself. + */ + public CommunityGalleryImageVersionList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The uri to fetch the next page of community gallery image versions. Call ListNext() + * with this to fetch the next page of community 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 community gallery image versions. Call ListNext() + * with this to fetch the next page of community gallery image versions. + * + * @param nextLink the nextLink value to set. + * @return the CommunityGalleryImageVersionList object itself. + */ + public CommunityGalleryImageVersionList 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 CommunityGalleryImageVersionList")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CommunityGalleryImageVersionList.class); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CommunityGalleryImageVersions.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CommunityGalleryImageVersions.java new file mode 100644 index 0000000000000..b23f57bdd8fed --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CommunityGalleryImageVersions.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.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of CommunityGalleryImageVersions. */ +public interface CommunityGalleryImageVersions { + /** + * Get a community gallery image version. + * + * @param location Resource location. + * @param publicGalleryName The public name of the community gallery. + * @param galleryImageName The name of the community gallery image definition. + * @param galleryImageVersionName The name of the community gallery image version. 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 community gallery image version along with {@link Response}. + */ + Response getWithResponse( + String location, + String publicGalleryName, + String galleryImageName, + String galleryImageVersionName, + Context context); + + /** + * Get a community gallery image version. + * + * @param location Resource location. + * @param publicGalleryName The public name of the community gallery. + * @param galleryImageName The name of the community gallery image definition. + * @param galleryImageVersionName The name of the community gallery image version. 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 community gallery image version. + */ + CommunityGalleryImageVersion get( + String location, String publicGalleryName, String galleryImageName, String galleryImageVersionName); + + /** + * List community gallery image versions inside an image. + * + * @param location Resource location. + * @param publicGalleryName The public name of the community gallery. + * @param galleryImageName The name of the community gallery image definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Community Gallery Image versions operation response as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list( + String location, String publicGalleryName, String galleryImageName); + + /** + * List community gallery image versions inside an image. + * + * @param location Resource location. + * @param publicGalleryName The public name of the community gallery. + * @param galleryImageName The name of the community gallery image definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Community Gallery Image versions operation response as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list( + String location, String publicGalleryName, String galleryImageName, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CommunityGalleryImages.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CommunityGalleryImages.java new file mode 100644 index 0000000000000..7f9b5a255caa7 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CommunityGalleryImages.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.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of CommunityGalleryImages. */ +public interface CommunityGalleryImages { + /** + * Get a community gallery image. + * + * @param location Resource location. + * @param publicGalleryName The public name of the community gallery. + * @param galleryImageName The name of the community gallery image definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a community gallery image along with {@link Response}. + */ + Response getWithResponse( + String location, String publicGalleryName, String galleryImageName, Context context); + + /** + * Get a community gallery image. + * + * @param location Resource location. + * @param publicGalleryName The public name of the community gallery. + * @param galleryImageName The name of the community gallery image definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a community gallery image. + */ + CommunityGalleryImage get(String location, String publicGalleryName, String galleryImageName); + + /** + * List community gallery images inside a gallery. + * + * @param location Resource location. + * @param publicGalleryName The public name of the community 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 Community Gallery Images operation response as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String location, String publicGalleryName); + + /** + * List community gallery images inside a gallery. + * + * @param location Resource location. + * @param publicGalleryName The public name of the community 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 the List Community Gallery Images operation response as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String location, String publicGalleryName, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CommunityGalleryInfo.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CommunityGalleryInfo.java new file mode 100644 index 0000000000000..b2aa6f3e8f1f7 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CommunityGalleryInfo.java @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Information of community gallery if current gallery is shared to community. */ +@Fluent +public final class CommunityGalleryInfo { + /* + * The link to the publisher website. Visible to all users. + */ + @JsonProperty(value = "publisherUri") + private String publisherUri; + + /* + * Community gallery publisher support email. The email address of the publisher. Visible to all users. + */ + @JsonProperty(value = "publisherContact") + private String publisherContact; + + /* + * End-user license agreement for community gallery image. + */ + @JsonProperty(value = "eula") + private String eula; + + /* + * The prefix of the gallery name that will be displayed publicly. Visible to all users. + */ + @JsonProperty(value = "publicNamePrefix") + private String publicNamePrefix; + + /* + * Contains info about whether community gallery sharing is enabled. + */ + @JsonProperty(value = "communityGalleryEnabled", access = JsonProperty.Access.WRITE_ONLY) + private Boolean communityGalleryEnabled; + + /* + * Community gallery public name list. + */ + @JsonProperty(value = "publicNames", access = JsonProperty.Access.WRITE_ONLY) + private List publicNames; + + /** Creates an instance of CommunityGalleryInfo class. */ + public CommunityGalleryInfo() { + } + + /** + * Get the publisherUri property: The link to the publisher website. Visible to all users. + * + * @return the publisherUri value. + */ + public String publisherUri() { + return this.publisherUri; + } + + /** + * Set the publisherUri property: The link to the publisher website. Visible to all users. + * + * @param publisherUri the publisherUri value to set. + * @return the CommunityGalleryInfo object itself. + */ + public CommunityGalleryInfo withPublisherUri(String publisherUri) { + this.publisherUri = publisherUri; + return this; + } + + /** + * Get the publisherContact property: Community gallery publisher support email. The email address of the publisher. + * Visible to all users. + * + * @return the publisherContact value. + */ + public String publisherContact() { + return this.publisherContact; + } + + /** + * Set the publisherContact property: Community gallery publisher support email. The email address of the publisher. + * Visible to all users. + * + * @param publisherContact the publisherContact value to set. + * @return the CommunityGalleryInfo object itself. + */ + public CommunityGalleryInfo withPublisherContact(String publisherContact) { + this.publisherContact = publisherContact; + return this; + } + + /** + * Get the eula property: End-user license agreement for community gallery image. + * + * @return the eula value. + */ + public String eula() { + return this.eula; + } + + /** + * Set the eula property: End-user license agreement for community gallery image. + * + * @param eula the eula value to set. + * @return the CommunityGalleryInfo object itself. + */ + public CommunityGalleryInfo withEula(String eula) { + this.eula = eula; + return this; + } + + /** + * Get the publicNamePrefix property: The prefix of the gallery name that will be displayed publicly. Visible to all + * users. + * + * @return the publicNamePrefix value. + */ + public String publicNamePrefix() { + return this.publicNamePrefix; + } + + /** + * Set the publicNamePrefix property: The prefix of the gallery name that will be displayed publicly. Visible to all + * users. + * + * @param publicNamePrefix the publicNamePrefix value to set. + * @return the CommunityGalleryInfo object itself. + */ + public CommunityGalleryInfo withPublicNamePrefix(String publicNamePrefix) { + this.publicNamePrefix = publicNamePrefix; + return this; + } + + /** + * Get the communityGalleryEnabled property: Contains info about whether community gallery sharing is enabled. + * + * @return the communityGalleryEnabled value. + */ + public Boolean communityGalleryEnabled() { + return this.communityGalleryEnabled; + } + + /** + * Get the publicNames property: Community gallery public name list. + * + * @return the publicNames value. + */ + public List publicNames() { + return this.publicNames; + } + + /** + * 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/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..8435a8afbb930 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ComponentNames.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** The component name. Currently, the only allowable value is Microsoft-Windows-Shell-Setup. */ +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) { + if (value == null) { + return null; + } + ComponentNames[] items = ComponentNames.values(); + for (ComponentNames item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @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..cfa8c032d6128 --- /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.resourcemanager.compute.generated.fluent.models.ComputeOperationValueInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List Compute Operation operation response. */ +@Immutable +public final class ComputeOperationListResult { + /* + * The list of compute operations + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** Creates an instance of ComputeOperationListResult class. */ + public ComputeOperationListResult() { + } + + /** + * 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/ConfidentialVMEncryptionType.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ConfidentialVMEncryptionType.java new file mode 100644 index 0000000000000..980428b9ee0d3 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ConfidentialVMEncryptionType.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** confidential VM encryption types. */ +public final class ConfidentialVMEncryptionType extends ExpandableStringEnum { + /** Static value EncryptedVMGuestStateOnlyWithPmk for ConfidentialVMEncryptionType. */ + public static final ConfidentialVMEncryptionType ENCRYPTED_VMGUEST_STATE_ONLY_WITH_PMK = + fromString("EncryptedVMGuestStateOnlyWithPmk"); + + /** Static value EncryptedWithPmk for ConfidentialVMEncryptionType. */ + public static final ConfidentialVMEncryptionType ENCRYPTED_WITH_PMK = fromString("EncryptedWithPmk"); + + /** Static value EncryptedWithCmk for ConfidentialVMEncryptionType. */ + public static final ConfidentialVMEncryptionType ENCRYPTED_WITH_CMK = fromString("EncryptedWithCmk"); + + /** + * Creates a new instance of ConfidentialVMEncryptionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ConfidentialVMEncryptionType() { + } + + /** + * Creates or finds a ConfidentialVMEncryptionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConfidentialVMEncryptionType. + */ + @JsonCreator + public static ConfidentialVMEncryptionType fromString(String name) { + return fromString(name, ConfidentialVMEncryptionType.class); + } + + /** + * Gets known ConfidentialVMEncryptionType values. + * + * @return known ConfidentialVMEncryptionType values. + */ + public static Collection values() { + return values(ConfidentialVMEncryptionType.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ConsistencyModeTypes.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ConsistencyModeTypes.java new file mode 100644 index 0000000000000..9d7589bb8d4f8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ConsistencyModeTypes.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * ConsistencyMode of the RestorePoint. Can be specified in the input while creating a restore point. For now, only + * CrashConsistent is accepted as a valid input. Please refer to https://aka.ms/RestorePoints for more details. + */ +public final class ConsistencyModeTypes extends ExpandableStringEnum { + /** Static value CrashConsistent for ConsistencyModeTypes. */ + public static final ConsistencyModeTypes CRASH_CONSISTENT = fromString("CrashConsistent"); + + /** Static value FileSystemConsistent for ConsistencyModeTypes. */ + public static final ConsistencyModeTypes FILE_SYSTEM_CONSISTENT = fromString("FileSystemConsistent"); + + /** Static value ApplicationConsistent for ConsistencyModeTypes. */ + public static final ConsistencyModeTypes APPLICATION_CONSISTENT = fromString("ApplicationConsistent"); + + /** + * Creates a new instance of ConsistencyModeTypes value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ConsistencyModeTypes() { + } + + /** + * Creates or finds a ConsistencyModeTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConsistencyModeTypes. + */ + @JsonCreator + public static ConsistencyModeTypes fromString(String name) { + return fromString(name, ConsistencyModeTypes.class); + } + + /** + * Gets known ConsistencyModeTypes values. + * + * @return known ConsistencyModeTypes values. + */ + public static Collection values() { + return values(ConsistencyModeTypes.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CopyCompletionError.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CopyCompletionError.java new file mode 100644 index 0000000000000..c17dba3e01fde --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CopyCompletionError.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.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Indicates the error details if the background copy of a resource created via the CopyStart operation fails. */ +@Fluent +public final class CopyCompletionError { + /* + * Indicates the error code if the background copy of a resource created via the CopyStart operation fails. + */ + @JsonProperty(value = "errorCode", required = true) + private CopyCompletionErrorReason errorCode; + + /* + * Indicates the error message if the background copy of a resource created via the CopyStart operation fails. + */ + @JsonProperty(value = "errorMessage", required = true) + private String errorMessage; + + /** Creates an instance of CopyCompletionError class. */ + public CopyCompletionError() { + } + + /** + * Get the errorCode property: Indicates the error code if the background copy of a resource created via the + * CopyStart operation fails. + * + * @return the errorCode value. + */ + public CopyCompletionErrorReason errorCode() { + return this.errorCode; + } + + /** + * Set the errorCode property: Indicates the error code if the background copy of a resource created via the + * CopyStart operation fails. + * + * @param errorCode the errorCode value to set. + * @return the CopyCompletionError object itself. + */ + public CopyCompletionError withErrorCode(CopyCompletionErrorReason errorCode) { + this.errorCode = errorCode; + return this; + } + + /** + * Get the errorMessage property: Indicates the error message if the background copy of a resource created via the + * CopyStart operation fails. + * + * @return the errorMessage value. + */ + public String errorMessage() { + return this.errorMessage; + } + + /** + * Set the errorMessage property: Indicates the error message if the background copy of a resource created via the + * CopyStart operation fails. + * + * @param errorMessage the errorMessage value to set. + * @return the CopyCompletionError object itself. + */ + public CopyCompletionError withErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (errorCode() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property errorCode in model CopyCompletionError")); + } + if (errorMessage() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property errorMessage in model CopyCompletionError")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CopyCompletionError.class); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CopyCompletionErrorReason.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CopyCompletionErrorReason.java new file mode 100644 index 0000000000000..bff6e999fb6a8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CopyCompletionErrorReason.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Indicates the error code if the background copy of a resource created via the CopyStart operation fails. */ +public final class CopyCompletionErrorReason extends ExpandableStringEnum { + /** Static value CopySourceNotFound for CopyCompletionErrorReason. */ + public static final CopyCompletionErrorReason COPY_SOURCE_NOT_FOUND = fromString("CopySourceNotFound"); + + /** + * Creates a new instance of CopyCompletionErrorReason value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CopyCompletionErrorReason() { + } + + /** + * Creates or finds a CopyCompletionErrorReason from its string representation. + * + * @param name a name to look for. + * @return the corresponding CopyCompletionErrorReason. + */ + @JsonCreator + public static CopyCompletionErrorReason fromString(String name) { + return fromString(name, CopyCompletionErrorReason.class); + } + + /** + * Gets known CopyCompletionErrorReason values. + * + * @return known CopyCompletionErrorReason values. + */ + public static Collection values() { + return values(CopyCompletionErrorReason.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CreationData.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CreationData.java new file mode 100644 index 0000000000000..01c5569f43def --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CreationData.java @@ -0,0 +1,339 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Data used when creating a disk. */ +@Fluent +public final class CreationData { + /* + * 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 for PIR or user images. + */ + @JsonProperty(value = "imageReference") + private ImageDiskReference imageReference; + + /* + * Required if creating from a Gallery Image. The id/sharedGalleryImageId/communityGalleryImageId 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; + + /* + * If createOption is ImportSecure, this is the URI of a blob to be imported into VM guest state. + */ + @JsonProperty(value = "securityDataUri") + private String securityDataUri; + + /* + * Set this flag to true to get a boost on the performance target of the disk deployed, see here on the respective + * performance target. This flag can only be set on disk creation time and cannot be disabled after enabled. + */ + @JsonProperty(value = "performancePlus") + private Boolean performancePlus; + + /** Creates an instance of CreationData class. */ + public CreationData() { + } + + /** + * 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 for PIR or user images. + * + * @return the imageReference value. + */ + public ImageDiskReference imageReference() { + return this.imageReference; + } + + /** + * Set the imageReference property: Disk source information for PIR or user images. + * + * @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/sharedGalleryImageId/communityGalleryImageId 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/sharedGalleryImageId/communityGalleryImageId 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; + } + + /** + * Get the securityDataUri property: If createOption is ImportSecure, this is the URI of a blob to be imported into + * VM guest state. + * + * @return the securityDataUri value. + */ + public String securityDataUri() { + return this.securityDataUri; + } + + /** + * Set the securityDataUri property: If createOption is ImportSecure, this is the URI of a blob to be imported into + * VM guest state. + * + * @param securityDataUri the securityDataUri value to set. + * @return the CreationData object itself. + */ + public CreationData withSecurityDataUri(String securityDataUri) { + this.securityDataUri = securityDataUri; + return this; + } + + /** + * Get the performancePlus property: Set this flag to true to get a boost on the performance target of the disk + * deployed, see here on the respective performance target. This flag can only be set on disk creation time and + * cannot be disabled after enabled. + * + * @return the performancePlus value. + */ + public Boolean performancePlus() { + return this.performancePlus; + } + + /** + * Set the performancePlus property: Set this flag to true to get a boost on the performance target of the disk + * deployed, see here on the respective performance target. This flag can only be set on disk creation time and + * cannot be disabled after enabled. + * + * @param performancePlus the performancePlus value to set. + * @return the CreationData object itself. + */ + public CreationData withPerformancePlus(Boolean performancePlus) { + this.performancePlus = performancePlus; + 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(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CreationData.class); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DataAccessAuthMode.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DataAccessAuthMode.java new file mode 100644 index 0000000000000..e7035fde09a77 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DataAccessAuthMode.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; + +/** Additional authentication requirements when exporting or uploading to a disk or snapshot. */ +public final class DataAccessAuthMode extends ExpandableStringEnum { + /** Static value AzureActiveDirectory for DataAccessAuthMode. */ + public static final DataAccessAuthMode AZURE_ACTIVE_DIRECTORY = fromString("AzureActiveDirectory"); + + /** Static value None for DataAccessAuthMode. */ + public static final DataAccessAuthMode NONE = fromString("None"); + + /** + * Creates a new instance of DataAccessAuthMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DataAccessAuthMode() { + } + + /** + * Creates or finds a DataAccessAuthMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding DataAccessAuthMode. + */ + @JsonCreator + public static DataAccessAuthMode fromString(String name) { + return fromString(name, DataAccessAuthMode.class); + } + + /** + * Gets known DataAccessAuthMode values. + * + * @return known DataAccessAuthMode values. + */ + public static Collection values() { + return values(DataAccessAuthMode.class); + } +} 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..2fffbd5c418bf --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DataDisk.java @@ -0,0 +1,448 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a data disk. */ +@Fluent +public final class DataDisk { + /* + * 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.** The defaulting + * behavior is: **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.** This value is used when + * you are using a specialized disk to create the virtual machine. **FromImage.** This value is used when you are + * using an image to create the virtual machine. If you are using a platform image, you should also use the + * imageReference element described above. If you are using a marketplace image, you should 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. The property 'diskSizeGB' is the number of bytes x 1024^3 for the disk and the + * value cannot be larger than 1023. + */ + @JsonProperty(value = "diskSizeGB") + private Integer diskSizeGB; + + /* + * The managed disk parameters. + */ + @JsonProperty(value = "managedDisk") + private ManagedDiskParameters managedDisk; + + /* + * Specifies whether the data disk is in process of detachment from the VirtualMachine/VirtualMachineScaleset + */ + @JsonProperty(value = "toBeDetached") + private Boolean toBeDetached; + + /* + * Specifies the Read-Write IOPS for the managed disk when StorageAccountType is UltraSSD_LRS. Returned only for + * VirtualMachine ScaleSet VM disks. Can be updated only via updates to the VirtualMachine Scale Set. + */ + @JsonProperty(value = "diskIOPSReadWrite", access = JsonProperty.Access.WRITE_ONLY) + private Long diskIopsReadWrite; + + /* + * Specifies the bandwidth in MB per second for the managed disk when StorageAccountType is UltraSSD_LRS. Returned + * only for VirtualMachine ScaleSet VM disks. Can be updated only via updates to the VirtualMachine Scale Set. + */ + @JsonProperty(value = "diskMBpsReadWrite", access = JsonProperty.Access.WRITE_ONLY) + private Long diskMBpsReadWrite; + + /* + * Specifies the detach behavior to be used while detaching a disk or which is already in the process of detachment + * from the virtual machine. Supported values: **ForceDetach.** detachOption: **ForceDetach** is applicable only + * for managed data disks. If a previous detachment attempt of the data disk did not complete due to an unexpected + * failure from the virtual machine and the disk is still not released then use force-detach as a last resort + * option to detach the disk forcibly from the VM. All writes might not have been flushed when using this detach + * behavior. **This feature is still in preview** mode and is not supported for VirtualMachineScaleSet. To + * force-detach a data disk update toBeDetached to 'true' along with setting detachOption: 'ForceDetach'. + */ + @JsonProperty(value = "detachOption") + private DiskDetachOptionTypes detachOption; + + /* + * Specifies whether data disk should be deleted or detached upon VM deletion. Possible values are: **Delete.** If + * this value is used, the data disk is deleted when VM is deleted. **Detach.** If this value is used, the data + * disk is retained after VM is deleted. The default value is set to **Detach**. + */ + @JsonProperty(value = "deleteOption") + private DiskDeleteOptionTypes deleteOption; + + /** Creates an instance of DataDisk class. */ + public DataDisk() { + } + + /** + * 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. Possible values are: **None,** **ReadOnly,** + * **ReadWrite.** The defaulting behavior is: **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. Possible values are: **None,** **ReadOnly,** + * **ReadWrite.** The defaulting behavior is: **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. Possible values are: + * **Attach.** This value is used when you are using a specialized disk to create the virtual machine. + * **FromImage.** This value is used when you are using an image to create the virtual machine. If you are using a + * platform image, you should also use the imageReference element described above. If you are using a marketplace + * image, you should 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. Possible values are: + * **Attach.** This value is used when you are using a specialized disk to create the virtual machine. + * **FromImage.** This value is used when you are using an image to create the virtual machine. If you are using a + * platform image, you should also use the imageReference element described above. If you are using a marketplace + * image, you should 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. The property 'diskSizeGB' is the number of bytes x + * 1024^3 for the disk and the value cannot be larger than 1023. + * + * @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. The property 'diskSizeGB' is the number of bytes x + * 1024^3 for the disk and the value cannot be larger than 1023. + * + * @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.** 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'. + * + * @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.** 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'. + * + * @param detachOption the detachOption value to set. + * @return the DataDisk object itself. + */ + public DataDisk withDetachOption(DiskDetachOptionTypes detachOption) { + this.detachOption = detachOption; + return this; + } + + /** + * Get the deleteOption property: Specifies whether data disk should be deleted or detached upon VM deletion. + * Possible values are: **Delete.** If this value is used, the data disk is deleted when VM is deleted. **Detach.** + * If this value is used, the data disk is retained after VM is deleted. The default value is set to **Detach**. + * + * @return the deleteOption value. + */ + public DiskDeleteOptionTypes deleteOption() { + return this.deleteOption; + } + + /** + * Set the deleteOption property: Specifies whether data disk should be deleted or detached upon VM deletion. + * Possible values are: **Delete.** If this value is used, the data disk is deleted when VM is deleted. **Detach.** + * If this value is used, the data disk is retained after VM is deleted. The default value is set to **Detach**. + * + * @param deleteOption the deleteOption value to set. + * @return the DataDisk object itself. + */ + public DataDisk withDeleteOption(DiskDeleteOptionTypes deleteOption) { + this.deleteOption = deleteOption; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (vhd() != null) { + vhd().validate(); + } + if (image() != null) { + image().validate(); + } + if (createOption() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property createOption in model DataDisk")); + } + if (managedDisk() != null) { + managedDisk().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DataDisk.class); +} 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..aaad23c61ac1d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DataDiskImage.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.fasterxml.jackson.annotation.JsonProperty; + +/** Contains the data disk images information. */ +@Immutable +public final class DataDiskImage { + /* + * 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; + + /** Creates an instance of DataDiskImage class. */ + public DataDiskImage() { + } + + /** + * 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..1edfc0715412a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DataDiskImageEncryption.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.fasterxml.jackson.annotation.JsonProperty; + +/** Contains encryption settings for a data disk image. */ +@Fluent +public final class DataDiskImageEncryption extends DiskImageEncryption { + /* + * 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; + + /** Creates an instance of DataDiskImageEncryption class. */ + public DataDiskImageEncryption() { + } + + /** + * 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..b25067851d753 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHost.java @@ -0,0 +1,414 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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. 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. Possible values are: **None,** **Windows_Server_Hybrid,** **Windows_Server_Perpetual.** The + * default value is: **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 timeCreated property: Specifies the time at which the Dedicated Host resource was created. Minimum + * api-version: 2021-11-01. + * + * @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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * 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. Possible values are: **None,** **Windows_Server_Hybrid,** + * **Windows_Server_Perpetual.** The default value is: **None.**. + * + * @param licenseType 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.** The default value is: **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.WithSku, + 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 sku. */ + interface WithSku { + /** + * Specifies the sku property: [List all available dedicated host sizes for resizing] + * (https://docs.microsoft.com/rest/api/compute/dedicated-hosts/listavailablesizes). Resizing can be only + * used to scale up DedicatedHost. Only name is required to be set. . + * + * @param sku [List all available dedicated host sizes for resizing] + * (https://docs.microsoft.com/rest/api/compute/dedicated-hosts/listavailablesizes). Resizing can be + * only used to scale up DedicatedHost. Only name is required to be set. + * @return the next definition stage. + */ + Update withSku(Sku sku); + } + /** 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. Possible values are: **None,** **Windows_Server_Hybrid,** + * **Windows_Server_Perpetual.** The default value is: **None.**. + * + * @param licenseType 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.** The default value is: **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); + + /** + * Restart the dedicated host. The operation will complete successfully once the dedicated host has restarted and is + * running. To determine the health of VMs deployed on the dedicated host after the restart check the Resource + * Health Center in the Azure Portal. Please refer to + * https://docs.microsoft.com/azure/service-health/resource-health-overview for more details. + * + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void restart(); + + /** + * Restart the dedicated host. The operation will complete successfully once the dedicated host has restarted and is + * running. To determine the health of VMs deployed on the dedicated host after the restart check the Resource + * Health Center in the Azure Portal. Please refer to + * https://docs.microsoft.com/azure/service-health/resource-health-overview for more details. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void restart(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..17527ce24a733 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHostAllocatableVM.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.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Represents the dedicated host unutilized capacity in terms of a specific VM size. */ +@Fluent +public final class DedicatedHostAllocatableVM { + /* + * 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; + + /** Creates an instance of DedicatedHostAllocatableVM class. */ + public DedicatedHostAllocatableVM() { + } + + /** + * 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..af3ab2f75af3c --- /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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Dedicated host unutilized capacity. */ +@Fluent +public final class DedicatedHostAvailableCapacity { + /* + * 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; + + /** Creates an instance of DedicatedHostAvailableCapacity class. */ + public DedicatedHostAvailableCapacity() { + } + + /** + * 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..cf390781ffab9 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHostGroup.java @@ -0,0 +1,365 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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. + */ + int 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. Minimum api-version: 2020-06-01. + * + * @return the supportAutomaticPlacement value. + */ + Boolean supportAutomaticPlacement(); + + /** + * Gets the additionalCapabilities property: Enables or disables a capability on the dedicated host group. Minimum + * api-version: 2022-03-01. + * + * @return the additionalCapabilities value. + */ + DedicatedHostGroupPropertiesAdditionalCapabilities additionalCapabilities(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.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, + DefinitionStages.WithAdditionalCapabilities { + /** + * 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(int 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. 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. Minimum api-version: 2020-06-01. + * @return the next definition stage. + */ + WithCreate withSupportAutomaticPlacement(Boolean supportAutomaticPlacement); + } + /** The stage of the DedicatedHostGroup definition allowing to specify additionalCapabilities. */ + interface WithAdditionalCapabilities { + /** + * Specifies the additionalCapabilities property: Enables or disables a capability on the dedicated host + * group. Minimum api-version: 2022-03-01.. + * + * @param additionalCapabilities Enables or disables a capability on the dedicated host group. Minimum + * api-version: 2022-03-01. + * @return the next definition stage. + */ + WithCreate withAdditionalCapabilities( + DedicatedHostGroupPropertiesAdditionalCapabilities additionalCapabilities); + } + } + /** + * 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, + UpdateStages.WithAdditionalCapabilities { + /** + * 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(int 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. 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. Minimum api-version: 2020-06-01. + * @return the next definition stage. + */ + Update withSupportAutomaticPlacement(Boolean supportAutomaticPlacement); + } + /** The stage of the DedicatedHostGroup update allowing to specify additionalCapabilities. */ + interface WithAdditionalCapabilities { + /** + * Specifies the additionalCapabilities property: Enables or disables a capability on the dedicated host + * group. Minimum api-version: 2022-03-01.. + * + * @param additionalCapabilities Enables or disables a capability on the dedicated host group. Minimum + * api-version: 2022-03-01. + * @return the next definition stage. + */ + Update withAdditionalCapabilities( + DedicatedHostGroupPropertiesAdditionalCapabilities additionalCapabilities); + } + } + /** + * 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..9ff0897bcff5b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHostGroupInstanceView.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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The DedicatedHostGroupInstanceView model. */ +@Fluent +public final class DedicatedHostGroupInstanceView { + /* + * List of instance view of the dedicated hosts under the dedicated host group. + */ + @JsonProperty(value = "hosts") + private List hosts; + + /** Creates an instance of DedicatedHostGroupInstanceView class. */ + public DedicatedHostGroupInstanceView() { + } + + /** + * 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..02b25ff4e7ab7 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHostGroupListResult.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.azure.resourcemanager.compute.generated.fluent.models.DedicatedHostGroupInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List Dedicated Host Group with resource group response. */ +@Fluent +public final class DedicatedHostGroupListResult { + /* + * 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; + + /** Creates an instance of DedicatedHostGroupListResult class. */ + public DedicatedHostGroupListResult() { + } + + /** + * 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()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DedicatedHostGroupListResult.class); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHostGroupPropertiesAdditionalCapabilities.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHostGroupPropertiesAdditionalCapabilities.java new file mode 100644 index 0000000000000..97390c0698768 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHostGroupPropertiesAdditionalCapabilities.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.fasterxml.jackson.annotation.JsonProperty; + +/** Enables or disables a capability on the dedicated host group. Minimum api-version: 2022-03-01. */ +@Fluent +public final class DedicatedHostGroupPropertiesAdditionalCapabilities { + /* + * The flag that enables or disables a capability to have UltraSSD Enabled Virtual Machines on Dedicated Hosts of + * the Dedicated Host Group. For the Virtual Machines to be UltraSSD Enabled, UltraSSDEnabled flag for the resource + * needs to be set true as well. The value is defaulted to 'false' when not provided. Please refer to + * https://docs.microsoft.com/en-us/azure/virtual-machines/disks-enable-ultra-ssd for more details on Ultra SSD + * feature. **Note:** The ultraSSDEnabled setting can only be enabled for Host Groups that are created as zonal. + * Minimum api-version: 2022-03-01. + */ + @JsonProperty(value = "ultraSSDEnabled") + private Boolean ultraSsdEnabled; + + /** Creates an instance of DedicatedHostGroupPropertiesAdditionalCapabilities class. */ + public DedicatedHostGroupPropertiesAdditionalCapabilities() { + } + + /** + * Get the ultraSsdEnabled property: The flag that enables or disables a capability to have UltraSSD Enabled Virtual + * Machines on Dedicated Hosts of the Dedicated Host Group. For the Virtual Machines to be UltraSSD Enabled, + * UltraSSDEnabled flag for the resource needs to be set true as well. The value is defaulted to 'false' when not + * provided. Please refer to https://docs.microsoft.com/en-us/azure/virtual-machines/disks-enable-ultra-ssd for more + * details on Ultra SSD feature. **Note:** The ultraSSDEnabled setting can only be enabled for Host Groups that are + * created as zonal. Minimum api-version: 2022-03-01. + * + * @return the ultraSsdEnabled value. + */ + public Boolean ultraSsdEnabled() { + return this.ultraSsdEnabled; + } + + /** + * Set the ultraSsdEnabled property: The flag that enables or disables a capability to have UltraSSD Enabled Virtual + * Machines on Dedicated Hosts of the Dedicated Host Group. For the Virtual Machines to be UltraSSD Enabled, + * UltraSSDEnabled flag for the resource needs to be set true as well. The value is defaulted to 'false' when not + * provided. Please refer to https://docs.microsoft.com/en-us/azure/virtual-machines/disks-enable-ultra-ssd for more + * details on Ultra SSD feature. **Note:** The ultraSSDEnabled setting can only be enabled for Host Groups that are + * created as zonal. Minimum api-version: 2022-03-01. + * + * @param ultraSsdEnabled the ultraSsdEnabled value to set. + * @return the DedicatedHostGroupPropertiesAdditionalCapabilities object itself. + */ + public DedicatedHostGroupPropertiesAdditionalCapabilities 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/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..2637e39370175 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHostGroupUpdate.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.annotation.Fluent; +import com.azure.resourcemanager.compute.generated.fluent.models.DedicatedHostGroupProperties; +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. + */ +@Fluent +public final class DedicatedHostGroupUpdate extends UpdateResource { + /* + * Dedicated Host Group Properties. + */ + @JsonProperty(value = "properties") + private DedicatedHostGroupProperties innerProperties; + + /* + * 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; + + /** Creates an instance of DedicatedHostGroupUpdate class. */ + public DedicatedHostGroupUpdate() { + } + + /** + * Get the innerProperties property: Dedicated Host Group Properties. + * + * @return the innerProperties value. + */ + private DedicatedHostGroupProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** {@inheritDoc} */ + @Override + public DedicatedHostGroupUpdate withTags(Map tags) { + super.withTags(tags); + 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new DedicatedHostGroupProperties(); + } + this.innerProperties().withPlatformFaultDomainCount(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.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().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. Minimum api-version: 2020-06-01. + * + * @return the supportAutomaticPlacement value. + */ + public Boolean supportAutomaticPlacement() { + return this.innerProperties() == null ? null : this.innerProperties().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. Minimum api-version: 2020-06-01. + * + * @param supportAutomaticPlacement the supportAutomaticPlacement value to set. + * @return the DedicatedHostGroupUpdate object itself. + */ + public DedicatedHostGroupUpdate withSupportAutomaticPlacement(Boolean supportAutomaticPlacement) { + if (this.innerProperties() == null) { + this.innerProperties = new DedicatedHostGroupProperties(); + } + this.innerProperties().withSupportAutomaticPlacement(supportAutomaticPlacement); + return this; + } + + /** + * Get the additionalCapabilities property: Enables or disables a capability on the dedicated host group. Minimum + * api-version: 2022-03-01. + * + * @return the additionalCapabilities value. + */ + public DedicatedHostGroupPropertiesAdditionalCapabilities additionalCapabilities() { + return this.innerProperties() == null ? null : this.innerProperties().additionalCapabilities(); + } + + /** + * Set the additionalCapabilities property: Enables or disables a capability on the dedicated host group. Minimum + * api-version: 2022-03-01. + * + * @param additionalCapabilities the additionalCapabilities value to set. + * @return the DedicatedHostGroupUpdate object itself. + */ + public DedicatedHostGroupUpdate withAdditionalCapabilities( + DedicatedHostGroupPropertiesAdditionalCapabilities additionalCapabilities) { + if (this.innerProperties() == null) { + this.innerProperties = new DedicatedHostGroupProperties(); + } + this.innerProperties().withAdditionalCapabilities(additionalCapabilities); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().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..69f202004237e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHostGroups.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 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByResourceGroupWithResponse(String resourceGroupName, String hostGroupName, 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.resourcemanager.compute.generated.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 hostGroupName); + + /** + * Retrieves information about a dedicated host group. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param expand The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance + * views of the dedicated hosts under the dedicated host group. 'UserData' is not supported for dedicated host + * group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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 along + * with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String hostGroupName, InstanceViewTypes expand, 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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); + + /** + * 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.resourcemanager.compute.generated.models.ApiErrorException thrown 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 as paginated response with {@link + * PagedIterable}. + */ + 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.resourcemanager.compute.generated.models.ApiErrorException thrown 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 as paginated response with {@link + * PagedIterable}. + */ + 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.resourcemanager.compute.generated.models.ApiErrorException thrown 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 as paginated response with {@link + * PagedIterable}. + */ + 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.resourcemanager.compute.generated.models.ApiErrorException thrown 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 as paginated response with {@link + * PagedIterable}. + */ + 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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 along + * with {@link Response}. + */ + DedicatedHostGroup getById(String id); + + /** + * Retrieves information about a dedicated host group. + * + * @param id the resource ID. + * @param expand The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance + * views of the dedicated hosts under the dedicated host group. 'UserData' is not supported for dedicated host + * group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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 along + * with {@link Response}. + */ + 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.resourcemanager.compute.generated.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 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response 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..cc049a4faf251 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHostInstanceView.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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The instance view of a dedicated host. */ +@Fluent +public class DedicatedHostInstanceView { + /* + * 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; + + /** Creates an instance of DedicatedHostInstanceView class. */ + public DedicatedHostInstanceView() { + } + + /** + * 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..76f23bb5e2566 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHostInstanceViewWithName.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * The instance view of a dedicated host that includes the name of the dedicated host. It is used for the response to + * the instance view of a dedicated host group. + */ +@Fluent +public final class DedicatedHostInstanceViewWithName extends DedicatedHostInstanceView { + /* + * The name of the dedicated host. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** Creates an instance of DedicatedHostInstanceViewWithName class. */ + public DedicatedHostInstanceViewWithName() { + } + + /** + * 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..76b78096d6a62 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHostLicenseTypes.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.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * 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.** The default value is: **None.**. + */ +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) { + if (value == null) { + return null; + } + DedicatedHostLicenseTypes[] items = DedicatedHostLicenseTypes.values(); + for (DedicatedHostLicenseTypes item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @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..481c5a4a34204 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHostListResult.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.azure.resourcemanager.compute.generated.fluent.models.DedicatedHostInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list dedicated host operation response. */ +@Fluent +public final class DedicatedHostListResult { + /* + * 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; + + /** Creates an instance of DedicatedHostListResult class. */ + public DedicatedHostListResult() { + } + + /** + * 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()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DedicatedHostListResult.class); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHostSizeListResult.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHostSizeListResult.java new file mode 100644 index 0000000000000..f07254b59b023 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHostSizeListResult.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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List Dedicated Host sizes operation response. */ +@Fluent +public final class DedicatedHostSizeListResult { + /* + * The list of dedicated host sizes. + */ + @JsonProperty(value = "value") + private List value; + + /** Creates an instance of DedicatedHostSizeListResult class. */ + public DedicatedHostSizeListResult() { + } + + /** + * Get the value property: The list of dedicated host sizes. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of dedicated host sizes. + * + * @param value the value value to set. + * @return the DedicatedHostSizeListResult object itself. + */ + public DedicatedHostSizeListResult withValue(List 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/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..26073e1b28894 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHostUpdate.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.resourcemanager.compute.generated.fluent.models.DedicatedHostProperties; +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. */ +@Fluent +public final class DedicatedHostUpdate extends UpdateResource { + /* + * Properties of the dedicated host. + */ + @JsonProperty(value = "properties") + private DedicatedHostProperties innerProperties; + + /* + * [List all available dedicated host sizes for resizing] + * (https://docs.microsoft.com/rest/api/compute/dedicated-hosts/listavailablesizes). Resizing can be only used to + * scale up DedicatedHost. Only name is required to be set. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** Creates an instance of DedicatedHostUpdate class. */ + public DedicatedHostUpdate() { + } + + /** + * Get the innerProperties property: Properties of the dedicated host. + * + * @return the innerProperties value. + */ + private DedicatedHostProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the sku property: [List all available dedicated host sizes for resizing] + * (https://docs.microsoft.com/rest/api/compute/dedicated-hosts/listavailablesizes). Resizing can be only used to + * scale up DedicatedHost. Only name is required to be set. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: [List all available dedicated host sizes for resizing] + * (https://docs.microsoft.com/rest/api/compute/dedicated-hosts/listavailablesizes). Resizing can be only used to + * scale up DedicatedHost. Only name is required to be set. + * + * @param sku the sku value to set. + * @return the DedicatedHostUpdate object itself. + */ + public DedicatedHostUpdate withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** {@inheritDoc} */ + @Override + public DedicatedHostUpdate withTags(Map tags) { + super.withTags(tags); + 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new DedicatedHostProperties(); + } + this.innerProperties().withPlatformFaultDomain(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new DedicatedHostProperties(); + } + this.innerProperties().withAutoReplaceOnFailure(autoReplaceOnFailure); + return this; + } + + /** + * Get the hostId property: A unique id generated and assigned to the dedicated host by the platform. Does not + * change throughout the lifetime of the host. + * + * @return the hostId value. + */ + public String hostId() { + return this.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().virtualMachines(); + } + + /** + * Get the licenseType property: 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.** The + * default value is: **None.**. + * + * @return the licenseType value. + */ + public DedicatedHostLicenseTypes licenseType() { + return this.innerProperties() == null ? null : this.innerProperties().licenseType(); + } + + /** + * Set the licenseType property: 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.** The + * default value is: **None.**. + * + * @param licenseType the licenseType value to set. + * @return the DedicatedHostUpdate object itself. + */ + public DedicatedHostUpdate withLicenseType(DedicatedHostLicenseTypes licenseType) { + if (this.innerProperties() == null) { + this.innerProperties = new DedicatedHostProperties(); + } + this.innerProperties().withLicenseType(licenseType); + return this; + } + + /** + * Get the provisioningTime property: The date when the host was first provisioned. + * + * @return the provisioningTime value. + */ + public OffsetDateTime provisioningTime() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningTime(); + } + + /** + * Get the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the instanceView property: The dedicated host instance view. + * + * @return the instanceView value. + */ + public DedicatedHostInstanceView instanceView() { + return this.innerProperties() == null ? null : this.innerProperties().instanceView(); + } + + /** + * Get the timeCreated property: Specifies the time at which the Dedicated Host resource was created. Minimum + * api-version: 2021-11-01. + * + * @return the timeCreated value. + */ + public OffsetDateTime timeCreated() { + return this.innerProperties() == null ? null : this.innerProperties().timeCreated(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + if (sku() != null) { + sku().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..61455f7e1ed08 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHosts.java @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.resourcemanager.compute.generated.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 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.resourcemanager.compute.generated.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 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. + * @param expand The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance + * views of the dedicated host. 'UserData' is not supported for dedicated host. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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 along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String hostGroupName, String hostname, InstanceViewTypes expand, 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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); + + /** + * 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.resourcemanager.compute.generated.models.ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + 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.resourcemanager.compute.generated.models.ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + PagedIterable listByHostGroup(String resourceGroupName, String hostGroupName, Context context); + + /** + * Restart the dedicated host. The operation will complete successfully once the dedicated host has restarted and is + * running. To determine the health of VMs deployed on the dedicated host after the restart check the Resource + * Health Center in the Azure Portal. Please refer to + * https://docs.microsoft.com/azure/service-health/resource-health-overview for more details. + * + * @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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void restart(String resourceGroupName, String hostGroupName, String hostname); + + /** + * Restart the dedicated host. The operation will complete successfully once the dedicated host has restarted and is + * running. To determine the health of VMs deployed on the dedicated host after the restart check the Resource + * Health Center in the Azure Portal. Please refer to + * https://docs.microsoft.com/azure/service-health/resource-health-overview for more details. + * + * @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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void restart(String resourceGroupName, String hostGroupName, String hostname, Context context); + + /** + * Lists all available dedicated host sizes to which the specified dedicated host can be resized. NOTE: The + * dedicated host sizes provided can be used to only scale up the existing 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.resourcemanager.compute.generated.models.ApiErrorException thrown 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 sizes operation response as paginated response with {@link PagedIterable}. + */ + PagedIterable listAvailableSizes(String resourceGroupName, String hostGroupName, String hostname); + + /** + * Lists all available dedicated host sizes to which the specified dedicated host can be resized. NOTE: The + * dedicated host sizes provided can be used to only scale up the existing 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.resourcemanager.compute.generated.models.ApiErrorException thrown 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 sizes operation response as paginated response with {@link PagedIterable}. + */ + PagedIterable listAvailableSizes( + String resourceGroupName, String hostGroupName, String hostname, Context context); + + /** + * Retrieves information about a dedicated host. + * + * @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 Dedicated host along with {@link Response}. + */ + DedicatedHost getById(String id); + + /** + * Retrieves information about a dedicated host. + * + * @param id the resource ID. + * @param expand The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance + * views of the dedicated host. 'UserData' is not supported for dedicated host. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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 along with {@link Response}. + */ + 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.resourcemanager.compute.generated.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 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.resourcemanager.compute.generated.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 DedicatedHost resource. + * + * @param name resource name. + * @return the first stage of the new DedicatedHost definition. + */ + DedicatedHost.DefinitionStages.Blank define(String name); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DeleteOptions.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DeleteOptions.java new file mode 100644 index 0000000000000..18ed49aabac76 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DeleteOptions.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; + +/** Specify what happens to the network interface when the VM is deleted. */ +public final class DeleteOptions extends ExpandableStringEnum { + /** Static value Delete for DeleteOptions. */ + public static final DeleteOptions DELETE = fromString("Delete"); + + /** Static value Detach for DeleteOptions. */ + public static final DeleteOptions DETACH = fromString("Detach"); + + /** + * Creates a new instance of DeleteOptions value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DeleteOptions() { + } + + /** + * Creates or finds a DeleteOptions from its string representation. + * + * @param name a name to look for. + * @return the corresponding DeleteOptions. + */ + @JsonCreator + public static DeleteOptions fromString(String name) { + return fromString(name, DeleteOptions.class); + } + + /** + * Gets known DeleteOptions values. + * + * @return known DeleteOptions values. + */ + public static Collection values() { + return values(DeleteOptions.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiagnosticsProfile.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiagnosticsProfile.java new file mode 100644 index 0000000000000..3146b3f8be05f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiagnosticsProfile.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.fasterxml.jackson.annotation.JsonProperty; + +/** Specifies the boot diagnostic settings state. Minimum api-version: 2015-06-15. */ +@Fluent +public final class DiagnosticsProfile { + /* + * Boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot to diagnose VM + * status. **NOTE**: If storageUri is being specified then ensure that the storage account is in the same region + * and subscription as the VM. 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; + + /** Creates an instance of DiagnosticsProfile class. */ + public DiagnosticsProfile() { + } + + /** + * Get the bootDiagnostics property: Boot Diagnostics is a debugging feature which allows you to view Console Output + * and Screenshot to diagnose VM status. **NOTE**: If storageUri is being specified then ensure that the storage + * account is in the same region and subscription as the VM. You can easily view the output of your console log. + * 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. **NOTE**: If storageUri is being specified then ensure that the storage + * account is in the same region and subscription as the VM. You can easily view the output of your console log. + * 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..9cf0be44f24e5 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiffDiskOptions.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Specifies the ephemeral disk option for operating system disk. */ +public final class DiffDiskOptions extends ExpandableStringEnum { + /** Static value Local for DiffDiskOptions. */ + public static final DiffDiskOptions LOCAL = fromString("Local"); + + /** + * Creates a new instance of DiffDiskOptions value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DiffDiskOptions() { + } + + /** + * 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); + } + + /** + * Gets known DiffDiskOptions values. + * + * @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..7c4aec2edbbff --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiffDiskPlacement.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Specifies the ephemeral disk placement for operating system disk. This property can be used by user in the request to + * choose the location i.e, cache disk or resource disk space for Ephemeral OS disk provisioning. For more information + * on Ephemeral OS disk size requirements, please refer Ephemeral OS disk size requirements for Windows VM at + * https://docs.microsoft.com/azure/virtual-machines/windows/ephemeral-os-disks#size-requirements and Linux VM at + * https://docs.microsoft.com/azure/virtual-machines/linux/ephemeral-os-disks#size-requirements. + */ +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 a new instance of DiffDiskPlacement value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DiffDiskPlacement() { + } + + /** + * 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); + } + + /** + * Gets known DiffDiskPlacement values. + * + * @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..436a5fc63e6a1 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiffDiskSettings.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.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the parameters of ephemeral disk settings that can be specified for operating system disk. **Note:** The + * ephemeral disk settings can only be specified for managed disk. + */ +@Fluent +public final class DiffDiskSettings { + /* + * 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.** The defaulting behavior is: **CacheDisk** if one is configured for the VM size otherwise + * **ResourceDisk** is used. Refer to the VM size documentation for Windows VM at + * https://docs.microsoft.com/azure/virtual-machines/windows/sizes and Linux VM at + * https://docs.microsoft.com/azure/virtual-machines/linux/sizes to check which VM sizes exposes a cache disk. + */ + @JsonProperty(value = "placement") + private DiffDiskPlacement placement; + + /** Creates an instance of DiffDiskSettings class. */ + public DiffDiskSettings() { + } + + /** + * 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. Possible values + * are: **CacheDisk,** **ResourceDisk.** The defaulting behavior is: **CacheDisk** if one is configured for the VM + * size otherwise **ResourceDisk** is used. Refer to the VM size documentation for Windows VM at + * https://docs.microsoft.com/azure/virtual-machines/windows/sizes and Linux VM at + * https://docs.microsoft.com/azure/virtual-machines/linux/sizes to check which VM sizes exposes a cache disk. + * + * @return the placement value. + */ + public DiffDiskPlacement placement() { + return this.placement; + } + + /** + * Set the placement property: Specifies the ephemeral disk placement for operating system disk. Possible values + * are: **CacheDisk,** **ResourceDisk.** The defaulting behavior is: **CacheDisk** if one is configured for the VM + * size otherwise **ResourceDisk** is used. Refer to the VM size documentation for Windows VM at + * https://docs.microsoft.com/azure/virtual-machines/windows/sizes and Linux VM at + * https://docs.microsoft.com/azure/virtual-machines/linux/sizes to check which VM sizes exposes a cache disk. + * + * @param placement the placement value to set. + * @return the DiffDiskSettings object itself. + */ + public DiffDiskSettings withPlacement(DiffDiskPlacement placement) { + this.placement = placement; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Disallowed.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Disallowed.java new file mode 100644 index 0000000000000..4257b440b3537 --- /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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes the disallowed disk types. */ +@Fluent +public final class Disallowed { + /* + * A list of disk types. + */ + @JsonProperty(value = "diskTypes") + private List diskTypes; + + /** Creates an instance of Disallowed class. */ + public Disallowed() { + } + + /** + * 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..03b6435251e70 --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** Specifies the disallowed configuration for a virtual machine image. */ +@Fluent +public final class DisallowedConfiguration { + /* + * VM disk types which are disallowed. + */ + @JsonProperty(value = "vmDiskType") + private VmDiskTypes vmDiskType; + + /** Creates an instance of DisallowedConfiguration class. */ + public DisallowedConfiguration() { + } + + /** + * 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..122a2d890b110 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Disk.java @@ -0,0 +1,1113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.DiskInner; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of Disk. */ +public interface Disk { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the managedBy property: A relative URI containing the ID of the VM that has the disk attached. + * + * @return the managedBy value. + */ + String managedBy(); + + /** + * Gets the managedByExtended property: List of relative URIs containing the IDs of the VMs that have the disk + * attached. maxShares should be set to a value greater than one for disks to allow attaching them to multiple VMs. + * + * @return the managedByExtended value. + */ + List managedByExtended(); + + /** + * Gets the sku property: The disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, UltraSSD_LRS, + * Premium_ZRS, StandardSSD_ZRS, or PremiumV2_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 supportedCapabilities property: List of supported capabilities for the image from which the OS disk was + * created. + * + * @return the supportedCapabilities value. + */ + SupportedCapabilities supportedCapabilities(); + + /** + * 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 burstingEnabledTime property: Latest time when bursting was last enabled on a disk. + * + * @return the burstingEnabledTime value. + */ + OffsetDateTime burstingEnabledTime(); + + /** + * Gets the tier property: Performance tier of the disk (e.g, P4, S10) as described here: + * https://azure.microsoft.com/en-us/pricing/details/managed-disks/. Does not apply to Ultra disks. + * + * @return the tier value. + */ + String tier(); + + /** + * Gets the burstingEnabled property: Set to true to enable bursting beyond the provisioned performance target of + * the disk. Bursting is disabled by default. Does not apply to Ultra disks. + * + * @return the burstingEnabled value. + */ + Boolean burstingEnabled(); + + /** + * Gets the propertyUpdatesInProgress property: Properties of the disk for which update is pending. + * + * @return the propertyUpdatesInProgress value. + */ + PropertyUpdatesInProgress propertyUpdatesInProgress(); + + /** + * Gets the supportsHibernation property: Indicates the OS on a disk supports hibernation. + * + * @return the supportsHibernation value. + */ + Boolean supportsHibernation(); + + /** + * Gets the securityProfile property: Contains the security related information for the resource. + * + * @return the securityProfile value. + */ + DiskSecurityProfile securityProfile(); + + /** + * Gets the completionPercent property: Percentage complete for the background copy when a resource is created via + * the CopyStart operation. + * + * @return the completionPercent value. + */ + Float completionPercent(); + + /** + * Gets the publicNetworkAccess property: Policy for controlling export on the disk. + * + * @return the publicNetworkAccess value. + */ + PublicNetworkAccess publicNetworkAccess(); + + /** + * Gets the dataAccessAuthMode property: Additional authentication requirements when exporting or uploading to a + * disk or snapshot. + * + * @return the dataAccessAuthMode value. + */ + DataAccessAuthMode dataAccessAuthMode(); + + /** + * Gets the optimizedForFrequentAttach property: Setting this property to true improves reliability and performance + * of data disks that are frequently (more than 5 times a day) by detached from one virtual machine and attached to + * another. This property should not be set for disks that are not detached and attached frequently as it causes the + * disks to not align with the fault domain of the virtual machine. + * + * @return the optimizedForFrequentAttach value. + */ + Boolean optimizedForFrequentAttach(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.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.WithSupportedCapabilities, + DefinitionStages.WithCreationData, + DefinitionStages.WithDiskSizeGB, + DefinitionStages.WithEncryptionSettingsCollection, + DefinitionStages.WithDiskIopsReadWrite, + DefinitionStages.WithDiskMBpsReadWrite, + DefinitionStages.WithDiskIopsReadOnly, + DefinitionStages.WithDiskMBpsReadOnly, + DefinitionStages.WithEncryption, + DefinitionStages.WithMaxShares, + DefinitionStages.WithNetworkAccessPolicy, + DefinitionStages.WithDiskAccessId, + DefinitionStages.WithTier, + DefinitionStages.WithBurstingEnabled, + DefinitionStages.WithSupportsHibernation, + DefinitionStages.WithSecurityProfile, + DefinitionStages.WithCompletionPercent, + DefinitionStages.WithPublicNetworkAccess, + DefinitionStages.WithDataAccessAuthMode, + DefinitionStages.WithOptimizedForFrequentAttach { + /** + * Executes the create request. + * + * @return the created resource. + */ + Disk create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Disk create(Context context); + } + /** The stage of the Disk definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the Disk definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, + * UltraSSD_LRS, Premium_ZRS, StandardSSD_ZRS, or PremiumV2_LRS.. + * + * @param sku The disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, UltraSSD_LRS, + * Premium_ZRS, StandardSSD_ZRS, or PremiumV2_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 supportedCapabilities. */ + interface WithSupportedCapabilities { + /** + * Specifies the supportedCapabilities property: List of supported capabilities for the image from which the + * OS disk was created.. + * + * @param supportedCapabilities List of supported capabilities for the image from which the OS disk was + * created. + * @return the next definition stage. + */ + WithCreate withSupportedCapabilities(SupportedCapabilities supportedCapabilities); + } + /** The stage of the Disk definition allowing to specify creationData. */ + interface WithCreationData { + /** + * Specifies the creationData property: Disk source information. CreationData information cannot be changed + * after the disk has been created.. + * + * @param creationData Disk source information. CreationData information cannot be changed after the disk + * has been created. + * @return the next definition stage. + */ + WithCreate withCreationData(CreationData creationData); + } + /** The stage of the Disk definition allowing to specify diskSizeGB. */ + interface WithDiskSizeGB { + /** + * Specifies the diskSizeGB property: If creationData.createOption is Empty, this field is mandatory and it + * indicates the size of the disk to create. If this field is present for updates or creation with other + * options, it indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and + * can only increase the disk's size.. + * + * @param diskSizeGB If creationData.createOption is Empty, this field is mandatory and it indicates the + * size of the disk to create. If this field is present for updates or creation with other options, it + * indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and can + * only increase the disk's size. + * @return the next definition stage. + */ + WithCreate withDiskSizeGB(Integer diskSizeGB); + } + /** The stage of the Disk definition allowing to specify encryptionSettingsCollection. */ + interface WithEncryptionSettingsCollection { + /** + * Specifies the encryptionSettingsCollection property: Encryption settings collection used for Azure Disk + * Encryption, can contain multiple encryption settings per disk or snapshot.. + * + * @param encryptionSettingsCollection Encryption settings collection used for Azure Disk Encryption, can + * contain multiple encryption settings per disk or snapshot. + * @return the next definition stage. + */ + WithCreate withEncryptionSettingsCollection(EncryptionSettingsCollection encryptionSettingsCollection); + } + /** The stage of the Disk definition allowing to specify diskIopsReadWrite. */ + interface WithDiskIopsReadWrite { + /** + * Specifies the diskIopsReadWrite property: The number of IOPS allowed for this disk; only settable for + * UltraSSD disks. One operation can transfer between 4k and 256k bytes.. + * + * @param diskIopsReadWrite The number of IOPS allowed for this disk; only settable for UltraSSD disks. One + * operation can transfer between 4k and 256k bytes. + * @return the next definition stage. + */ + WithCreate withDiskIopsReadWrite(Long diskIopsReadWrite); + } + /** The stage of the Disk definition allowing to specify diskMBpsReadWrite. */ + interface WithDiskMBpsReadWrite { + /** + * Specifies the diskMBpsReadWrite property: The bandwidth allowed for this disk; only settable for UltraSSD + * disks. MBps means millions of bytes per second - MB here uses the ISO notation, of powers of 10.. + * + * @param diskMBpsReadWrite The bandwidth allowed for this disk; only settable for UltraSSD disks. MBps + * means millions of bytes per second - MB here uses the ISO notation, of powers of 10. + * @return the next definition stage. + */ + WithCreate withDiskMBpsReadWrite(Long diskMBpsReadWrite); + } + /** The stage of the Disk definition allowing to specify diskIopsReadOnly. */ + interface WithDiskIopsReadOnly { + /** + * Specifies the diskIopsReadOnly property: The total number of IOPS that will be allowed across all VMs + * mounting the shared disk as ReadOnly. One operation can transfer between 4k and 256k bytes.. + * + * @param diskIopsReadOnly The total number of IOPS that will be allowed across all VMs mounting the shared + * disk as ReadOnly. One operation can transfer between 4k and 256k bytes. + * @return the next definition stage. + */ + WithCreate withDiskIopsReadOnly(Long diskIopsReadOnly); + } + /** The stage of the Disk definition allowing to specify diskMBpsReadOnly. */ + interface WithDiskMBpsReadOnly { + /** + * Specifies the diskMBpsReadOnly property: The total throughput (MBps) that will be allowed across all VMs + * mounting the shared disk as ReadOnly. MBps means millions of bytes per second - MB here uses the ISO + * notation, of powers of 10.. + * + * @param diskMBpsReadOnly The total throughput (MBps) that will be allowed across all VMs mounting the + * shared disk as ReadOnly. MBps means millions of bytes per second - MB here uses the ISO notation, of + * powers of 10. + * @return the next definition stage. + */ + WithCreate withDiskMBpsReadOnly(Long diskMBpsReadOnly); + } + /** The stage of the Disk definition allowing to specify encryption. */ + interface WithEncryption { + /** + * Specifies the encryption property: Encryption property can be used to encrypt data at rest with customer + * managed keys or platform managed keys.. + * + * @param encryption Encryption property can be used to encrypt data at rest with customer managed keys or + * platform managed keys. + * @return the next definition stage. + */ + WithCreate withEncryption(Encryption encryption); + } + /** The stage of the Disk definition allowing to specify maxShares. */ + interface WithMaxShares { + /** + * Specifies the maxShares property: The maximum number of VMs that can attach to the disk at the same time. + * Value greater than one indicates a disk that can be mounted on multiple VMs at the same time.. + * + * @param maxShares The maximum number of VMs that can attach to the disk at the same time. Value greater + * than one indicates a disk that can be mounted on multiple VMs at the same time. + * @return the next definition stage. + */ + WithCreate withMaxShares(Integer maxShares); + } + /** The stage of the Disk definition allowing to specify networkAccessPolicy. */ + interface WithNetworkAccessPolicy { + /** + * Specifies the networkAccessPolicy property: Policy for accessing the disk via network.. + * + * @param networkAccessPolicy Policy for accessing the disk via network. + * @return the next definition stage. + */ + WithCreate withNetworkAccessPolicy(NetworkAccessPolicy networkAccessPolicy); + } + /** The stage of the Disk definition allowing to specify diskAccessId. */ + interface WithDiskAccessId { + /** + * Specifies the diskAccessId property: ARM id of the DiskAccess resource for using private endpoints on + * disks.. + * + * @param diskAccessId ARM id of the DiskAccess resource for using private endpoints on disks. + * @return the next definition stage. + */ + WithCreate withDiskAccessId(String diskAccessId); + } + /** The stage of the Disk definition allowing to specify tier. */ + interface WithTier { + /** + * Specifies the tier property: Performance tier of the disk (e.g, P4, S10) as described here: + * https://azure.microsoft.com/en-us/pricing/details/managed-disks/. Does not apply to Ultra disks.. + * + * @param tier Performance tier of the disk (e.g, P4, S10) as described here: + * https://azure.microsoft.com/en-us/pricing/details/managed-disks/. Does not apply to Ultra disks. + * @return the next definition stage. + */ + WithCreate withTier(String tier); + } + /** The stage of the Disk definition allowing to specify burstingEnabled. */ + interface WithBurstingEnabled { + /** + * Specifies the burstingEnabled property: Set to true to enable bursting beyond the provisioned performance + * target of the disk. Bursting is disabled by default. Does not apply to Ultra disks.. + * + * @param burstingEnabled Set to true to enable bursting beyond the provisioned performance target of the + * disk. Bursting is disabled by default. Does not apply to Ultra disks. + * @return the next definition stage. + */ + WithCreate withBurstingEnabled(Boolean burstingEnabled); + } + /** The stage of the Disk definition allowing to specify supportsHibernation. */ + interface WithSupportsHibernation { + /** + * Specifies the supportsHibernation property: Indicates the OS on a disk supports hibernation.. + * + * @param supportsHibernation Indicates the OS on a disk supports hibernation. + * @return the next definition stage. + */ + WithCreate withSupportsHibernation(Boolean supportsHibernation); + } + /** The stage of the Disk definition allowing to specify securityProfile. */ + interface WithSecurityProfile { + /** + * Specifies the securityProfile property: Contains the security related information for the resource.. + * + * @param securityProfile Contains the security related information for the resource. + * @return the next definition stage. + */ + WithCreate withSecurityProfile(DiskSecurityProfile securityProfile); + } + /** The stage of the Disk definition allowing to specify completionPercent. */ + interface WithCompletionPercent { + /** + * Specifies the completionPercent property: Percentage complete for the background copy when a resource is + * created via the CopyStart operation.. + * + * @param completionPercent Percentage complete for the background copy when a resource is created via the + * CopyStart operation. + * @return the next definition stage. + */ + WithCreate withCompletionPercent(Float completionPercent); + } + /** The stage of the Disk definition allowing to specify publicNetworkAccess. */ + interface WithPublicNetworkAccess { + /** + * Specifies the publicNetworkAccess property: Policy for controlling export on the disk.. + * + * @param publicNetworkAccess Policy for controlling export on the disk. + * @return the next definition stage. + */ + WithCreate withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess); + } + /** The stage of the Disk definition allowing to specify dataAccessAuthMode. */ + interface WithDataAccessAuthMode { + /** + * Specifies the dataAccessAuthMode property: Additional authentication requirements when exporting or + * uploading to a disk or snapshot.. + * + * @param dataAccessAuthMode Additional authentication requirements when exporting or uploading to a disk or + * snapshot. + * @return the next definition stage. + */ + WithCreate withDataAccessAuthMode(DataAccessAuthMode dataAccessAuthMode); + } + /** The stage of the Disk definition allowing to specify optimizedForFrequentAttach. */ + interface WithOptimizedForFrequentAttach { + /** + * Specifies the optimizedForFrequentAttach property: Setting this property to true improves reliability and + * performance of data disks that are frequently (more than 5 times a day) by detached from one virtual + * machine and attached to another. This property should not be set for disks that are not detached and + * attached frequently as it causes the disks to not align with the fault domain of the virtual machine.. + * + * @param optimizedForFrequentAttach Setting this property to true improves reliability and performance of + * data disks that are frequently (more than 5 times a day) by detached from one virtual machine and + * attached to another. This property should not be set for disks that are not detached and attached + * frequently as it causes the disks to not align with the fault domain of the virtual machine. + * @return the next definition stage. + */ + WithCreate withOptimizedForFrequentAttach(Boolean optimizedForFrequentAttach); + } + } + /** + * Begins update for the Disk resource. + * + * @return the stage of resource update. + */ + Disk.Update update(); + + /** The template for Disk update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithSku, + UpdateStages.WithOsType, + UpdateStages.WithDiskSizeGB, + UpdateStages.WithEncryptionSettingsCollection, + UpdateStages.WithDiskIopsReadWrite, + UpdateStages.WithDiskMBpsReadWrite, + UpdateStages.WithDiskIopsReadOnly, + UpdateStages.WithDiskMBpsReadOnly, + UpdateStages.WithMaxShares, + UpdateStages.WithEncryption, + UpdateStages.WithNetworkAccessPolicy, + UpdateStages.WithDiskAccessId, + UpdateStages.WithTier, + UpdateStages.WithBurstingEnabled, + UpdateStages.WithPurchasePlan, + UpdateStages.WithSupportedCapabilities, + UpdateStages.WithSupportsHibernation, + UpdateStages.WithPublicNetworkAccess, + UpdateStages.WithDataAccessAuthMode, + UpdateStages.WithOptimizedForFrequentAttach { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Disk apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Disk apply(Context context); + } + /** The Disk update stages. */ + interface UpdateStages { + /** The stage of the Disk update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the Disk update allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, + * UltraSSD_LRS, Premium_ZRS, StandardSSD_ZRS, or PremiumV2_LRS.. + * + * @param sku The disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, UltraSSD_LRS, + * Premium_ZRS, StandardSSD_ZRS, or PremiumV2_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); + } + /** The stage of the Disk update allowing to specify supportedCapabilities. */ + interface WithSupportedCapabilities { + /** + * Specifies the supportedCapabilities property: List of supported capabilities to be added on the OS disk.. + * + * @param supportedCapabilities List of supported capabilities to be added on the OS disk. + * @return the next definition stage. + */ + Update withSupportedCapabilities(SupportedCapabilities supportedCapabilities); + } + /** The stage of the Disk update allowing to specify supportsHibernation. */ + interface WithSupportsHibernation { + /** + * Specifies the supportsHibernation property: Indicates the OS on a disk supports hibernation.. + * + * @param supportsHibernation Indicates the OS on a disk supports hibernation. + * @return the next definition stage. + */ + Update withSupportsHibernation(Boolean supportsHibernation); + } + /** The stage of the Disk update allowing to specify publicNetworkAccess. */ + interface WithPublicNetworkAccess { + /** + * Specifies the publicNetworkAccess property: Policy for controlling export on the disk.. + * + * @param publicNetworkAccess Policy for controlling export on the disk. + * @return the next definition stage. + */ + Update withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess); + } + /** The stage of the Disk update allowing to specify dataAccessAuthMode. */ + interface WithDataAccessAuthMode { + /** + * Specifies the dataAccessAuthMode property: Additional authentication requirements when exporting or + * uploading to a disk or snapshot.. + * + * @param dataAccessAuthMode Additional authentication requirements when exporting or uploading to a disk or + * snapshot. + * @return the next definition stage. + */ + Update withDataAccessAuthMode(DataAccessAuthMode dataAccessAuthMode); + } + /** The stage of the Disk update allowing to specify optimizedForFrequentAttach. */ + interface WithOptimizedForFrequentAttach { + /** + * Specifies the optimizedForFrequentAttach property: Setting this property to true improves reliability and + * performance of data disks that are frequently (more than 5 times a day) by detached from one virtual + * machine and attached to another. This property should not be set for disks that are not detached and + * attached frequently as it causes the disks to not align with the fault domain of the virtual machine.. + * + * @param optimizedForFrequentAttach Setting this property to true improves reliability and performance of + * data disks that are frequently (more than 5 times a day) by detached from one virtual machine and + * attached to another. This property should not be set for disks that are not detached and attached + * frequently as it causes the disks to not align with the fault domain of the virtual machine. + * @return the next definition stage. + */ + Update withOptimizedForFrequentAttach(Boolean optimizedForFrequentAttach); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Disk refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Disk refresh(Context context); + + /** + * Grants access to a disk. + * + * @param grantAccessData Access data object supplied in the body of the get disk access operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a disk access SAS uri. + */ + AccessUri grantAccess(GrantAccessData grantAccessData); + + /** + * Grants access to a disk. + * + * @param grantAccessData Access data object supplied in the body of the get disk access operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a disk access SAS uri. + */ + AccessUri grantAccess(GrantAccessData grantAccessData, Context context); + + /** + * Revokes access to a disk. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void revokeAccess(); + + /** + * Revokes access to a disk. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void revokeAccess(Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskAccess.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskAccess.java new file mode 100644 index 0000000000000..3a10a942ff548 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskAccess.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.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 extendedLocation property: The extended location where the disk access will be created. Extended + * location cannot be changed. + * + * @return the extendedLocation value. + */ + ExtendedLocation extendedLocation(); + + /** + * 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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * 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, DefinitionStages.WithExtendedLocation { + /** + * 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); + } + /** The stage of the DiskAccess definition allowing to specify extendedLocation. */ + interface WithExtendedLocation { + /** + * Specifies the extendedLocation property: The extended location where the disk access will be created. + * Extended location cannot be changed.. + * + * @param extendedLocation The extended location where the disk access will be created. Extended location + * cannot be changed. + * @return the next definition stage. + */ + WithCreate withExtendedLocation(ExtendedLocation extendedLocation); + } + } + /** + * 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..7c1112e62ddcc --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskAccessList.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.azure.resourcemanager.compute.generated.fluent.models.DiskAccessInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List disk access operation response. */ +@Fluent +public final class DiskAccessList { + /* + * 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; + + /** Creates an instance of DiskAccessList class. */ + public DiskAccessList() { + } + + /** + * 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()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DiskAccessList.class); +} 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..1ac4fc50a7ef7 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskAccessUpdate.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.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Used for updating a disk access resource. */ +@Fluent +public final class DiskAccessUpdate { + /* + * Resource tags + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** Creates an instance of DiskAccessUpdate class. */ + public DiskAccessUpdate() { + } + + /** + * 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..5ef462a85ec13 --- /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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.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 along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String diskAccessName, 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. + */ + DiskAccess getByResourceGroup(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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 along with {@link Response}. + */ + Response getPrivateLinkResourcesWithResponse( + String resourceGroupName, String diskAccessName, 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); + + /** + * 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.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 along with {@link Response}. + */ + Response getAPrivateEndpointConnectionWithResponse( + String resourceGroupName, String diskAccessName, String privateEndpointConnectionName, 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); + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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/DiskControllerTypes.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskControllerTypes.java new file mode 100644 index 0000000000000..d3b7377400431 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskControllerTypes.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Specifies the disk controller type configured for the VM and VirtualMachineScaleSet. This property is only supported + * for virtual machines whose operating system disk and VM sku supports Generation 2 + * (https://docs.microsoft.com/en-us/azure/virtual-machines/generation-2), please check the HyperVGenerations capability + * returned as part of VM sku capabilities in the response of Microsoft.Compute SKUs api for the region contains V2 + * (https://docs.microsoft.com/rest/api/compute/resourceskus/list). For more information about Disk Controller Types + * supported please refer to https://aka.ms/azure-diskcontrollertypes. + */ +public final class DiskControllerTypes extends ExpandableStringEnum { + /** Static value SCSI for DiskControllerTypes. */ + public static final DiskControllerTypes SCSI = fromString("SCSI"); + + /** Static value NVMe for DiskControllerTypes. */ + public static final DiskControllerTypes NVME = fromString("NVMe"); + + /** + * Creates a new instance of DiskControllerTypes value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DiskControllerTypes() { + } + + /** + * Creates or finds a DiskControllerTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding DiskControllerTypes. + */ + @JsonCreator + public static DiskControllerTypes fromString(String name) { + return fromString(name, DiskControllerTypes.class); + } + + /** + * Gets known DiskControllerTypes values. + * + * @return known DiskControllerTypes values. + */ + public static Collection values() { + return values(DiskControllerTypes.class); + } +} 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..c03478746df95 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskCreateOption.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** This enumerates the possible sources of a disk's creation. */ +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"); + + /** Static value CopyStart for DiskCreateOption. */ + public static final DiskCreateOption COPY_START = fromString("CopyStart"); + + /** Static value ImportSecure for DiskCreateOption. */ + public static final DiskCreateOption IMPORT_SECURE = fromString("ImportSecure"); + + /** Static value UploadPreparedSecure for DiskCreateOption. */ + public static final DiskCreateOption UPLOAD_PREPARED_SECURE = fromString("UploadPreparedSecure"); + + /** + * Creates a new instance of DiskCreateOption value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DiskCreateOption() { + } + + /** + * 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); + } + + /** + * Gets known DiskCreateOption values. + * + * @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..1401a22584b3b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskCreateOptionTypes.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Specifies how the virtual machine should be created. Possible values are: **Attach.** This value is used when you are + * using a specialized disk to create the virtual machine. **FromImage.** 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. + */ +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 a new instance of DiskCreateOptionTypes value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DiskCreateOptionTypes() { + } + + /** + * 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); + } + + /** + * Gets known DiskCreateOptionTypes values. + * + * @return known DiskCreateOptionTypes values. + */ + public static Collection values() { + return values(DiskCreateOptionTypes.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskDeleteOptionTypes.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskDeleteOptionTypes.java new file mode 100644 index 0000000000000..35a76cfd8995c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskDeleteOptionTypes.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; + +/** + * Specifies the behavior of the managed disk when the VM gets deleted, for example whether the managed disk is deleted + * or detached. Supported values are: **Delete.** If this value is used, the managed disk is deleted when VM gets + * deleted. **Detach.** If this value is used, the managed disk is retained after VM gets deleted. Minimum api-version: + * 2021-03-01. + */ +public final class DiskDeleteOptionTypes extends ExpandableStringEnum { + /** Static value Delete for DiskDeleteOptionTypes. */ + public static final DiskDeleteOptionTypes DELETE = fromString("Delete"); + + /** Static value Detach for DiskDeleteOptionTypes. */ + public static final DiskDeleteOptionTypes DETACH = fromString("Detach"); + + /** + * Creates a new instance of DiskDeleteOptionTypes value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DiskDeleteOptionTypes() { + } + + /** + * Creates or finds a DiskDeleteOptionTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding DiskDeleteOptionTypes. + */ + @JsonCreator + public static DiskDeleteOptionTypes fromString(String name) { + return fromString(name, DiskDeleteOptionTypes.class); + } + + /** + * Gets known DiskDeleteOptionTypes values. + * + * @return known DiskDeleteOptionTypes values. + */ + public static Collection values() { + return values(DiskDeleteOptionTypes.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskDetachOptionTypes.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskDetachOptionTypes.java new file mode 100644 index 0000000000000..ac312059dccee --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskDetachOptionTypes.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; + +/** + * 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 are: **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'. + */ +public final class DiskDetachOptionTypes extends ExpandableStringEnum { + /** Static value ForceDetach for DiskDetachOptionTypes. */ + public static final DiskDetachOptionTypes FORCE_DETACH = fromString("ForceDetach"); + + /** + * Creates a new instance of DiskDetachOptionTypes value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DiskDetachOptionTypes() { + } + + /** + * 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); + } + + /** + * Gets known DiskDetachOptionTypes values. + * + * @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..87faab57a89e9 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskEncryptionSet.java @@ -0,0 +1,394 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.DiskEncryptionSetInner; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of DiskEncryptionSet. */ +public interface DiskEncryptionSet { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the identity property: The managed identity for the disk encryption set. It should be given permission on + * the key vault before it can be used to encrypt disks. + * + * @return the identity value. + */ + EncryptionSetIdentity identity(); + + /** + * Gets the encryptionType property: The type of key used to encrypt the data of the disk. + * + * @return the encryptionType value. + */ + DiskEncryptionSetType encryptionType(); + + /** + * Gets the activeKey property: The key vault key which is currently used by this disk encryption set. + * + * @return the activeKey value. + */ + KeyForDiskEncryptionSet activeKey(); + + /** + * Gets the previousKeys property: A readonly collection of key vault keys previously used by this disk encryption + * set while a key rotation is in progress. It will be empty if there is no ongoing key rotation. + * + * @return the previousKeys value. + */ + List previousKeys(); + + /** + * Gets the provisioningState property: The disk encryption set provisioning state. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the rotationToLatestKeyVersionEnabled property: Set this flag to true to enable auto-updating of this disk + * encryption set to the latest key version. + * + * @return the rotationToLatestKeyVersionEnabled value. + */ + Boolean rotationToLatestKeyVersionEnabled(); + + /** + * Gets the lastKeyRotationTimestamp property: The time when the active key of this disk encryption set was updated. + * + * @return the lastKeyRotationTimestamp value. + */ + OffsetDateTime lastKeyRotationTimestamp(); + + /** + * Gets the autoKeyRotationError property: The error that was encountered during auto-key rotation. If an error is + * present, then auto-key rotation will not be attempted until the error on this disk encryption set is fixed. + * + * @return the autoKeyRotationError value. + */ + ApiError autoKeyRotationError(); + + /** + * Gets the federatedClientId property: Multi-tenant application client id to access key vault in a different + * tenant. Setting the value to 'None' will clear the property. + * + * @return the federatedClientId value. + */ + String federatedClientId(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.compute.generated.fluent.models.DiskEncryptionSetInner object. + * + * @return the inner object. + */ + DiskEncryptionSetInner innerModel(); + + /** The entirety of the DiskEncryptionSet definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The DiskEncryptionSet definition stages. */ + interface DefinitionStages { + /** The first stage of the DiskEncryptionSet definition. */ + interface Blank extends WithLocation { + } + /** The stage of the DiskEncryptionSet definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the DiskEncryptionSet definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the DiskEncryptionSet definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithIdentity, + DefinitionStages.WithEncryptionType, + DefinitionStages.WithActiveKey, + DefinitionStages.WithRotationToLatestKeyVersionEnabled, + DefinitionStages.WithFederatedClientId { + /** + * Executes the create request. + * + * @return the created resource. + */ + DiskEncryptionSet create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + DiskEncryptionSet create(Context context); + } + /** The stage of the DiskEncryptionSet definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the DiskEncryptionSet definition allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: The managed identity for the disk encryption set. It should be given + * permission on the key vault before it can be used to encrypt disks.. + * + * @param identity The managed identity for the disk encryption set. It should be given permission on the + * key vault before it can be used to encrypt disks. + * @return the next definition stage. + */ + WithCreate withIdentity(EncryptionSetIdentity identity); + } + /** The stage of the DiskEncryptionSet definition allowing to specify encryptionType. */ + interface WithEncryptionType { + /** + * Specifies the encryptionType property: The type of key used to encrypt the data of the disk.. + * + * @param encryptionType The type of key used to encrypt the data of the disk. + * @return the next definition stage. + */ + WithCreate withEncryptionType(DiskEncryptionSetType encryptionType); + } + /** The stage of the DiskEncryptionSet definition allowing to specify activeKey. */ + interface WithActiveKey { + /** + * Specifies the activeKey property: The key vault key which is currently used by this disk encryption set.. + * + * @param activeKey The key vault key which is currently used by this disk encryption set. + * @return the next definition stage. + */ + WithCreate withActiveKey(KeyForDiskEncryptionSet activeKey); + } + /** The stage of the DiskEncryptionSet definition allowing to specify rotationToLatestKeyVersionEnabled. */ + interface WithRotationToLatestKeyVersionEnabled { + /** + * Specifies the rotationToLatestKeyVersionEnabled property: Set this flag to true to enable auto-updating + * of this disk encryption set to the latest key version.. + * + * @param rotationToLatestKeyVersionEnabled Set this flag to true to enable auto-updating of this disk + * encryption set to the latest key version. + * @return the next definition stage. + */ + WithCreate withRotationToLatestKeyVersionEnabled(Boolean rotationToLatestKeyVersionEnabled); + } + /** The stage of the DiskEncryptionSet definition allowing to specify federatedClientId. */ + interface WithFederatedClientId { + /** + * Specifies the federatedClientId property: Multi-tenant application client id to access key vault in a + * different tenant. Setting the value to 'None' will clear the property.. + * + * @param federatedClientId Multi-tenant application client id to access key vault in a different tenant. + * Setting the value to 'None' will clear the property. + * @return the next definition stage. + */ + WithCreate withFederatedClientId(String federatedClientId); + } + } + /** + * Begins update for the DiskEncryptionSet resource. + * + * @return the stage of resource update. + */ + DiskEncryptionSet.Update update(); + + /** The template for DiskEncryptionSet update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithIdentity, + UpdateStages.WithEncryptionType, + UpdateStages.WithActiveKey, + UpdateStages.WithRotationToLatestKeyVersionEnabled, + UpdateStages.WithFederatedClientId { + /** + * Executes the update request. + * + * @return the updated resource. + */ + DiskEncryptionSet apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + DiskEncryptionSet apply(Context context); + } + /** The DiskEncryptionSet update stages. */ + interface UpdateStages { + /** The stage of the DiskEncryptionSet update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the DiskEncryptionSet update allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: The managed identity for the disk encryption set. It should be given + * permission on the key vault before it can be used to encrypt disks.. + * + * @param identity The managed identity for the disk encryption set. It should be given permission on the + * key vault before it can be used to encrypt disks. + * @return the next definition stage. + */ + Update withIdentity(EncryptionSetIdentity identity); + } + /** The stage of the DiskEncryptionSet update allowing to specify encryptionType. */ + interface WithEncryptionType { + /** + * Specifies the encryptionType property: The type of key used to encrypt the data of the disk.. + * + * @param encryptionType The type of key used to encrypt the data of the disk. + * @return the next definition stage. + */ + Update withEncryptionType(DiskEncryptionSetType encryptionType); + } + /** The stage of the DiskEncryptionSet update allowing to specify activeKey. */ + interface WithActiveKey { + /** + * Specifies the activeKey property: Key Vault Key Url to be used for server side encryption of Managed + * Disks and Snapshots. + * + * @param activeKey Key Vault Key Url to be used for server side encryption of Managed Disks and Snapshots. + * @return the next definition stage. + */ + Update withActiveKey(KeyForDiskEncryptionSet activeKey); + } + /** The stage of the DiskEncryptionSet update allowing to specify rotationToLatestKeyVersionEnabled. */ + interface WithRotationToLatestKeyVersionEnabled { + /** + * Specifies the rotationToLatestKeyVersionEnabled property: Set this flag to true to enable auto-updating + * of this disk encryption set to the latest key version.. + * + * @param rotationToLatestKeyVersionEnabled Set this flag to true to enable auto-updating of this disk + * encryption set to the latest key version. + * @return the next definition stage. + */ + Update withRotationToLatestKeyVersionEnabled(Boolean rotationToLatestKeyVersionEnabled); + } + /** The stage of the DiskEncryptionSet update allowing to specify federatedClientId. */ + interface WithFederatedClientId { + /** + * Specifies the federatedClientId property: Multi-tenant application client id to access key vault in a + * different tenant. Setting the value to 'None' will clear the property.. + * + * @param federatedClientId Multi-tenant application client id to access key vault in a different tenant. + * Setting the value to 'None' will clear the property. + * @return the next definition stage. + */ + Update withFederatedClientId(String federatedClientId); + } + } + /** + * 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..745680f4d12f9 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskEncryptionSetIdentityType.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * 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. + */ +public final class DiskEncryptionSetIdentityType extends ExpandableStringEnum { + /** Static value SystemAssigned for DiskEncryptionSetIdentityType. */ + public static final DiskEncryptionSetIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); + + /** Static value UserAssigned for DiskEncryptionSetIdentityType. */ + public static final DiskEncryptionSetIdentityType USER_ASSIGNED = fromString("UserAssigned"); + + /** Static value SystemAssigned, UserAssigned for DiskEncryptionSetIdentityType. */ + public static final DiskEncryptionSetIdentityType SYSTEM_ASSIGNED_USER_ASSIGNED = + fromString("SystemAssigned, UserAssigned"); + + /** Static value None for DiskEncryptionSetIdentityType. */ + public static final DiskEncryptionSetIdentityType NONE = fromString("None"); + + /** + * Creates a new instance of DiskEncryptionSetIdentityType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DiskEncryptionSetIdentityType() { + } + + /** + * 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); + } + + /** + * Gets known DiskEncryptionSetIdentityType values. + * + * @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..6896ce6fac544 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskEncryptionSetList.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.azure.resourcemanager.compute.generated.fluent.models.DiskEncryptionSetInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List disk encryption set operation response. */ +@Fluent +public final class DiskEncryptionSetList { + /* + * 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; + + /** Creates an instance of DiskEncryptionSetList class. */ + public DiskEncryptionSetList() { + } + + /** + * 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()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DiskEncryptionSetList.class); +} 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..5f6e0ae6b8b43 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskEncryptionSetParameters.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; + +/** + * Describes the parameter of customer managed disk encryption set resource id that can be specified for disk. **Note:** + * The disk encryption set resource id can only be specified for managed disk. Please refer + * https://aka.ms/mdssewithcmkoverview for more details. + */ +@Fluent +public final class DiskEncryptionSetParameters extends SubResource { + /** Creates an instance of DiskEncryptionSetParameters class. */ + public DiskEncryptionSetParameters() { + } + + /** {@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..6fce650fee1cd --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskEncryptionSetType.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The type of key used to encrypt the data of the disk. */ +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"); + + /** Static value ConfidentialVmEncryptedWithCustomerKey for DiskEncryptionSetType. */ + public static final DiskEncryptionSetType CONFIDENTIAL_VM_ENCRYPTED_WITH_CUSTOMER_KEY = + fromString("ConfidentialVmEncryptedWithCustomerKey"); + + /** + * Creates a new instance of DiskEncryptionSetType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DiskEncryptionSetType() { + } + + /** + * 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); + } + + /** + * Gets known DiskEncryptionSetType values. + * + * @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..7b85c7581cca1 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskEncryptionSetUpdate.java @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.compute.generated.fluent.models.DiskEncryptionSetUpdateProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** disk encryption set update resource. */ +@Fluent +public final class DiskEncryptionSetUpdate { + /* + * disk encryption set resource update properties. + */ + @JsonProperty(value = "properties") + private DiskEncryptionSetUpdateProperties innerProperties; + + /* + * Resource tags + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /* + * The managed identity for the disk encryption set. It should be given permission on the key vault before it can + * be used to encrypt disks. + */ + @JsonProperty(value = "identity") + private EncryptionSetIdentity identity; + + /** Creates an instance of DiskEncryptionSetUpdate class. */ + public DiskEncryptionSetUpdate() { + } + + /** + * Get the innerProperties property: disk encryption set resource update properties. + * + * @return the innerProperties value. + */ + private DiskEncryptionSetUpdateProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the DiskEncryptionSetUpdate object itself. + */ + public DiskEncryptionSetUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the identity property: The managed identity for the disk encryption set. It should be given permission on the + * key vault before it can be used to encrypt disks. + * + * @return the identity value. + */ + public EncryptionSetIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The managed identity for the disk encryption set. It should be given permission on the + * key vault before it can be used to encrypt disks. + * + * @param identity the identity value to set. + * @return the DiskEncryptionSetUpdate object itself. + */ + public DiskEncryptionSetUpdate withIdentity(EncryptionSetIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the encryptionType property: The type of key used to encrypt the data of the disk. + * + * @return the encryptionType value. + */ + public DiskEncryptionSetType encryptionType() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new DiskEncryptionSetUpdateProperties(); + } + this.innerProperties().withEncryptionType(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new DiskEncryptionSetUpdateProperties(); + } + this.innerProperties().withActiveKey(activeKey); + return this; + } + + /** + * Get the rotationToLatestKeyVersionEnabled property: Set this flag to true to enable auto-updating of this disk + * encryption set to the latest key version. + * + * @return the rotationToLatestKeyVersionEnabled value. + */ + public Boolean rotationToLatestKeyVersionEnabled() { + return this.innerProperties() == null ? null : this.innerProperties().rotationToLatestKeyVersionEnabled(); + } + + /** + * Set the rotationToLatestKeyVersionEnabled property: Set this flag to true to enable auto-updating of this disk + * encryption set to the latest key version. + * + * @param rotationToLatestKeyVersionEnabled the rotationToLatestKeyVersionEnabled value to set. + * @return the DiskEncryptionSetUpdate object itself. + */ + public DiskEncryptionSetUpdate withRotationToLatestKeyVersionEnabled(Boolean rotationToLatestKeyVersionEnabled) { + if (this.innerProperties() == null) { + this.innerProperties = new DiskEncryptionSetUpdateProperties(); + } + this.innerProperties().withRotationToLatestKeyVersionEnabled(rotationToLatestKeyVersionEnabled); + return this; + } + + /** + * Get the federatedClientId property: Multi-tenant application client id to access key vault in a different tenant. + * Setting the value to 'None' will clear the property. + * + * @return the federatedClientId value. + */ + public String federatedClientId() { + return this.innerProperties() == null ? null : this.innerProperties().federatedClientId(); + } + + /** + * Set the federatedClientId property: Multi-tenant application client id to access key vault in a different tenant. + * Setting the value to 'None' will clear the property. + * + * @param federatedClientId the federatedClientId value to set. + * @return the DiskEncryptionSetUpdate object itself. + */ + public DiskEncryptionSetUpdate withFederatedClientId(String federatedClientId) { + if (this.innerProperties() == null) { + this.innerProperties = new DiskEncryptionSetUpdateProperties(); + } + this.innerProperties().withFederatedClientId(federatedClientId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + if (identity() != null) { + identity().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..113f4d3054e20 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskEncryptionSets.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.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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.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 along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String diskEncryptionSetName, 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. + */ + DiskEncryptionSet getByResourceGroup(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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link + * PagedIterable}. + */ + 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 as paginated response with {@link + * PagedIterable}. + */ + 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..ef60035707f9f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskEncryptionSettings.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.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a Encryption Settings for a Disk. */ +@Fluent +public final class DiskEncryptionSettings { + /* + * 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; + + /** Creates an instance of DiskEncryptionSettings class. */ + public DiskEncryptionSettings() { + } + + /** + * 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..e186fc93c49b8 --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** This is the disk image encryption base class. */ +@Fluent +public class DiskImageEncryption { + /* + * A relative URI containing the resource ID of the disk encryption set. + */ + @JsonProperty(value = "diskEncryptionSetId") + private String diskEncryptionSetId; + + /** Creates an instance of DiskImageEncryption class. */ + public DiskImageEncryption() { + } + + /** + * 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..f8c85be7e79ba --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskInstanceView.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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The instance view of the disk. */ +@Fluent +public final class DiskInstanceView { + /* + * 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; + + /** Creates an instance of DiskInstanceView class. */ + public DiskInstanceView() { + } + + /** + * 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..ed86482363ef6 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskList.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.DiskInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List Disks operation response. */ +@Fluent +public final class DiskList { + /* + * 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; + + /** Creates an instance of DiskList class. */ + public DiskList() { + } + + /** + * 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()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DiskList.class); +} 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..e4ab694242bae --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskRestorePoint.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.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 or source disk restore point. + * + * @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 supportedCapabilities property: List of supported capabilities for the image from which the OS disk was + * created. + * + * @return the supportedCapabilities value. + */ + SupportedCapabilities supportedCapabilities(); + + /** + * Gets the familyId property: id of the backing snapshot's MIS family. + * + * @return the familyId value. + */ + String familyId(); + + /** + * Gets the sourceUniqueId property: unique incarnation id of the source disk. + * + * @return the sourceUniqueId value. + */ + String sourceUniqueId(); + + /** + * Gets the encryption property: Encryption property can be used to encrypt data at rest with customer managed keys + * or platform managed keys. + * + * @return the encryption value. + */ + Encryption encryption(); + + /** + * Gets the supportsHibernation property: Indicates the OS on a disk supports hibernation. + * + * @return the supportsHibernation value. + */ + Boolean supportsHibernation(); + + /** + * Gets the networkAccessPolicy property: Policy for accessing the disk via network. + * + * @return the networkAccessPolicy value. + */ + NetworkAccessPolicy networkAccessPolicy(); + + /** + * Gets the publicNetworkAccess property: Policy for controlling export on the disk. + * + * @return the publicNetworkAccess value. + */ + PublicNetworkAccess publicNetworkAccess(); + + /** + * Gets the diskAccessId property: ARM id of the DiskAccess resource for using private endpoints on disks. + * + * @return the diskAccessId value. + */ + String diskAccessId(); + + /** + * Gets the completionPercent property: Percentage complete for the background copy of disk restore point when + * source resource is from a different region. + * + * @return the completionPercent value. + */ + Float completionPercent(); + + /** + * Gets the replicationState property: Replication state of disk restore point when source resource is from a + * different region. + * + * @return the replicationState value. + */ + String replicationState(); + + /** + * Gets the sourceResourceLocation property: Location of source disk or source disk restore point when source + * resource is from a different region. + * + * @return the sourceResourceLocation value. + */ + String sourceResourceLocation(); + + /** + * Gets the securityProfile property: Contains the security related information for the resource. + * + * @return the securityProfile value. + */ + DiskSecurityProfile securityProfile(); + + /** + * 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/DiskRestorePointAttributes.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskRestorePointAttributes.java new file mode 100644 index 0000000000000..6d88d189af288 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskRestorePointAttributes.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.fasterxml.jackson.annotation.JsonProperty; + +/** Disk Restore Point details. */ +@Fluent +public final class DiskRestorePointAttributes extends SubResourceReadOnly { + /* + * Encryption at rest settings for disk restore point. It is an optional property that can be specified in the + * input while creating a restore point. + */ + @JsonProperty(value = "encryption") + private RestorePointEncryption encryption; + + /* + * Resource Id of the source disk restore point. + */ + @JsonProperty(value = "sourceDiskRestorePoint") + private ApiEntityReference sourceDiskRestorePoint; + + /** Creates an instance of DiskRestorePointAttributes class. */ + public DiskRestorePointAttributes() { + } + + /** + * Get the encryption property: Encryption at rest settings for disk restore point. It is an optional property that + * can be specified in the input while creating a restore point. + * + * @return the encryption value. + */ + public RestorePointEncryption encryption() { + return this.encryption; + } + + /** + * Set the encryption property: Encryption at rest settings for disk restore point. It is an optional property that + * can be specified in the input while creating a restore point. + * + * @param encryption the encryption value to set. + * @return the DiskRestorePointAttributes object itself. + */ + public DiskRestorePointAttributes withEncryption(RestorePointEncryption encryption) { + this.encryption = encryption; + return this; + } + + /** + * Get the sourceDiskRestorePoint property: Resource Id of the source disk restore point. + * + * @return the sourceDiskRestorePoint value. + */ + public ApiEntityReference sourceDiskRestorePoint() { + return this.sourceDiskRestorePoint; + } + + /** + * Set the sourceDiskRestorePoint property: Resource Id of the source disk restore point. + * + * @param sourceDiskRestorePoint the sourceDiskRestorePoint value to set. + * @return the DiskRestorePointAttributes object itself. + */ + public DiskRestorePointAttributes withSourceDiskRestorePoint(ApiEntityReference sourceDiskRestorePoint) { + this.sourceDiskRestorePoint = sourceDiskRestorePoint; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (encryption() != null) { + encryption().validate(); + } + if (sourceDiskRestorePoint() != null) { + sourceDiskRestorePoint().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskRestorePointInstanceView.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskRestorePointInstanceView.java new file mode 100644 index 0000000000000..f51e945c7d07f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskRestorePointInstanceView.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.fasterxml.jackson.annotation.JsonProperty; + +/** The instance view of a disk restore point. */ +@Fluent +public final class DiskRestorePointInstanceView { + /* + * Disk restore point Id. + */ + @JsonProperty(value = "id") + private String id; + + /* + * The disk restore point replication status information. + */ + @JsonProperty(value = "replicationStatus") + private DiskRestorePointReplicationStatus replicationStatus; + + /** Creates an instance of DiskRestorePointInstanceView class. */ + public DiskRestorePointInstanceView() { + } + + /** + * Get the id property: Disk restore point Id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Disk restore point Id. + * + * @param id the id value to set. + * @return the DiskRestorePointInstanceView object itself. + */ + public DiskRestorePointInstanceView withId(String id) { + this.id = id; + return this; + } + + /** + * Get the replicationStatus property: The disk restore point replication status information. + * + * @return the replicationStatus value. + */ + public DiskRestorePointReplicationStatus replicationStatus() { + return this.replicationStatus; + } + + /** + * Set the replicationStatus property: The disk restore point replication status information. + * + * @param replicationStatus the replicationStatus value to set. + * @return the DiskRestorePointInstanceView object itself. + */ + public DiskRestorePointInstanceView withReplicationStatus(DiskRestorePointReplicationStatus replicationStatus) { + this.replicationStatus = replicationStatus; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (replicationStatus() != null) { + replicationStatus().validate(); + } + } +} 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..e9a7fe01d8e71 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskRestorePointList.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.azure.resourcemanager.compute.generated.fluent.models.DiskRestorePointInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List Disk Restore Points operation response. */ +@Fluent +public final class DiskRestorePointList { + /* + * 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; + + /** Creates an instance of DiskRestorePointList class. */ + public DiskRestorePointList() { + } + + /** + * 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()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DiskRestorePointList.class); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskRestorePointReplicationStatus.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskRestorePointReplicationStatus.java new file mode 100644 index 0000000000000..7b9cd09256fab --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskRestorePointReplicationStatus.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.fasterxml.jackson.annotation.JsonProperty; + +/** The instance view of a disk restore point. */ +@Fluent +public final class DiskRestorePointReplicationStatus { + /* + * The resource status information. + */ + @JsonProperty(value = "status") + private InstanceViewStatus status; + + /* + * Replication completion percentage. + */ + @JsonProperty(value = "completionPercent") + private Integer completionPercent; + + /** Creates an instance of DiskRestorePointReplicationStatus class. */ + public DiskRestorePointReplicationStatus() { + } + + /** + * Get the status property: The resource status information. + * + * @return the status value. + */ + public InstanceViewStatus status() { + return this.status; + } + + /** + * Set the status property: The resource status information. + * + * @param status the status value to set. + * @return the DiskRestorePointReplicationStatus object itself. + */ + public DiskRestorePointReplicationStatus withStatus(InstanceViewStatus status) { + this.status = status; + return this; + } + + /** + * Get the completionPercent property: Replication completion percentage. + * + * @return the completionPercent value. + */ + public Integer completionPercent() { + return this.completionPercent; + } + + /** + * Set the completionPercent property: Replication completion percentage. + * + * @param completionPercent the completionPercent value to set. + * @return the DiskRestorePointReplicationStatus object itself. + */ + public DiskRestorePointReplicationStatus withCompletionPercent(Integer completionPercent) { + this.completionPercent = completionPercent; + 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/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..49aa84ddf23ac --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskRestorePoints.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. + * @param diskRestorePointName The name of the disk restore point created. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.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 along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName, + 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. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. + * @param diskRestorePointName The name of the disk restore point created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.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); + + /** + * 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. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + 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. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + PagedIterable listByRestorePoint( + String resourceGroupName, String restorePointCollectionName, String vmRestorePointName, Context context); + + /** + * Grants access to a diskRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. + * @param diskRestorePointName The name of the disk restore point created. + * @param grantAccessData Access data object supplied in the body of the get disk access operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a disk access SAS uri. + */ + AccessUri grantAccess( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName, + GrantAccessData grantAccessData); + + /** + * Grants access to a diskRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. + * @param diskRestorePointName The name of the disk restore point created. + * @param grantAccessData Access data object supplied in the body of the get disk access operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a disk access SAS uri. + */ + AccessUri grantAccess( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName, + GrantAccessData grantAccessData, + Context context); + + /** + * Revokes access to a diskRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. + * @param diskRestorePointName The name of the disk restore point created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void revokeAccess( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName); + + /** + * Revokes access to a diskRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. + * @param diskRestorePointName The name of the disk restore point created. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void revokeAccess( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName, + Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskSecurityProfile.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskSecurityProfile.java new file mode 100644 index 0000000000000..004857e92894f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskSecurityProfile.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.fasterxml.jackson.annotation.JsonProperty; + +/** Contains the security related information for the resource. */ +@Fluent +public final class DiskSecurityProfile { + /* + * Specifies the SecurityType of the VM. Applicable for OS disks only. + */ + @JsonProperty(value = "securityType") + private DiskSecurityTypes securityType; + + /* + * ResourceId of the disk encryption set associated to Confidential VM supported disk encrypted with customer + * managed key + */ + @JsonProperty(value = "secureVMDiskEncryptionSetId") + private String secureVMDiskEncryptionSetId; + + /** Creates an instance of DiskSecurityProfile class. */ + public DiskSecurityProfile() { + } + + /** + * Get the securityType property: Specifies the SecurityType of the VM. Applicable for OS disks only. + * + * @return the securityType value. + */ + public DiskSecurityTypes securityType() { + return this.securityType; + } + + /** + * Set the securityType property: Specifies the SecurityType of the VM. Applicable for OS disks only. + * + * @param securityType the securityType value to set. + * @return the DiskSecurityProfile object itself. + */ + public DiskSecurityProfile withSecurityType(DiskSecurityTypes securityType) { + this.securityType = securityType; + return this; + } + + /** + * Get the secureVMDiskEncryptionSetId property: ResourceId of the disk encryption set associated to Confidential VM + * supported disk encrypted with customer managed key. + * + * @return the secureVMDiskEncryptionSetId value. + */ + public String secureVMDiskEncryptionSetId() { + return this.secureVMDiskEncryptionSetId; + } + + /** + * Set the secureVMDiskEncryptionSetId property: ResourceId of the disk encryption set associated to Confidential VM + * supported disk encrypted with customer managed key. + * + * @param secureVMDiskEncryptionSetId the secureVMDiskEncryptionSetId value to set. + * @return the DiskSecurityProfile object itself. + */ + public DiskSecurityProfile withSecureVMDiskEncryptionSetId(String secureVMDiskEncryptionSetId) { + this.secureVMDiskEncryptionSetId = secureVMDiskEncryptionSetId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskSecurityTypes.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskSecurityTypes.java new file mode 100644 index 0000000000000..59591c156ab9d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskSecurityTypes.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Specifies the SecurityType of the VM. Applicable for OS disks only. */ +public final class DiskSecurityTypes extends ExpandableStringEnum { + /** Static value TrustedLaunch for DiskSecurityTypes. */ + public static final DiskSecurityTypes TRUSTED_LAUNCH = fromString("TrustedLaunch"); + + /** Static value ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey for DiskSecurityTypes. */ + public static final DiskSecurityTypes CONFIDENTIAL_VM_VMGUEST_STATE_ONLY_ENCRYPTED_WITH_PLATFORM_KEY = + fromString("ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey"); + + /** Static value ConfidentialVM_DiskEncryptedWithPlatformKey for DiskSecurityTypes. */ + public static final DiskSecurityTypes CONFIDENTIAL_VM_DISK_ENCRYPTED_WITH_PLATFORM_KEY = + fromString("ConfidentialVM_DiskEncryptedWithPlatformKey"); + + /** Static value ConfidentialVM_DiskEncryptedWithCustomerKey for DiskSecurityTypes. */ + public static final DiskSecurityTypes CONFIDENTIAL_VM_DISK_ENCRYPTED_WITH_CUSTOMER_KEY = + fromString("ConfidentialVM_DiskEncryptedWithCustomerKey"); + + /** + * Creates a new instance of DiskSecurityTypes value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DiskSecurityTypes() { + } + + /** + * Creates or finds a DiskSecurityTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding DiskSecurityTypes. + */ + @JsonCreator + public static DiskSecurityTypes fromString(String name) { + return fromString(name, DiskSecurityTypes.class); + } + + /** + * Gets known DiskSecurityTypes values. + * + * @return known DiskSecurityTypes values. + */ + public static Collection values() { + return values(DiskSecurityTypes.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskSku.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskSku.java new file mode 100644 index 0000000000000..8e9f70c5698db --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskSku.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.fasterxml.jackson.annotation.JsonProperty; + +/** + * The disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, UltraSSD_LRS, Premium_ZRS, StandardSSD_ZRS, or + * PremiumV2_LRS. + */ +@Fluent +public final class DiskSku { + /* + * The sku name. + */ + @JsonProperty(value = "name") + private DiskStorageAccountTypes name; + + /* + * The sku tier. + */ + @JsonProperty(value = "tier", access = JsonProperty.Access.WRITE_ONLY) + private String tier; + + /** Creates an instance of DiskSku class. */ + public DiskSku() { + } + + /** + * 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..6df7ad4d19f2d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskState.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** This enumerates the possible state of the disk. */ +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 Frozen for DiskState. */ + public static final DiskState FROZEN = fromString("Frozen"); + + /** Static value ActiveSAS for DiskState. */ + public static final DiskState ACTIVE_SAS = fromString("ActiveSAS"); + + /** Static value ActiveSASFrozen for DiskState. */ + public static final DiskState ACTIVE_SASFROZEN = fromString("ActiveSASFrozen"); + + /** 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 a new instance of DiskState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DiskState() { + } + + /** + * 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); + } + + /** + * Gets known DiskState values. + * + * @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..0bdfe807ff19f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskStorageAccountTypes.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The sku name. */ +public final class DiskStorageAccountTypes extends ExpandableStringEnum { + /** Static value Standard_LRS for DiskStorageAccountTypes. */ + public static final DiskStorageAccountTypes STANDARD_LRS = fromString("Standard_LRS"); + + /** Static value Premium_LRS for DiskStorageAccountTypes. */ + public static final DiskStorageAccountTypes PREMIUM_LRS = fromString("Premium_LRS"); + + /** Static value StandardSSD_LRS for DiskStorageAccountTypes. */ + public static final DiskStorageAccountTypes STANDARD_SSD_LRS = fromString("StandardSSD_LRS"); + + /** Static value UltraSSD_LRS for DiskStorageAccountTypes. */ + public static final DiskStorageAccountTypes ULTRA_SSD_LRS = fromString("UltraSSD_LRS"); + + /** Static value Premium_ZRS for DiskStorageAccountTypes. */ + public static final DiskStorageAccountTypes PREMIUM_ZRS = fromString("Premium_ZRS"); + + /** Static value StandardSSD_ZRS for DiskStorageAccountTypes. */ + public static final DiskStorageAccountTypes STANDARD_SSD_ZRS = fromString("StandardSSD_ZRS"); + + /** Static value PremiumV2_LRS for DiskStorageAccountTypes. */ + public static final DiskStorageAccountTypes PREMIUM_V2_LRS = fromString("PremiumV2_LRS"); + + /** + * Creates a new instance of DiskStorageAccountTypes value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DiskStorageAccountTypes() { + } + + /** + * 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); + } + + /** + * Gets known DiskStorageAccountTypes values. + * + * @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..6e066665267f5 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskUpdate.java @@ -0,0 +1,584 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.compute.generated.fluent.models.DiskUpdateProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Disk update resource. */ +@Fluent +public final class DiskUpdate { + /* + * Disk resource update properties. + */ + @JsonProperty(value = "properties") + private DiskUpdateProperties innerProperties; + + /* + * Resource tags + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /* + * The disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, UltraSSD_LRS, Premium_ZRS, + * StandardSSD_ZRS, or PremiumV2_LRS. + */ + @JsonProperty(value = "sku") + private DiskSku sku; + + /** Creates an instance of DiskUpdate class. */ + public DiskUpdate() { + } + + /** + * Get the innerProperties property: Disk resource update properties. + * + * @return the innerProperties value. + */ + private DiskUpdateProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the DiskUpdate object itself. + */ + public DiskUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the sku property: The disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, UltraSSD_LRS, + * Premium_ZRS, StandardSSD_ZRS, or PremiumV2_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, UltraSSD_LRS, + * Premium_ZRS, StandardSSD_ZRS, or PremiumV2_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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new DiskUpdateProperties(); + } + this.innerProperties().withOsType(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new DiskUpdateProperties(); + } + this.innerProperties().withDiskSizeGB(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new DiskUpdateProperties(); + } + this.innerProperties().withEncryptionSettingsCollection(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new DiskUpdateProperties(); + } + this.innerProperties().withDiskIopsReadWrite(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new DiskUpdateProperties(); + } + this.innerProperties().withDiskMBpsReadWrite(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new DiskUpdateProperties(); + } + this.innerProperties().withDiskIopsReadOnly(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new DiskUpdateProperties(); + } + this.innerProperties().withDiskMBpsReadOnly(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new DiskUpdateProperties(); + } + this.innerProperties().withMaxShares(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new DiskUpdateProperties(); + } + this.innerProperties().withEncryption(encryption); + return this; + } + + /** + * Get the networkAccessPolicy property: Policy for accessing the disk via network. + * + * @return the networkAccessPolicy value. + */ + public NetworkAccessPolicy networkAccessPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new DiskUpdateProperties(); + } + this.innerProperties().withNetworkAccessPolicy(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new DiskUpdateProperties(); + } + this.innerProperties().withDiskAccessId(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new DiskUpdateProperties(); + } + this.innerProperties().withTier(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new DiskUpdateProperties(); + } + this.innerProperties().withBurstingEnabled(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new DiskUpdateProperties(); + } + this.innerProperties().withPurchasePlan(purchasePlan); + return this; + } + + /** + * Get the supportedCapabilities property: List of supported capabilities to be added on the OS disk. + * + * @return the supportedCapabilities value. + */ + public SupportedCapabilities supportedCapabilities() { + return this.innerProperties() == null ? null : this.innerProperties().supportedCapabilities(); + } + + /** + * Set the supportedCapabilities property: List of supported capabilities to be added on the OS disk. + * + * @param supportedCapabilities the supportedCapabilities value to set. + * @return the DiskUpdate object itself. + */ + public DiskUpdate withSupportedCapabilities(SupportedCapabilities supportedCapabilities) { + if (this.innerProperties() == null) { + this.innerProperties = new DiskUpdateProperties(); + } + this.innerProperties().withSupportedCapabilities(supportedCapabilities); + return this; + } + + /** + * Get the propertyUpdatesInProgress property: Properties of the disk for which update is pending. + * + * @return the propertyUpdatesInProgress value. + */ + public PropertyUpdatesInProgress propertyUpdatesInProgress() { + return this.innerProperties() == null ? null : this.innerProperties().propertyUpdatesInProgress(); + } + + /** + * Get the supportsHibernation property: Indicates the OS on a disk supports hibernation. + * + * @return the supportsHibernation value. + */ + public Boolean supportsHibernation() { + return this.innerProperties() == null ? null : this.innerProperties().supportsHibernation(); + } + + /** + * Set the supportsHibernation property: Indicates the OS on a disk supports hibernation. + * + * @param supportsHibernation the supportsHibernation value to set. + * @return the DiskUpdate object itself. + */ + public DiskUpdate withSupportsHibernation(Boolean supportsHibernation) { + if (this.innerProperties() == null) { + this.innerProperties = new DiskUpdateProperties(); + } + this.innerProperties().withSupportsHibernation(supportsHibernation); + return this; + } + + /** + * Get the publicNetworkAccess property: Policy for controlling export on the disk. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.innerProperties() == null ? null : this.innerProperties().publicNetworkAccess(); + } + + /** + * Set the publicNetworkAccess property: Policy for controlling export on the disk. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the DiskUpdate object itself. + */ + public DiskUpdate withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + if (this.innerProperties() == null) { + this.innerProperties = new DiskUpdateProperties(); + } + this.innerProperties().withPublicNetworkAccess(publicNetworkAccess); + return this; + } + + /** + * Get the dataAccessAuthMode property: Additional authentication requirements when exporting or uploading to a disk + * or snapshot. + * + * @return the dataAccessAuthMode value. + */ + public DataAccessAuthMode dataAccessAuthMode() { + return this.innerProperties() == null ? null : this.innerProperties().dataAccessAuthMode(); + } + + /** + * Set the dataAccessAuthMode property: Additional authentication requirements when exporting or uploading to a disk + * or snapshot. + * + * @param dataAccessAuthMode the dataAccessAuthMode value to set. + * @return the DiskUpdate object itself. + */ + public DiskUpdate withDataAccessAuthMode(DataAccessAuthMode dataAccessAuthMode) { + if (this.innerProperties() == null) { + this.innerProperties = new DiskUpdateProperties(); + } + this.innerProperties().withDataAccessAuthMode(dataAccessAuthMode); + return this; + } + + /** + * Get the optimizedForFrequentAttach property: Setting this property to true improves reliability and performance + * of data disks that are frequently (more than 5 times a day) by detached from one virtual machine and attached to + * another. This property should not be set for disks that are not detached and attached frequently as it causes the + * disks to not align with the fault domain of the virtual machine. + * + * @return the optimizedForFrequentAttach value. + */ + public Boolean optimizedForFrequentAttach() { + return this.innerProperties() == null ? null : this.innerProperties().optimizedForFrequentAttach(); + } + + /** + * Set the optimizedForFrequentAttach property: Setting this property to true improves reliability and performance + * of data disks that are frequently (more than 5 times a day) by detached from one virtual machine and attached to + * another. This property should not be set for disks that are not detached and attached frequently as it causes the + * disks to not align with the fault domain of the virtual machine. + * + * @param optimizedForFrequentAttach the optimizedForFrequentAttach value to set. + * @return the DiskUpdate object itself. + */ + public DiskUpdate withOptimizedForFrequentAttach(Boolean optimizedForFrequentAttach) { + if (this.innerProperties() == null) { + this.innerProperties = new DiskUpdateProperties(); + } + this.innerProperties().withOptimizedForFrequentAttach(optimizedForFrequentAttach); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + if (sku() != null) { + sku().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..e2ed68eb64ceb --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Disks.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.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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String diskName, 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. + */ + Disk getByResourceGroup(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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..45123afbc2771 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Encryption.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.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Encryption at rest settings for disk or snapshot. */ +@Fluent +public final class Encryption { + /* + * 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; + + /** Creates an instance of Encryption class. */ + public Encryption() { + } + + /** + * 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..a2dd0ff70b0e2 --- /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.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 { + /* + * 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; + + /** Creates an instance of EncryptionImages class. */ + public EncryptionImages() { + } + + /** + * 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..61461c8e53bcc --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/EncryptionSetIdentity.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** + * 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 final class EncryptionSetIdentity { + /* + * 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; + + /* + * The list of user identities associated with the disk encryption 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") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map userAssignedIdentities; + + /** Creates an instance of EncryptionSetIdentity class. */ + public EncryptionSetIdentity() { + } + + /** + * 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; + } + + /** + * Get the userAssignedIdentities property: The list of user identities associated with the disk encryption 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 disk encryption 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 EncryptionSetIdentity object itself. + */ + public EncryptionSetIdentity 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/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..c8c704af8eb8f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/EncryptionSettingsCollection.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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Encryption settings for disk or snapshot. */ +@Fluent +public final class EncryptionSettingsCollection { + /* + * 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; + + /** Creates an instance of EncryptionSettingsCollection class. */ + public EncryptionSettingsCollection() { + } + + /** + * 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..4128d37ac89ce --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/EncryptionSettingsElement.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.fasterxml.jackson.annotation.JsonProperty; + +/** Encryption settings for one disk volume. */ +@Fluent +public final class EncryptionSettingsElement { + /* + * 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; + + /** Creates an instance of EncryptionSettingsElement class. */ + public EncryptionSettingsElement() { + } + + /** + * 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..23b19b3ca9e50 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/EncryptionType.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The type of key used to encrypt the data of the disk. */ +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 a new instance of EncryptionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public EncryptionType() { + } + + /** + * 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); + } + + /** + * Gets known EncryptionType values. + * + * @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..8a425f767d01f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ExecutionState.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Script execution status. */ +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 a new instance of ExecutionState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ExecutionState() { + } + + /** + * 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); + } + + /** + * Gets known ExecutionState values. + * + * @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/ExpandTypeForListVMs.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ExpandTypeForListVMs.java new file mode 100644 index 0000000000000..943672a6624b4 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ExpandTypeForListVMs.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ExpandTypeForListVMs. */ +public final class ExpandTypeForListVMs extends ExpandableStringEnum { + /** Static value instanceView for ExpandTypeForListVMs. */ + public static final ExpandTypeForListVMs INSTANCE_VIEW = fromString("instanceView"); + + /** + * Creates a new instance of ExpandTypeForListVMs value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ExpandTypeForListVMs() { + } + + /** + * Creates or finds a ExpandTypeForListVMs from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExpandTypeForListVMs. + */ + @JsonCreator + public static ExpandTypeForListVMs fromString(String name) { + return fromString(name, ExpandTypeForListVMs.class); + } + + /** + * Gets known ExpandTypeForListVMs values. + * + * @return known ExpandTypeForListVMs values. + */ + public static Collection values() { + return values(ExpandTypeForListVMs.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ExpandTypesForGetCapacityReservationGroups.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ExpandTypesForGetCapacityReservationGroups.java new file mode 100644 index 0000000000000..35d296d591951 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ExpandTypesForGetCapacityReservationGroups.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ExpandTypesForGetCapacityReservationGroups. */ +public final class ExpandTypesForGetCapacityReservationGroups + extends ExpandableStringEnum { + /** Static value virtualMachineScaleSetVMs/$ref for ExpandTypesForGetCapacityReservationGroups. */ + public static final ExpandTypesForGetCapacityReservationGroups VIRTUAL_MACHINE_SCALE_SET_VMS_REF = + fromString("virtualMachineScaleSetVMs/$ref"); + + /** Static value virtualMachines/$ref for ExpandTypesForGetCapacityReservationGroups. */ + public static final ExpandTypesForGetCapacityReservationGroups VIRTUAL_MACHINES_REF = + fromString("virtualMachines/$ref"); + + /** + * Creates a new instance of ExpandTypesForGetCapacityReservationGroups value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ExpandTypesForGetCapacityReservationGroups() { + } + + /** + * Creates or finds a ExpandTypesForGetCapacityReservationGroups from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExpandTypesForGetCapacityReservationGroups. + */ + @JsonCreator + public static ExpandTypesForGetCapacityReservationGroups fromString(String name) { + return fromString(name, ExpandTypesForGetCapacityReservationGroups.class); + } + + /** + * Gets known ExpandTypesForGetCapacityReservationGroups values. + * + * @return known ExpandTypesForGetCapacityReservationGroups values. + */ + public static Collection values() { + return values(ExpandTypesForGetCapacityReservationGroups.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ExpandTypesForGetVMScaleSets.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ExpandTypesForGetVMScaleSets.java new file mode 100644 index 0000000000000..fbd3ee479db4b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ExpandTypesForGetVMScaleSets.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ExpandTypesForGetVMScaleSets. */ +public final class ExpandTypesForGetVMScaleSets extends ExpandableStringEnum { + /** Static value userData for ExpandTypesForGetVMScaleSets. */ + public static final ExpandTypesForGetVMScaleSets USER_DATA = fromString("userData"); + + /** + * Creates a new instance of ExpandTypesForGetVMScaleSets value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ExpandTypesForGetVMScaleSets() { + } + + /** + * Creates or finds a ExpandTypesForGetVMScaleSets from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExpandTypesForGetVMScaleSets. + */ + @JsonCreator + public static ExpandTypesForGetVMScaleSets fromString(String name) { + return fromString(name, ExpandTypesForGetVMScaleSets.class); + } + + /** + * Gets known ExpandTypesForGetVMScaleSets values. + * + * @return known ExpandTypesForGetVMScaleSets values. + */ + public static Collection values() { + return values(ExpandTypesForGetVMScaleSets.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ExpandTypesForListVMs.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ExpandTypesForListVMs.java new file mode 100644 index 0000000000000..10513e3ef6eb4 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ExpandTypesForListVMs.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ExpandTypesForListVMs. */ +public final class ExpandTypesForListVMs extends ExpandableStringEnum { + /** Static value instanceView for ExpandTypesForListVMs. */ + public static final ExpandTypesForListVMs INSTANCE_VIEW = fromString("instanceView"); + + /** + * Creates a new instance of ExpandTypesForListVMs value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ExpandTypesForListVMs() { + } + + /** + * Creates or finds a ExpandTypesForListVMs from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExpandTypesForListVMs. + */ + @JsonCreator + public static ExpandTypesForListVMs fromString(String name) { + return fromString(name, ExpandTypesForListVMs.class); + } + + /** + * Gets known ExpandTypesForListVMs values. + * + * @return known ExpandTypesForListVMs values. + */ + public static Collection values() { + return values(ExpandTypesForListVMs.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..182331f8550c5 --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** The complex type of the extended location. */ +@Fluent +public final class ExtendedLocation { + /* + * The name of the extended location. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The type of the extended location. + */ + @JsonProperty(value = "type") + private ExtendedLocationTypes type; + + /** Creates an instance of ExtendedLocation class. */ + public ExtendedLocation() { + } + + /** + * 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/ExtendedLocationType.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ExtendedLocationType.java new file mode 100644 index 0000000000000..0ddcd96a58d63 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ExtendedLocationType.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The type of the extended location. */ +public final class ExtendedLocationType extends ExpandableStringEnum { + /** Static value EdgeZone for ExtendedLocationType. */ + public static final ExtendedLocationType EDGE_ZONE = fromString("EdgeZone"); + + /** + * Creates a new instance of ExtendedLocationType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ExtendedLocationType() { + } + + /** + * Creates or finds a ExtendedLocationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExtendedLocationType. + */ + @JsonCreator + public static ExtendedLocationType fromString(String name) { + return fromString(name, ExtendedLocationType.class); + } + + /** + * Gets known ExtendedLocationType values. + * + * @return known ExtendedLocationType values. + */ + public static Collection values() { + return values(ExtendedLocationType.class); + } +} 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..8f95ad0a675ba --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ExtendedLocationTypes.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The type of extendedLocation. */ +public final class ExtendedLocationTypes extends ExpandableStringEnum { + /** Static value EdgeZone for ExtendedLocationTypes. */ + public static final ExtendedLocationTypes EDGE_ZONE = fromString("EdgeZone"); + + /** + * Creates a new instance of ExtendedLocationTypes value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ExtendedLocationTypes() { + } + + /** + * 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); + } + + /** + * Gets known ExtendedLocationTypes values. + * + * @return known ExtendedLocationTypes values. + */ + public static Collection values() { + return values(ExtendedLocationTypes.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Extension.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Extension.java new file mode 100644 index 0000000000000..de470c8e5293a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Extension.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a cloud service Extension. */ +@Fluent +public final class Extension { + /* + * The name of the extension. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Extension Properties. + */ + @JsonProperty(value = "properties") + private CloudServiceExtensionProperties properties; + + /** Creates an instance of Extension class. */ + public Extension() { + } + + /** + * Get the name property: The name of the extension. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the extension. + * + * @param name the name value to set. + * @return the Extension object itself. + */ + public Extension withName(String name) { + this.name = name; + return this; + } + + /** + * Get the properties property: Extension Properties. + * + * @return the properties value. + */ + public CloudServiceExtensionProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Extension Properties. + * + * @param properties the properties value to set. + * @return the Extension object itself. + */ + public Extension withProperties(CloudServiceExtensionProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Galleries.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Galleries.java new file mode 100644 index 0000000000000..e938634a33dc9 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Galleries.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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. + * @param select The select expression to apply on the operation. + * @param expand The expand query option 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 along with {@link + * Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, + String galleryName, + SelectPermissions select, + GalleryExpandParams expand, + 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. + */ + Gallery getByResourceGroup(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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 along with {@link + * Response}. + */ + 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 expand The expand query option 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 along with {@link + * Response}. + */ + Response getByIdWithResponse( + String id, SelectPermissions select, GalleryExpandParams expand, 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..aea75285d0fcb --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Gallery.java @@ -0,0 +1,337 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 current state of the gallery or gallery artifact. + * + *

The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + GalleryProvisioningState provisioningState(); + + /** + * Gets the sharingProfile property: Profile for gallery sharing to subscription or tenant. + * + * @return the sharingProfile value. + */ + SharingProfile sharingProfile(); + + /** + * Gets the softDeletePolicy property: Contains information about the soft deletion policy of the gallery. + * + * @return the softDeletePolicy value. + */ + SoftDeletePolicy softDeletePolicy(); + + /** + * Gets the sharingStatus property: Sharing status of current gallery. + * + * @return the sharingStatus value. + */ + SharingStatus sharingStatus(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.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, + DefinitionStages.WithSoftDeletePolicy { + /** + * 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); + } + /** The stage of the Gallery definition allowing to specify softDeletePolicy. */ + interface WithSoftDeletePolicy { + /** + * Specifies the softDeletePolicy property: Contains information about the soft deletion policy of the + * gallery.. + * + * @param softDeletePolicy Contains information about the soft deletion policy of the gallery. + * @return the next definition stage. + */ + WithCreate withSoftDeletePolicy(SoftDeletePolicy softDeletePolicy); + } + } + /** + * 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, + UpdateStages.WithSoftDeletePolicy { + /** + * 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); + } + /** The stage of the Gallery update allowing to specify softDeletePolicy. */ + interface WithSoftDeletePolicy { + /** + * Specifies the softDeletePolicy property: Contains information about the soft deletion policy of the + * gallery.. + * + * @param softDeletePolicy Contains information about the soft deletion policy of the gallery. + * @return the next definition stage. + */ + Update withSoftDeletePolicy(SoftDeletePolicy softDeletePolicy); + } + } + /** + * 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..2f274ce6642ef --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryApplication.java @@ -0,0 +1,433 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.List; +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 customActions property: A list of custom actions that can be performed with all of the Gallery + * Application Versions within this Gallery Application. + * + * @return the customActions value. + */ + List customActions(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.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, + DefinitionStages.WithCustomActions { + /** + * 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); + } + /** The stage of the GalleryApplication definition allowing to specify customActions. */ + interface WithCustomActions { + /** + * Specifies the customActions property: A list of custom actions that can be performed with all of the + * Gallery Application Versions within this Gallery Application.. + * + * @param customActions A list of custom actions that can be performed with all of the Gallery Application + * Versions within this Gallery Application. + * @return the next definition stage. + */ + WithCreate withCustomActions(List customActions); + } + } + /** + * 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, + UpdateStages.WithCustomActions { + /** + * 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); + } + /** The stage of the GalleryApplication update allowing to specify customActions. */ + interface WithCustomActions { + /** + * Specifies the customActions property: A list of custom actions that can be performed with all of the + * Gallery Application Versions within this Gallery Application.. + * + * @param customActions A list of custom actions that can be performed with all of the Gallery Application + * Versions within this Gallery Application. + * @return the next definition stage. + */ + Update withCustomActions(List customActions); + } + } + /** + * 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/GalleryApplicationCustomAction.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryApplicationCustomAction.java new file mode 100644 index 0000000000000..d9c7adcdc45d8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryApplicationCustomAction.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A custom action that can be performed with a Gallery Application Version. */ +@Fluent +public final class GalleryApplicationCustomAction { + /* + * The name of the custom action. Must be unique within the Gallery Application Version. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The script to run when executing this custom action. + */ + @JsonProperty(value = "script", required = true) + private String script; + + /* + * Description to help the users understand what this custom action does. + */ + @JsonProperty(value = "description") + private String description; + + /* + * The parameters that this custom action uses + */ + @JsonProperty(value = "parameters") + private List parameters; + + /** Creates an instance of GalleryApplicationCustomAction class. */ + public GalleryApplicationCustomAction() { + } + + /** + * Get the name property: The name of the custom action. Must be unique within the Gallery Application Version. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the custom action. Must be unique within the Gallery Application Version. + * + * @param name the name value to set. + * @return the GalleryApplicationCustomAction object itself. + */ + public GalleryApplicationCustomAction withName(String name) { + this.name = name; + return this; + } + + /** + * Get the script property: The script to run when executing this custom action. + * + * @return the script value. + */ + public String script() { + return this.script; + } + + /** + * Set the script property: The script to run when executing this custom action. + * + * @param script the script value to set. + * @return the GalleryApplicationCustomAction object itself. + */ + public GalleryApplicationCustomAction withScript(String script) { + this.script = script; + return this; + } + + /** + * Get the description property: Description to help the users understand what this custom action does. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description to help the users understand what this custom action does. + * + * @param description the description value to set. + * @return the GalleryApplicationCustomAction object itself. + */ + public GalleryApplicationCustomAction withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the parameters property: The parameters that this custom action uses. + * + * @return the parameters value. + */ + public List parameters() { + return this.parameters; + } + + /** + * Set the parameters property: The parameters that this custom action uses. + * + * @param parameters the parameters value to set. + * @return the GalleryApplicationCustomAction object itself. + */ + public GalleryApplicationCustomAction withParameters(List parameters) { + this.parameters = parameters; + 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 GalleryApplicationCustomAction")); + } + if (script() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property script in model GalleryApplicationCustomAction")); + } + if (parameters() != null) { + parameters().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GalleryApplicationCustomAction.class); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryApplicationCustomActionParameter.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryApplicationCustomActionParameter.java new file mode 100644 index 0000000000000..0d2becb3fa8b0 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryApplicationCustomActionParameter.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.JsonProperty; + +/** The definition of a parameter that can be passed to a custom action of a Gallery Application Version. */ +@Fluent +public final class GalleryApplicationCustomActionParameter { + /* + * The name of the custom action. Must be unique within the Gallery Application Version. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Indicates whether this parameter must be passed when running the custom action. + */ + @JsonProperty(value = "required") + private Boolean required; + + /* + * Specifies the type of the custom action parameter. Possible values are: String, ConfigurationDataBlob or + * LogOutputBlob + */ + @JsonProperty(value = "type") + private GalleryApplicationCustomActionParameterType type; + + /* + * The default value of the parameter. Only applies to string types + */ + @JsonProperty(value = "defaultValue") + private String defaultValue; + + /* + * A description to help users understand what this parameter means + */ + @JsonProperty(value = "description") + private String description; + + /** Creates an instance of GalleryApplicationCustomActionParameter class. */ + public GalleryApplicationCustomActionParameter() { + } + + /** + * Get the name property: The name of the custom action. Must be unique within the Gallery Application Version. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the custom action. Must be unique within the Gallery Application Version. + * + * @param name the name value to set. + * @return the GalleryApplicationCustomActionParameter object itself. + */ + public GalleryApplicationCustomActionParameter withName(String name) { + this.name = name; + return this; + } + + /** + * Get the required property: Indicates whether this parameter must be passed when running the custom action. + * + * @return the required value. + */ + public Boolean required() { + return this.required; + } + + /** + * Set the required property: Indicates whether this parameter must be passed when running the custom action. + * + * @param required the required value to set. + * @return the GalleryApplicationCustomActionParameter object itself. + */ + public GalleryApplicationCustomActionParameter withRequired(Boolean required) { + this.required = required; + return this; + } + + /** + * Get the type property: Specifies the type of the custom action parameter. Possible values are: String, + * ConfigurationDataBlob or LogOutputBlob. + * + * @return the type value. + */ + public GalleryApplicationCustomActionParameterType type() { + return this.type; + } + + /** + * Set the type property: Specifies the type of the custom action parameter. Possible values are: String, + * ConfigurationDataBlob or LogOutputBlob. + * + * @param type the type value to set. + * @return the GalleryApplicationCustomActionParameter object itself. + */ + public GalleryApplicationCustomActionParameter withType(GalleryApplicationCustomActionParameterType type) { + this.type = type; + return this; + } + + /** + * Get the defaultValue property: The default value of the parameter. Only applies to string types. + * + * @return the defaultValue value. + */ + public String defaultValue() { + return this.defaultValue; + } + + /** + * Set the defaultValue property: The default value of the parameter. Only applies to string types. + * + * @param defaultValue the defaultValue value to set. + * @return the GalleryApplicationCustomActionParameter object itself. + */ + public GalleryApplicationCustomActionParameter withDefaultValue(String defaultValue) { + this.defaultValue = defaultValue; + return this; + } + + /** + * Get the description property: A description to help users understand what this parameter means. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: A description to help users understand what this parameter means. + * + * @param description the description value to set. + * @return the GalleryApplicationCustomActionParameter object itself. + */ + public GalleryApplicationCustomActionParameter withDescription(String description) { + this.description = description; + 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 GalleryApplicationCustomActionParameter")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GalleryApplicationCustomActionParameter.class); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryApplicationCustomActionParameterType.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryApplicationCustomActionParameterType.java new file mode 100644 index 0000000000000..8eb128c87d793 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryApplicationCustomActionParameterType.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.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Specifies the type of the custom action parameter. Possible values are: String, ConfigurationDataBlob or + * LogOutputBlob. + */ +public enum GalleryApplicationCustomActionParameterType { + /** Enum value String. */ + STRING("String"), + + /** Enum value ConfigurationDataBlob. */ + CONFIGURATION_DATA_BLOB("ConfigurationDataBlob"), + + /** Enum value LogOutputBlob. */ + LOG_OUTPUT_BLOB("LogOutputBlob"); + + /** The actual serialized value for a GalleryApplicationCustomActionParameterType instance. */ + private final String value; + + GalleryApplicationCustomActionParameterType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a GalleryApplicationCustomActionParameterType instance. + * + * @param value the serialized value to parse. + * @return the parsed GalleryApplicationCustomActionParameterType object, or null if unable to parse. + */ + @JsonCreator + public static GalleryApplicationCustomActionParameterType fromString(String value) { + if (value == null) { + return null; + } + GalleryApplicationCustomActionParameterType[] items = GalleryApplicationCustomActionParameterType.values(); + for (GalleryApplicationCustomActionParameterType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @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/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..253826ec3710f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryApplicationList.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.azure.resourcemanager.compute.generated.fluent.models.GalleryApplicationInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List Gallery Applications operation response. */ +@Fluent +public final class GalleryApplicationList { + /* + * 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; + + /** Creates an instance of GalleryApplicationList class. */ + public GalleryApplicationList() { + } + + /** + * 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()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GalleryApplicationList.class); +} 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..fed5261f42042 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryApplicationUpdate.java @@ -0,0 +1,226 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.compute.generated.fluent.models.GalleryApplicationProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** Specifies information about the gallery Application Definition that you want to update. */ +@Fluent +public final class GalleryApplicationUpdate extends UpdateResourceDefinition { + /* + * Describes the properties of a gallery Application Definition. + */ + @JsonProperty(value = "properties") + private GalleryApplicationProperties innerProperties; + + /** Creates an instance of GalleryApplicationUpdate class. */ + public GalleryApplicationUpdate() { + } + + /** + * Get the innerProperties property: Describes the properties of a gallery Application Definition. + * + * @return the innerProperties value. + */ + private GalleryApplicationProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public GalleryApplicationUpdate withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryApplicationProperties(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the eula property: The Eula agreement for the gallery Application Definition. + * + * @return the eula value. + */ + public String eula() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryApplicationProperties(); + } + this.innerProperties().withEula(eula); + return this; + } + + /** + * Get the privacyStatementUri property: The privacy statement uri. + * + * @return the privacyStatementUri value. + */ + public String privacyStatementUri() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryApplicationProperties(); + } + this.innerProperties().withPrivacyStatementUri(privacyStatementUri); + return this; + } + + /** + * Get the releaseNoteUri property: The release note uri. + * + * @return the releaseNoteUri value. + */ + public String releaseNoteUri() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryApplicationProperties(); + } + this.innerProperties().withReleaseNoteUri(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryApplicationProperties(); + } + this.innerProperties().withEndOfLifeDate(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryApplicationProperties(); + } + this.innerProperties().withSupportedOSType(supportedOSType); + return this; + } + + /** + * Get the customActions property: A list of custom actions that can be performed with all of the Gallery + * Application Versions within this Gallery Application. + * + * @return the customActions value. + */ + public List customActions() { + return this.innerProperties() == null ? null : this.innerProperties().customActions(); + } + + /** + * Set the customActions property: A list of custom actions that can be performed with all of the Gallery + * Application Versions within this Gallery Application. + * + * @param customActions the customActions value to set. + * @return the GalleryApplicationUpdate object itself. + */ + public GalleryApplicationUpdate withCustomActions(List customActions) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryApplicationProperties(); + } + this.innerProperties().withCustomActions(customActions); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().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..666b70fc16206 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryApplicationVersion.java @@ -0,0 +1,277 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 safetyProfile property: The safety profile of the Gallery Application Version. + * + * @return the safetyProfile value. + */ + GalleryApplicationVersionSafetyProfile safetyProfile(); + + /** + * Gets the provisioningState property: The current state of the gallery or gallery artifact. + * + *

The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + GalleryProvisioningState 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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * 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, + DefinitionStages.WithSafetyProfile { + /** + * 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); + } + /** The stage of the GalleryApplicationVersion definition allowing to specify safetyProfile. */ + interface WithSafetyProfile { + /** + * Specifies the safetyProfile property: The safety profile of the Gallery Application Version.. + * + * @param safetyProfile The safety profile of the Gallery Application Version. + * @return the next definition stage. + */ + WithCreate withSafetyProfile(GalleryApplicationVersionSafetyProfile safetyProfile); + } + } + /** + * 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, UpdateStages.WithSafetyProfile { + /** + * 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); + } + /** The stage of the GalleryApplicationVersion update allowing to specify safetyProfile. */ + interface WithSafetyProfile { + /** + * Specifies the safetyProfile property: The safety profile of the Gallery Application Version.. + * + * @param safetyProfile The safety profile of the Gallery Application Version. + * @return the next definition stage. + */ + Update withSafetyProfile(GalleryApplicationVersionSafetyProfile safetyProfile); + } + } + /** + * 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..e8eb0d15cce7b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryApplicationVersionList.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.azure.resourcemanager.compute.generated.fluent.models.GalleryApplicationVersionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List Gallery Application version operation response. */ +@Fluent +public final class GalleryApplicationVersionList { + /* + * 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; + + /** Creates an instance of GalleryApplicationVersionList class. */ + public GalleryApplicationVersionList() { + } + + /** + * 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()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GalleryApplicationVersionList.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..35d25a35e07a6 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryApplicationVersionPublishingProfile.java @@ -0,0 +1,265 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** The publishing profile of a gallery image version. */ +@Fluent +public final class GalleryApplicationVersionPublishingProfile extends GalleryArtifactPublishingProfileBase { + /* + * 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; + + /* + * Additional settings for the VM app that contains the target package and config file name when it is deployed to + * target VM or VM scale set. + */ + @JsonProperty(value = "settings") + private UserArtifactSettings settings; + + /* + * Optional. Additional settings to pass to the vm-application-manager extension. For advanced use only. + */ + @JsonProperty(value = "advancedSettings") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map advancedSettings; + + /* + * Optional. Whether or not this application reports health. + */ + @JsonProperty(value = "enableHealthCheck") + private Boolean enableHealthCheck; + + /* + * A list of custom actions that can be performed with this Gallery Application Version. + */ + @JsonProperty(value = "customActions") + private List customActions; + + /** Creates an instance of GalleryApplicationVersionPublishingProfile class. */ + public GalleryApplicationVersionPublishingProfile() { + } + + /** + * 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 settings property: Additional settings for the VM app that contains the target package and config file + * name when it is deployed to target VM or VM scale set. + * + * @return the settings value. + */ + public UserArtifactSettings settings() { + return this.settings; + } + + /** + * Set the settings property: Additional settings for the VM app that contains the target package and config file + * name when it is deployed to target VM or VM scale set. + * + * @param settings the settings value to set. + * @return the GalleryApplicationVersionPublishingProfile object itself. + */ + public GalleryApplicationVersionPublishingProfile withSettings(UserArtifactSettings settings) { + this.settings = settings; + return this; + } + + /** + * Get the advancedSettings property: Optional. Additional settings to pass to the vm-application-manager extension. + * For advanced use only. + * + * @return the advancedSettings value. + */ + public Map advancedSettings() { + return this.advancedSettings; + } + + /** + * Set the advancedSettings property: Optional. Additional settings to pass to the vm-application-manager extension. + * For advanced use only. + * + * @param advancedSettings the advancedSettings value to set. + * @return the GalleryApplicationVersionPublishingProfile object itself. + */ + public GalleryApplicationVersionPublishingProfile withAdvancedSettings(Map advancedSettings) { + this.advancedSettings = advancedSettings; + 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; + } + + /** + * Get the customActions property: A list of custom actions that can be performed with this Gallery Application + * Version. + * + * @return the customActions value. + */ + public List customActions() { + return this.customActions; + } + + /** + * Set the customActions property: A list of custom actions that can be performed with this Gallery Application + * Version. + * + * @param customActions the customActions value to set. + * @return the GalleryApplicationVersionPublishingProfile object itself. + */ + public GalleryApplicationVersionPublishingProfile withCustomActions( + List customActions) { + this.customActions = customActions; + 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; + } + + /** {@inheritDoc} */ + @Override + public GalleryApplicationVersionPublishingProfile withReplicationMode(ReplicationMode replicationMode) { + super.withReplicationMode(replicationMode); + return this; + } + + /** {@inheritDoc} */ + @Override + public GalleryApplicationVersionPublishingProfile withTargetExtendedLocations( + List targetExtendedLocations) { + super.withTargetExtendedLocations(targetExtendedLocations); + 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(); + } + if (settings() != null) { + settings().validate(); + } + if (customActions() != null) { + customActions().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GalleryApplicationVersionPublishingProfile.class); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryApplicationVersionSafetyProfile.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryApplicationVersionSafetyProfile.java new file mode 100644 index 0000000000000..97bdaa3f79fcb --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryApplicationVersionSafetyProfile.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; + +/** The safety profile of the Gallery Application Version. */ +@Fluent +public final class GalleryApplicationVersionSafetyProfile extends GalleryArtifactSafetyProfileBase { + /** Creates an instance of GalleryApplicationVersionSafetyProfile class. */ + public GalleryApplicationVersionSafetyProfile() { + } + + /** {@inheritDoc} */ + @Override + public GalleryApplicationVersionSafetyProfile withAllowDeletionOfReplicatedLocations( + Boolean allowDeletionOfReplicatedLocations) { + super.withAllowDeletionOfReplicatedLocations(allowDeletionOfReplicatedLocations); + 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/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..73648dc205888 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryApplicationVersionUpdate.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.resourcemanager.compute.generated.fluent.models.GalleryApplicationVersionProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Specifies information about the gallery Application Version that you want to update. */ +@Fluent +public final class GalleryApplicationVersionUpdate extends UpdateResourceDefinition { + /* + * Describes the properties of a gallery image version. + */ + @JsonProperty(value = "properties") + private GalleryApplicationVersionProperties innerProperties; + + /** Creates an instance of GalleryApplicationVersionUpdate class. */ + public GalleryApplicationVersionUpdate() { + } + + /** + * Get the innerProperties property: Describes the properties of a gallery image version. + * + * @return the innerProperties value. + */ + private GalleryApplicationVersionProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public GalleryApplicationVersionUpdate withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the publishingProfile property: The publishing profile of a gallery image version. + * + * @return the publishingProfile value. + */ + public GalleryApplicationVersionPublishingProfile publishingProfile() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryApplicationVersionProperties(); + } + this.innerProperties().withPublishingProfile(publishingProfile); + return this; + } + + /** + * Get the safetyProfile property: The safety profile of the Gallery Application Version. + * + * @return the safetyProfile value. + */ + public GalleryApplicationVersionSafetyProfile safetyProfile() { + return this.innerProperties() == null ? null : this.innerProperties().safetyProfile(); + } + + /** + * Set the safetyProfile property: The safety profile of the Gallery Application Version. + * + * @param safetyProfile the safetyProfile value to set. + * @return the GalleryApplicationVersionUpdate object itself. + */ + public GalleryApplicationVersionUpdate withSafetyProfile(GalleryApplicationVersionSafetyProfile safetyProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryApplicationVersionProperties(); + } + this.innerProperties().withSafetyProfile(safetyProfile); + return this; + } + + /** + * Get the provisioningState property: The current state of the gallery or gallery artifact. + * + *

The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + public GalleryProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the replicationStatus property: This is the replication status of the gallery image version. + * + * @return the replicationStatus value. + */ + public ReplicationStatus replicationStatus() { + return this.innerProperties() == null ? null : this.innerProperties().replicationStatus(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().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..676da479c07dc --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryApplicationVersions.java @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.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. + * @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 along with + * {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + ReplicationStatusTypes expand, + 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. + */ + GalleryApplicationVersion get( + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 along with + * {@link Response}. + */ + 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 along with + * {@link Response}. + */ + 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..b869c30abda0e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryApplications.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.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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request 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 along + * with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String galleryName, String galleryApplicationName, 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. + */ + GalleryApplication get(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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 along + * with {@link Response}. + */ + 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 along + * with {@link Response}. + */ + 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..2f1901da892c8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryArtifactPublishingProfileBase.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.models; + +import com.azure.core.annotation.Fluent; +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 { + /* + * 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; + + /* + * Optional parameter which specifies the mode to be used for replication. This property is not updatable. + */ + @JsonProperty(value = "replicationMode") + private ReplicationMode replicationMode; + + /* + * The target extended locations where the Image Version is going to be replicated to. This property is updatable. + */ + @JsonProperty(value = "targetExtendedLocations") + private List targetExtendedLocations; + + /** Creates an instance of GalleryArtifactPublishingProfileBase class. */ + public GalleryArtifactPublishingProfileBase() { + } + + /** + * 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; + } + + /** + * Get the replicationMode property: Optional parameter which specifies the mode to be used for replication. This + * property is not updatable. + * + * @return the replicationMode value. + */ + public ReplicationMode replicationMode() { + return this.replicationMode; + } + + /** + * Set the replicationMode property: Optional parameter which specifies the mode to be used for replication. This + * property is not updatable. + * + * @param replicationMode the replicationMode value to set. + * @return the GalleryArtifactPublishingProfileBase object itself. + */ + public GalleryArtifactPublishingProfileBase withReplicationMode(ReplicationMode replicationMode) { + this.replicationMode = replicationMode; + return this; + } + + /** + * Get the targetExtendedLocations property: The target extended locations where the Image Version is going to be + * replicated to. This property is updatable. + * + * @return the targetExtendedLocations value. + */ + public List targetExtendedLocations() { + return this.targetExtendedLocations; + } + + /** + * Set the targetExtendedLocations property: The target extended locations where the Image Version is going to be + * replicated to. This property is updatable. + * + * @param targetExtendedLocations the targetExtendedLocations value to set. + * @return the GalleryArtifactPublishingProfileBase object itself. + */ + public GalleryArtifactPublishingProfileBase withTargetExtendedLocations( + List targetExtendedLocations) { + this.targetExtendedLocations = targetExtendedLocations; + 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()); + } + if (targetExtendedLocations() != null) { + targetExtendedLocations().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryArtifactSafetyProfileBase.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryArtifactSafetyProfileBase.java new file mode 100644 index 0000000000000..313330a8d4572 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryArtifactSafetyProfileBase.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.fasterxml.jackson.annotation.JsonProperty; + +/** This is the safety profile of the Gallery Artifact Version. */ +@Fluent +public class GalleryArtifactSafetyProfileBase { + /* + * Indicates whether or not removing this Gallery Image Version from replicated regions is allowed. + */ + @JsonProperty(value = "allowDeletionOfReplicatedLocations") + private Boolean allowDeletionOfReplicatedLocations; + + /** Creates an instance of GalleryArtifactSafetyProfileBase class. */ + public GalleryArtifactSafetyProfileBase() { + } + + /** + * Get the allowDeletionOfReplicatedLocations property: Indicates whether or not removing this Gallery Image Version + * from replicated regions is allowed. + * + * @return the allowDeletionOfReplicatedLocations value. + */ + public Boolean allowDeletionOfReplicatedLocations() { + return this.allowDeletionOfReplicatedLocations; + } + + /** + * Set the allowDeletionOfReplicatedLocations property: Indicates whether or not removing this Gallery Image Version + * from replicated regions is allowed. + * + * @param allowDeletionOfReplicatedLocations the allowDeletionOfReplicatedLocations value to set. + * @return the GalleryArtifactSafetyProfileBase object itself. + */ + public GalleryArtifactSafetyProfileBase withAllowDeletionOfReplicatedLocations( + Boolean allowDeletionOfReplicatedLocations) { + this.allowDeletionOfReplicatedLocations = allowDeletionOfReplicatedLocations; + 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/GalleryArtifactVersionFullSource.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryArtifactVersionFullSource.java new file mode 100644 index 0000000000000..226fd23fc7b2c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryArtifactVersionFullSource.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.fasterxml.jackson.annotation.JsonProperty; + +/** The source of the gallery artifact version. */ +@Fluent +public final class GalleryArtifactVersionFullSource extends GalleryArtifactVersionSource { + /* + * The resource Id of the source Community Gallery Image. Only required when using Community Gallery Image as a + * source. + */ + @JsonProperty(value = "communityGalleryImageId") + private String communityGalleryImageId; + + /** Creates an instance of GalleryArtifactVersionFullSource class. */ + public GalleryArtifactVersionFullSource() { + } + + /** + * Get the communityGalleryImageId property: The resource Id of the source Community Gallery Image. Only required + * when using Community Gallery Image as a source. + * + * @return the communityGalleryImageId value. + */ + public String communityGalleryImageId() { + return this.communityGalleryImageId; + } + + /** + * Set the communityGalleryImageId property: The resource Id of the source Community Gallery Image. Only required + * when using Community Gallery Image as a source. + * + * @param communityGalleryImageId the communityGalleryImageId value to set. + * @return the GalleryArtifactVersionFullSource object itself. + */ + public GalleryArtifactVersionFullSource withCommunityGalleryImageId(String communityGalleryImageId) { + this.communityGalleryImageId = communityGalleryImageId; + return this; + } + + /** {@inheritDoc} */ + @Override + public GalleryArtifactVersionFullSource 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(); + } +} 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..aa4b0e63b61fe --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryArtifactVersionSource.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.fasterxml.jackson.annotation.JsonProperty; + +/** The gallery artifact version source. */ +@Fluent +public class GalleryArtifactVersionSource { + /* + * 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; + + /** Creates an instance of GalleryArtifactVersionSource class. */ + public GalleryArtifactVersionSource() { + } + + /** + * 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; + } + + /** + * 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..ca2b8a2fab164 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryDataDiskImage.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** This is the data disk image. */ +@Fluent +public final class GalleryDataDiskImage extends GalleryDiskImage { + /* + * 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; + + /** Creates an instance of GalleryDataDiskImage class. */ + public GalleryDataDiskImage() { + } + + /** + * 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(GalleryDiskImageSource 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..cf4af29591597 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryDiskImage.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.fasterxml.jackson.annotation.JsonProperty; + +/** This is the disk image base class. */ +@Fluent +public class GalleryDiskImage { + /* + * 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 source for the disk image. + */ + @JsonProperty(value = "source") + private GalleryDiskImageSource source; + + /** Creates an instance of GalleryDiskImage class. */ + public GalleryDiskImage() { + } + + /** + * 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 source for the disk image. + * + * @return the source value. + */ + public GalleryDiskImageSource source() { + return this.source; + } + + /** + * Set the source property: The source for the disk image. + * + * @param source the source value to set. + * @return the GalleryDiskImage object itself. + */ + public GalleryDiskImage withSource(GalleryDiskImageSource 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/GalleryDiskImageSource.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryDiskImageSource.java new file mode 100644 index 0000000000000..48bbf51fd40b2 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryDiskImageSource.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.fasterxml.jackson.annotation.JsonProperty; + +/** The source for the disk image. */ +@Fluent +public final class GalleryDiskImageSource extends GalleryArtifactVersionSource { + /* + * The uri of the gallery artifact version source. Currently used to specify vhd/blob source. + */ + @JsonProperty(value = "uri") + private String uri; + + /* + * The Storage Account Id that contains the vhd blob being used as a source for this artifact version. + */ + @JsonProperty(value = "storageAccountId") + private String storageAccountId; + + /** Creates an instance of GalleryDiskImageSource class. */ + public GalleryDiskImageSource() { + } + + /** + * 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 GalleryDiskImageSource object itself. + */ + public GalleryDiskImageSource withUri(String uri) { + this.uri = uri; + return this; + } + + /** + * Get the storageAccountId property: The Storage Account Id that contains the vhd blob being used as a source for + * this artifact version. + * + * @return the storageAccountId value. + */ + public String storageAccountId() { + return this.storageAccountId; + } + + /** + * Set the storageAccountId property: The Storage Account Id that contains the vhd blob being used as a source for + * this artifact version. + * + * @param storageAccountId the storageAccountId value to set. + * @return the GalleryDiskImageSource object itself. + */ + public GalleryDiskImageSource withStorageAccountId(String storageAccountId) { + this.storageAccountId = storageAccountId; + return this; + } + + /** {@inheritDoc} */ + @Override + public GalleryDiskImageSource 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(); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryExpandParams.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryExpandParams.java new file mode 100644 index 0000000000000..71ab4bc47de9f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryExpandParams.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for GalleryExpandParams. */ +public final class GalleryExpandParams extends ExpandableStringEnum { + /** Static value SharingProfile/Groups for GalleryExpandParams. */ + public static final GalleryExpandParams SHARING_PROFILE_GROUPS = fromString("SharingProfile/Groups"); + + /** + * Creates a new instance of GalleryExpandParams value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public GalleryExpandParams() { + } + + /** + * Creates or finds a GalleryExpandParams from its string representation. + * + * @param name a name to look for. + * @return the corresponding GalleryExpandParams. + */ + @JsonCreator + public static GalleryExpandParams fromString(String name) { + return fromString(name, GalleryExpandParams.class); + } + + /** + * Gets known GalleryExpandParams values. + * + * @return known GalleryExpandParams values. + */ + public static Collection values() { + return values(GalleryExpandParams.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryExtendedLocation.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryExtendedLocation.java new file mode 100644 index 0000000000000..220e68fa58235 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryExtendedLocation.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.fasterxml.jackson.annotation.JsonProperty; + +/** The name of the extended location. */ +@Fluent +public final class GalleryExtendedLocation { + /* + * The name property. + */ + @JsonProperty(value = "name") + private String name; + + /* + * It is type of the extended location. + */ + @JsonProperty(value = "type") + private GalleryExtendedLocationType type; + + /** Creates an instance of GalleryExtendedLocation class. */ + public GalleryExtendedLocation() { + } + + /** + * Get the name property: The name property. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name property. + * + * @param name the name value to set. + * @return the GalleryExtendedLocation object itself. + */ + public GalleryExtendedLocation withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: It is type of the extended location. + * + * @return the type value. + */ + public GalleryExtendedLocationType type() { + return this.type; + } + + /** + * Set the type property: It is type of the extended location. + * + * @param type the type value to set. + * @return the GalleryExtendedLocation object itself. + */ + public GalleryExtendedLocation withType(GalleryExtendedLocationType 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/GalleryExtendedLocationType.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryExtendedLocationType.java new file mode 100644 index 0000000000000..ac22f403b55ec --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryExtendedLocationType.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; + +/** It is type of the extended location. */ +public final class GalleryExtendedLocationType extends ExpandableStringEnum { + /** Static value EdgeZone for GalleryExtendedLocationType. */ + public static final GalleryExtendedLocationType EDGE_ZONE = fromString("EdgeZone"); + + /** Static value Unknown for GalleryExtendedLocationType. */ + public static final GalleryExtendedLocationType UNKNOWN = fromString("Unknown"); + + /** + * Creates a new instance of GalleryExtendedLocationType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public GalleryExtendedLocationType() { + } + + /** + * Creates or finds a GalleryExtendedLocationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding GalleryExtendedLocationType. + */ + @JsonCreator + public static GalleryExtendedLocationType fromString(String name) { + return fromString(name, GalleryExtendedLocationType.class); + } + + /** + * Gets known GalleryExtendedLocationType values. + * + * @return known GalleryExtendedLocationType values. + */ + public static Collection values() { + return values(GalleryExtendedLocationType.class); + } +} 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..80ab4cc7c5cf3 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryIdentifier.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.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the gallery unique name. */ +@Immutable +public final class GalleryIdentifier { + /* + * 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; + + /** Creates an instance of GalleryIdentifier class. */ + public GalleryIdentifier() { + } + + /** + * 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..86f3ab989308c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryImage.java @@ -0,0 +1,655 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 current state of the gallery or gallery artifact. + * + *

The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + GalleryProvisioningState provisioningState(); + + /** + * Gets the features property: A list of gallery image features. + * + * @return the features value. + */ + List features(); + + /** + * Gets the architecture property: The architecture of the image. Applicable to OS disks only. + * + * @return the architecture value. + */ + Architecture architecture(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.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, + DefinitionStages.WithArchitecture { + /** + * 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); + } + /** The stage of the GalleryImage definition allowing to specify architecture. */ + interface WithArchitecture { + /** + * Specifies the architecture property: The architecture of the image. Applicable to OS disks only.. + * + * @param architecture The architecture of the image. Applicable to OS disks only. + * @return the next definition stage. + */ + WithCreate withArchitecture(Architecture architecture); + } + } + /** + * 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, + UpdateStages.WithArchitecture { + /** + * 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); + } + /** The stage of the GalleryImage update allowing to specify architecture. */ + interface WithArchitecture { + /** + * Specifies the architecture property: The architecture of the image. Applicable to OS disks only.. + * + * @param architecture The architecture of the image. Applicable to OS disks only. + * @return the next definition stage. + */ + Update withArchitecture(Architecture architecture); + } + } + /** + * 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..765da2aaaab3c --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** A feature for gallery image. */ +@Fluent +public final class GalleryImageFeature { + /* + * 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; + + /** Creates an instance of GalleryImageFeature class. */ + public GalleryImageFeature() { + } + + /** + * 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..b360d124e044a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryImageIdentifier.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** This is the gallery image definition identifier. */ +@Fluent +public final class GalleryImageIdentifier { + /* + * 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; + + /** Creates an instance of GalleryImageIdentifier class. */ + public GalleryImageIdentifier() { + } + + /** + * 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")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GalleryImageIdentifier.class); +} 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..aaa3691306035 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryImageList.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.azure.resourcemanager.compute.generated.fluent.models.GalleryImageInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List Gallery Images operation response. */ +@Fluent +public final class GalleryImageList { + /* + * 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; + + /** Creates an instance of GalleryImageList class. */ + public GalleryImageList() { + } + + /** + * 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()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GalleryImageList.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..0019454741e2e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryImageUpdate.java @@ -0,0 +1,402 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.compute.generated.fluent.models.GalleryImageProperties; +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. */ +@Fluent +public final class GalleryImageUpdate extends UpdateResourceDefinition { + /* + * Describes the properties of a gallery image definition. + */ + @JsonProperty(value = "properties") + private GalleryImageProperties innerProperties; + + /** Creates an instance of GalleryImageUpdate class. */ + public GalleryImageUpdate() { + } + + /** + * Get the innerProperties property: Describes the properties of a gallery image definition. + * + * @return the innerProperties value. + */ + private GalleryImageProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public GalleryImageUpdate withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryImageProperties(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the eula property: The Eula agreement for the gallery image definition. + * + * @return the eula value. + */ + public String eula() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryImageProperties(); + } + this.innerProperties().withEula(eula); + return this; + } + + /** + * Get the privacyStatementUri property: The privacy statement uri. + * + * @return the privacyStatementUri value. + */ + public String privacyStatementUri() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryImageProperties(); + } + this.innerProperties().withPrivacyStatementUri(privacyStatementUri); + return this; + } + + /** + * Get the releaseNoteUri property: The release note uri. + * + * @return the releaseNoteUri value. + */ + public String releaseNoteUri() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryImageProperties(); + } + this.innerProperties().withReleaseNoteUri(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryImageProperties(); + } + this.innerProperties().withOsType(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryImageProperties(); + } + this.innerProperties().withOsState(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryImageProperties(); + } + this.innerProperties().withHyperVGeneration(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryImageProperties(); + } + this.innerProperties().withEndOfLifeDate(endOfLifeDate); + return this; + } + + /** + * Get the identifier property: This is the gallery image definition identifier. + * + * @return the identifier value. + */ + public GalleryImageIdentifier identifier() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryImageProperties(); + } + this.innerProperties().withIdentifier(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryImageProperties(); + } + this.innerProperties().withRecommended(recommended); + return this; + } + + /** + * Get the disallowed property: Describes the disallowed disk types. + * + * @return the disallowed value. + */ + public Disallowed disallowed() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryImageProperties(); + } + this.innerProperties().withDisallowed(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryImageProperties(); + } + this.innerProperties().withPurchasePlan(purchasePlan); + return this; + } + + /** + * Get the provisioningState property: The current state of the gallery or gallery artifact. + * + *

The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + public GalleryProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the features property: A list of gallery image features. + * + * @return the features value. + */ + public List features() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryImageProperties(); + } + this.innerProperties().withFeatures(features); + return this; + } + + /** + * Get the architecture property: The architecture of the image. Applicable to OS disks only. + * + * @return the architecture value. + */ + public Architecture architecture() { + return this.innerProperties() == null ? null : this.innerProperties().architecture(); + } + + /** + * Set the architecture property: The architecture of the image. Applicable to OS disks only. + * + * @param architecture the architecture value to set. + * @return the GalleryImageUpdate object itself. + */ + public GalleryImageUpdate withArchitecture(Architecture architecture) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryImageProperties(); + } + this.innerProperties().withArchitecture(architecture); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().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..18b4e9b7e6384 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryImageVersion.java @@ -0,0 +1,307 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 current state of the gallery or gallery artifact. + * + *

The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + GalleryProvisioningState provisioningState(); + + /** + * Gets the storageProfile property: This is the storage profile of a Gallery Image Version. + * + * @return the storageProfile value. + */ + GalleryImageVersionStorageProfile storageProfile(); + + /** + * Gets the safetyProfile property: This is the safety profile of the Gallery Image Version. + * + * @return the safetyProfile value. + */ + GalleryImageVersionSafetyProfile safetyProfile(); + + /** + * 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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * 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, + DefinitionStages.WithSafetyProfile { + /** + * 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); + } + /** The stage of the GalleryImageVersion definition allowing to specify safetyProfile. */ + interface WithSafetyProfile { + /** + * Specifies the safetyProfile property: This is the safety profile of the Gallery Image Version.. + * + * @param safetyProfile This is the safety profile of the Gallery Image Version. + * @return the next definition stage. + */ + WithCreate withSafetyProfile(GalleryImageVersionSafetyProfile safetyProfile); + } + } + /** + * 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, + UpdateStages.WithSafetyProfile { + /** + * 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); + } + /** The stage of the GalleryImageVersion update allowing to specify safetyProfile. */ + interface WithSafetyProfile { + /** + * Specifies the safetyProfile property: This is the safety profile of the Gallery Image Version.. + * + * @param safetyProfile This is the safety profile of the Gallery Image Version. + * @return the next definition stage. + */ + Update withSafetyProfile(GalleryImageVersionSafetyProfile safetyProfile); + } + } + /** + * 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..852de6c7c855c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryImageVersionList.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.azure.resourcemanager.compute.generated.fluent.models.GalleryImageVersionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List Gallery Image version operation response. */ +@Fluent +public final class GalleryImageVersionList { + /* + * 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; + + /** Creates an instance of GalleryImageVersionList class. */ + public GalleryImageVersionList() { + } + + /** + * 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()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GalleryImageVersionList.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..d8ed66ba445b1 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryImageVersionPublishingProfile.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import java.time.OffsetDateTime; +import java.util.List; + +/** The publishing profile of a gallery image Version. */ +@Fluent +public final class GalleryImageVersionPublishingProfile extends GalleryArtifactPublishingProfileBase { + /** Creates an instance of GalleryImageVersionPublishingProfile class. */ + public GalleryImageVersionPublishingProfile() { + } + + /** {@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; + } + + /** {@inheritDoc} */ + @Override + public GalleryImageVersionPublishingProfile withReplicationMode(ReplicationMode replicationMode) { + super.withReplicationMode(replicationMode); + return this; + } + + /** {@inheritDoc} */ + @Override + public GalleryImageVersionPublishingProfile withTargetExtendedLocations( + List targetExtendedLocations) { + super.withTargetExtendedLocations(targetExtendedLocations); + 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/GalleryImageVersionSafetyProfile.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryImageVersionSafetyProfile.java new file mode 100644 index 0000000000000..db5b5351aba20 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryImageVersionSafetyProfile.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.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** This is the safety profile of the Gallery Image Version. */ +@Fluent +public final class GalleryImageVersionSafetyProfile extends GalleryArtifactSafetyProfileBase { + /* + * Indicates whether this image has been reported as violating Microsoft's policies. + */ + @JsonProperty(value = "reportedForPolicyViolation", access = JsonProperty.Access.WRITE_ONLY) + private Boolean reportedForPolicyViolation; + + /* + * A list of Policy Violations that have been reported for this Gallery Image Version. + */ + @JsonProperty(value = "policyViolations", access = JsonProperty.Access.WRITE_ONLY) + private List policyViolations; + + /** Creates an instance of GalleryImageVersionSafetyProfile class. */ + public GalleryImageVersionSafetyProfile() { + } + + /** + * Get the reportedForPolicyViolation property: Indicates whether this image has been reported as violating + * Microsoft's policies. + * + * @return the reportedForPolicyViolation value. + */ + public Boolean reportedForPolicyViolation() { + return this.reportedForPolicyViolation; + } + + /** + * Get the policyViolations property: A list of Policy Violations that have been reported for this Gallery Image + * Version. + * + * @return the policyViolations value. + */ + public List policyViolations() { + return this.policyViolations; + } + + /** {@inheritDoc} */ + @Override + public GalleryImageVersionSafetyProfile withAllowDeletionOfReplicatedLocations( + Boolean allowDeletionOfReplicatedLocations) { + super.withAllowDeletionOfReplicatedLocations(allowDeletionOfReplicatedLocations); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (policyViolations() != null) { + policyViolations().forEach(e -> e.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..870d5e3680623 --- /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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** This is the storage profile of a Gallery Image Version. */ +@Fluent +public final class GalleryImageVersionStorageProfile { + /* + * The source of the gallery artifact version. + */ + @JsonProperty(value = "source") + private GalleryArtifactVersionFullSource 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; + + /** Creates an instance of GalleryImageVersionStorageProfile class. */ + public GalleryImageVersionStorageProfile() { + } + + /** + * Get the source property: The source of the gallery artifact version. + * + * @return the source value. + */ + public GalleryArtifactVersionFullSource source() { + return this.source; + } + + /** + * Set the source property: The source of the gallery artifact version. + * + * @param source the source value to set. + * @return the GalleryImageVersionStorageProfile object itself. + */ + public GalleryImageVersionStorageProfile withSource(GalleryArtifactVersionFullSource 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..d6e965a3590c1 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryImageVersionUpdate.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.compute.generated.fluent.models.GalleryImageVersionProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Specifies information about the gallery image version that you want to update. */ +@Fluent +public final class GalleryImageVersionUpdate extends UpdateResourceDefinition { + /* + * Describes the properties of a gallery image version. + */ + @JsonProperty(value = "properties") + private GalleryImageVersionProperties innerProperties; + + /** Creates an instance of GalleryImageVersionUpdate class. */ + public GalleryImageVersionUpdate() { + } + + /** + * Get the innerProperties property: Describes the properties of a gallery image version. + * + * @return the innerProperties value. + */ + private GalleryImageVersionProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public GalleryImageVersionUpdate withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the publishingProfile property: The publishing profile of a gallery image Version. + * + * @return the publishingProfile value. + */ + public GalleryImageVersionPublishingProfile publishingProfile() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryImageVersionProperties(); + } + this.innerProperties().withPublishingProfile(publishingProfile); + return this; + } + + /** + * Get the provisioningState property: The current state of the gallery or gallery artifact. + * + *

The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + public GalleryProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the storageProfile property: This is the storage profile of a Gallery Image Version. + * + * @return the storageProfile value. + */ + public GalleryImageVersionStorageProfile storageProfile() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryImageVersionProperties(); + } + this.innerProperties().withStorageProfile(storageProfile); + return this; + } + + /** + * Get the safetyProfile property: This is the safety profile of the Gallery Image Version. + * + * @return the safetyProfile value. + */ + public GalleryImageVersionSafetyProfile safetyProfile() { + return this.innerProperties() == null ? null : this.innerProperties().safetyProfile(); + } + + /** + * Set the safetyProfile property: This is the safety profile of the Gallery Image Version. + * + * @param safetyProfile the safetyProfile value to set. + * @return the GalleryImageVersionUpdate object itself. + */ + public GalleryImageVersionUpdate withSafetyProfile(GalleryImageVersionSafetyProfile safetyProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryImageVersionProperties(); + } + this.innerProperties().withSafetyProfile(safetyProfile); + 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.innerProperties() == null ? null : this.innerProperties().replicationStatus(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().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..59928a69e1302 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryImageVersions.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.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. + * @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 along with {@link + * Response}. + */ + Response getWithResponse( + String resourceGroupName, + String galleryName, + String galleryImageName, + String galleryImageVersionName, + ReplicationStatusTypes expand, + 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. + */ + GalleryImageVersion get( + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 along with {@link + * Response}. + */ + 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 along with {@link + * Response}. + */ + 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..2ecd291e2094a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryImages.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.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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request 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 along with + * {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String galleryName, String galleryImageName, 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. + */ + GalleryImage get(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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 along with + * {@link Response}. + */ + 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 along with + * {@link Response}. + */ + 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..45c5baac7a80b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryList.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.GalleryInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List Galleries operation response. */ +@Fluent +public final class GalleryList { + /* + * 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; + + /** Creates an instance of GalleryList class. */ + public GalleryList() { + } + + /** + * 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()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GalleryList.class); +} 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..756ea87565f5f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryOSDiskImage.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; + +/** This is the OS disk image. */ +@Fluent +public final class GalleryOSDiskImage extends GalleryDiskImage { + /** Creates an instance of GalleryOSDiskImage class. */ + public GalleryOSDiskImage() { + } + + /** {@inheritDoc} */ + @Override + public GalleryOSDiskImage withHostCaching(HostCaching hostCaching) { + super.withHostCaching(hostCaching); + return this; + } + + /** {@inheritDoc} */ + @Override + public GalleryOSDiskImage withSource(GalleryDiskImageSource 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/GalleryProvisioningState.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryProvisioningState.java new file mode 100644 index 0000000000000..f4c1f356e1c04 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryProvisioningState.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * The current state of the gallery or gallery artifact. + * + *

The provisioning state, which only appears in the response. + */ +public final class GalleryProvisioningState extends ExpandableStringEnum { + /** Static value Creating for GalleryProvisioningState. */ + public static final GalleryProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for GalleryProvisioningState. */ + public static final GalleryProvisioningState UPDATING = fromString("Updating"); + + /** Static value Failed for GalleryProvisioningState. */ + public static final GalleryProvisioningState FAILED = fromString("Failed"); + + /** Static value Succeeded for GalleryProvisioningState. */ + public static final GalleryProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Deleting for GalleryProvisioningState. */ + public static final GalleryProvisioningState DELETING = fromString("Deleting"); + + /** Static value Migrating for GalleryProvisioningState. */ + public static final GalleryProvisioningState MIGRATING = fromString("Migrating"); + + /** + * Creates a new instance of GalleryProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public GalleryProvisioningState() { + } + + /** + * Creates or finds a GalleryProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding GalleryProvisioningState. + */ + @JsonCreator + public static GalleryProvisioningState fromString(String name) { + return fromString(name, GalleryProvisioningState.class); + } + + /** + * Gets known GalleryProvisioningState values. + * + * @return known GalleryProvisioningState values. + */ + public static Collection values() { + return values(GalleryProvisioningState.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..7fdf3ef9cf91c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GallerySharingPermissionTypes.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * This property allows you to specify the permission of sharing gallery. <br><br> Possible values are: + * <br><br> **Private** <br><br> **Groups** <br><br> **Community**. + */ +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"); + + /** Static value Community for GallerySharingPermissionTypes. */ + public static final GallerySharingPermissionTypes COMMUNITY = fromString("Community"); + + /** + * Creates a new instance of GallerySharingPermissionTypes value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public GallerySharingPermissionTypes() { + } + + /** + * 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); + } + + /** + * Gets known GallerySharingPermissionTypes values. + * + * @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/GalleryTargetExtendedLocation.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryTargetExtendedLocation.java new file mode 100644 index 0000000000000..7fb54c64e0601 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryTargetExtendedLocation.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.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The GalleryTargetExtendedLocation model. */ +@Fluent +public final class GalleryTargetExtendedLocation { + /* + * The name of the region. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The name of the extended location. + */ + @JsonProperty(value = "extendedLocation") + private GalleryExtendedLocation extendedLocation; + + /* + * The number of replicas of the Image Version to be created per extended location. This property is updatable. + */ + @JsonProperty(value = "extendedLocationReplicaCount") + private Integer extendedLocationReplicaCount; + + /* + * 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; + + /** Creates an instance of GalleryTargetExtendedLocation class. */ + public GalleryTargetExtendedLocation() { + } + + /** + * 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 GalleryTargetExtendedLocation object itself. + */ + public GalleryTargetExtendedLocation withName(String name) { + this.name = name; + return this; + } + + /** + * Get the extendedLocation property: The name of the extended location. + * + * @return the extendedLocation value. + */ + public GalleryExtendedLocation extendedLocation() { + return this.extendedLocation; + } + + /** + * Set the extendedLocation property: The name of the extended location. + * + * @param extendedLocation the extendedLocation value to set. + * @return the GalleryTargetExtendedLocation object itself. + */ + public GalleryTargetExtendedLocation withExtendedLocation(GalleryExtendedLocation extendedLocation) { + this.extendedLocation = extendedLocation; + return this; + } + + /** + * Get the extendedLocationReplicaCount property: The number of replicas of the Image Version to be created per + * extended location. This property is updatable. + * + * @return the extendedLocationReplicaCount value. + */ + public Integer extendedLocationReplicaCount() { + return this.extendedLocationReplicaCount; + } + + /** + * Set the extendedLocationReplicaCount property: The number of replicas of the Image Version to be created per + * extended location. This property is updatable. + * + * @param extendedLocationReplicaCount the extendedLocationReplicaCount value to set. + * @return the GalleryTargetExtendedLocation object itself. + */ + public GalleryTargetExtendedLocation withExtendedLocationReplicaCount(Integer extendedLocationReplicaCount) { + this.extendedLocationReplicaCount = extendedLocationReplicaCount; + 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 GalleryTargetExtendedLocation object itself. + */ + public GalleryTargetExtendedLocation 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 GalleryTargetExtendedLocation object itself. + */ + public GalleryTargetExtendedLocation withEncryption(EncryptionImages encryption) { + this.encryption = encryption; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (extendedLocation() != null) { + extendedLocation().validate(); + } + if (encryption() != null) { + encryption().validate(); + } + } +} 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..8b8574b25053d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryUpdate.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.compute.generated.fluent.models.GalleryProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Specifies information about the Shared Image Gallery that you want to update. */ +@Fluent +public final class GalleryUpdate extends UpdateResourceDefinition { + /* + * Describes the properties of a Shared Image Gallery. + */ + @JsonProperty(value = "properties") + private GalleryProperties innerProperties; + + /** Creates an instance of GalleryUpdate class. */ + public GalleryUpdate() { + } + + /** + * Get the innerProperties property: Describes the properties of a Shared Image Gallery. + * + * @return the innerProperties value. + */ + private GalleryProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public GalleryUpdate withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryProperties(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the identifier property: Describes the gallery unique name. + * + * @return the identifier value. + */ + public GalleryIdentifier identifier() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryProperties(); + } + this.innerProperties().withIdentifier(identifier); + return this; + } + + /** + * Get the provisioningState property: The current state of the gallery or gallery artifact. + * + *

The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + public GalleryProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the sharingProfile property: Profile for gallery sharing to subscription or tenant. + * + * @return the sharingProfile value. + */ + public SharingProfile sharingProfile() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryProperties(); + } + this.innerProperties().withSharingProfile(sharingProfile); + return this; + } + + /** + * Get the softDeletePolicy property: Contains information about the soft deletion policy of the gallery. + * + * @return the softDeletePolicy value. + */ + public SoftDeletePolicy softDeletePolicy() { + return this.innerProperties() == null ? null : this.innerProperties().softDeletePolicy(); + } + + /** + * Set the softDeletePolicy property: Contains information about the soft deletion policy of the gallery. + * + * @param softDeletePolicy the softDeletePolicy value to set. + * @return the GalleryUpdate object itself. + */ + public GalleryUpdate withSoftDeletePolicy(SoftDeletePolicy softDeletePolicy) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryProperties(); + } + this.innerProperties().withSoftDeletePolicy(softDeletePolicy); + return this; + } + + /** + * Get the sharingStatus property: Sharing status of current gallery. + * + * @return the sharingStatus value. + */ + public SharingStatus sharingStatus() { + return this.innerProperties() == null ? null : this.innerProperties().sharingStatus(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().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..0a313aedab86f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GrantAccessData.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.JsonProperty; + +/** Data used for requesting a SAS. */ +@Fluent +public final class GrantAccessData { + /* + * 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; + + /* + * Set this flag to true to get additional SAS for VM guest state + */ + @JsonProperty(value = "getSecureVMGuestStateSAS") + private Boolean getSecureVMGuestStateSas; + + /** Creates an instance of GrantAccessData class. */ + public GrantAccessData() { + } + + /** + * 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; + } + + /** + * Get the getSecureVMGuestStateSas property: Set this flag to true to get additional SAS for VM guest state. + * + * @return the getSecureVMGuestStateSas value. + */ + public Boolean getSecureVMGuestStateSas() { + return this.getSecureVMGuestStateSas; + } + + /** + * Set the getSecureVMGuestStateSas property: Set this flag to true to get additional SAS for VM guest state. + * + * @param getSecureVMGuestStateSas the getSecureVMGuestStateSas value to set. + * @return the GrantAccessData object itself. + */ + public GrantAccessData withGetSecureVMGuestStateSas(Boolean getSecureVMGuestStateSas) { + this.getSecureVMGuestStateSas = getSecureVMGuestStateSas; + 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")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GrantAccessData.class); +} 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..7a8a1d92cc31e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/HardwareProfile.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.fasterxml.jackson.annotation.JsonProperty; + +/** Specifies the hardware settings for the virtual machine. */ +@Fluent +public final class HardwareProfile { + /* + * Specifies the size of the virtual machine. The enum data type is currently deprecated and will be removed by + * December 23rd 2023. The recommended way to get the list of available sizes is using these APIs: [List all + * available virtual machine sizes in an availability + * set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes), [List all available + * virtual machine sizes in a region]( https://docs.microsoft.com/rest/api/compute/resourceskus/list), [List all + * available virtual machine sizes for + * resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). For more information + * about virtual machine sizes, see [Sizes for virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/sizes). The available VM sizes depend on region and + * availability set. + */ + @JsonProperty(value = "vmSize") + private VirtualMachineSizeTypes vmSize; + + /* + * Specifies the properties for customizing the size of the virtual machine. Minimum api-version: 2021-07-01. This + * feature is still in preview mode and is not supported for VirtualMachineScaleSet. Please follow the instructions + * in [VM Customization](https://aka.ms/vmcustomization) for more details. + */ + @JsonProperty(value = "vmSizeProperties") + private VMSizeProperties vmSizeProperties; + + /** Creates an instance of HardwareProfile class. */ + public HardwareProfile() { + } + + /** + * Get the vmSize property: Specifies the size of the virtual machine. The enum data type is currently deprecated + * and will be removed by December 23rd 2023. The recommended way to get the list of available sizes is using these + * APIs: [List all available virtual machine sizes in an availability + * set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes), [List all available + * virtual machine sizes in a region]( https://docs.microsoft.com/rest/api/compute/resourceskus/list), [List all + * available virtual machine sizes for + * resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). For more information + * about virtual machine sizes, see [Sizes for virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/sizes). The available VM sizes depend on region and + * availability set. + * + * @return the vmSize value. + */ + public VirtualMachineSizeTypes vmSize() { + return this.vmSize; + } + + /** + * Set the vmSize property: Specifies the size of the virtual machine. The enum data type is currently deprecated + * and will be removed by December 23rd 2023. The recommended way to get the list of available sizes is using these + * APIs: [List all available virtual machine sizes in an availability + * set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes), [List all available + * virtual machine sizes in a region]( https://docs.microsoft.com/rest/api/compute/resourceskus/list), [List all + * available virtual machine sizes for + * resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). For more information + * about virtual machine sizes, see [Sizes for virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/sizes). The available VM sizes depend on region and + * availability set. + * + * @param vmSize the vmSize value to set. + * @return the HardwareProfile object itself. + */ + public HardwareProfile withVmSize(VirtualMachineSizeTypes vmSize) { + this.vmSize = vmSize; + return this; + } + + /** + * Get the vmSizeProperties property: Specifies the properties for customizing the size of the virtual machine. + * Minimum api-version: 2021-07-01. This feature is still in preview mode and is not supported for + * VirtualMachineScaleSet. Please follow the instructions in [VM Customization](https://aka.ms/vmcustomization) for + * more details. + * + * @return the vmSizeProperties value. + */ + public VMSizeProperties vmSizeProperties() { + return this.vmSizeProperties; + } + + /** + * Set the vmSizeProperties property: Specifies the properties for customizing the size of the virtual machine. + * Minimum api-version: 2021-07-01. This feature is still in preview mode and is not supported for + * VirtualMachineScaleSet. Please follow the instructions in [VM Customization](https://aka.ms/vmcustomization) for + * more details. + * + * @param vmSizeProperties the vmSizeProperties value to set. + * @return the HardwareProfile object itself. + */ + public HardwareProfile withVmSizeProperties(VMSizeProperties vmSizeProperties) { + this.vmSizeProperties = vmSizeProperties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (vmSizeProperties() != null) { + vmSizeProperties().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..27d3f1747198a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/HostCaching.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.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'. */ +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) { + if (value == null) { + return null; + } + HostCaching[] items = HostCaching.values(); + for (HostCaching item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @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..7980164b6cfdd --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/HyperVGeneration.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; + +/** The hypervisor generation of the Virtual Machine. Applicable to OS disks only. */ +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 a new instance of HyperVGeneration value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public HyperVGeneration() { + } + + /** + * 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); + } + + /** + * Gets known HyperVGeneration values. + * + * @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..d45d06e986346 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/HyperVGenerationType.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; + +/** Specifies the HyperVGeneration Type associated with a resource. */ +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 a new instance of HyperVGenerationType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public HyperVGenerationType() { + } + + /** + * 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); + } + + /** + * Gets known HyperVGenerationType values. + * + * @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..afa53333b3d2f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/HyperVGenerationTypes.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; + +/** Specifies the HyperVGeneration Type. */ +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 a new instance of HyperVGenerationTypes value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public HyperVGenerationTypes() { + } + + /** + * 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); + } + + /** + * Gets known HyperVGenerationTypes values. + * + * @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..d96dddba0519c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Image.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.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.ImageInner; +import java.util.Map; + +/** An immutable client-side representation of Image. */ +public interface Image { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the extendedLocation property: The extended location of the Image. + * + * @return the extendedLocation value. + */ + ExtendedLocation extendedLocation(); + + /** + * Gets the sourceVirtualMachine property: The source virtual machine from which Image is created. + * + * @return the sourceVirtualMachine value. + */ + SubResource sourceVirtualMachine(); + + /** + * Gets the storageProfile property: Specifies the storage settings for the virtual machine disks. + * + * @return the storageProfile value. + */ + ImageStorageProfile storageProfile(); + + /** + * Gets the provisioningState property: The provisioning state. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the hyperVGeneration property: Specifies the HyperVGenerationType of the VirtualMachine created from the + * image. From API Version 2019-03-01 if the image source is a blob, then we need the user to specify the value, if + * the source is managed resource like disk or snapshot, we may require the user to specify the property if we + * cannot deduce it from the source managed resource. + * + * @return the hyperVGeneration value. + */ + HyperVGenerationTypes hyperVGeneration(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.compute.generated.fluent.models.ImageInner object. + * + * @return the inner object. + */ + ImageInner innerModel(); + + /** The entirety of the Image definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The Image definition stages. */ + interface DefinitionStages { + /** The first stage of the Image definition. */ + interface Blank extends WithLocation { + } + /** The stage of the Image definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the Image definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the Image definition which contains all the minimum required properties for the resource to be + * created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithExtendedLocation, + DefinitionStages.WithSourceVirtualMachine, + DefinitionStages.WithStorageProfile, + DefinitionStages.WithHyperVGeneration { + /** + * Executes the create request. + * + * @return the created resource. + */ + Image create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Image create(Context context); + } + /** The stage of the Image definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the Image definition allowing to specify extendedLocation. */ + interface WithExtendedLocation { + /** + * Specifies the extendedLocation property: The extended location of the Image.. + * + * @param extendedLocation The extended location of the Image. + * @return the next definition stage. + */ + WithCreate withExtendedLocation(ExtendedLocation extendedLocation); + } + /** The stage of the Image definition allowing to specify sourceVirtualMachine. */ + interface WithSourceVirtualMachine { + /** + * Specifies the sourceVirtualMachine property: The source virtual machine from which Image is created.. + * + * @param sourceVirtualMachine The source virtual machine from which Image is created. + * @return the next definition stage. + */ + WithCreate withSourceVirtualMachine(SubResource sourceVirtualMachine); + } + /** The stage of the Image definition allowing to specify storageProfile. */ + interface WithStorageProfile { + /** + * Specifies the storageProfile property: Specifies the storage settings for the virtual machine disks.. + * + * @param storageProfile Specifies the storage settings for the virtual machine disks. + * @return the next definition stage. + */ + WithCreate withStorageProfile(ImageStorageProfile storageProfile); + } + /** The stage of the Image definition allowing to specify hyperVGeneration. */ + interface WithHyperVGeneration { + /** + * Specifies the hyperVGeneration property: Specifies the HyperVGenerationType of the VirtualMachine created + * from the image. From API Version 2019-03-01 if the image source is a blob, then we need the user to + * specify the value, if the source is managed resource like disk or snapshot, we may require the user to + * specify the property if we cannot deduce it from the source managed resource.. + * + * @param hyperVGeneration Specifies the HyperVGenerationType of the VirtualMachine created from the image. + * From API Version 2019-03-01 if the image source is a blob, then we need the user to specify the + * value, if the source is managed resource like disk or snapshot, we may require the user to specify + * the property if we cannot deduce it from the source managed resource. + * @return the next definition stage. + */ + WithCreate withHyperVGeneration(HyperVGenerationTypes hyperVGeneration); + } + } + /** + * Begins update for the Image resource. + * + * @return the stage of resource update. + */ + Image.Update update(); + + /** The template for Image update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithSourceVirtualMachine, + UpdateStages.WithStorageProfile, + UpdateStages.WithHyperVGeneration { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Image apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Image apply(Context context); + } + /** The Image update stages. */ + interface UpdateStages { + /** The stage of the Image update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the Image update allowing to specify sourceVirtualMachine. */ + interface WithSourceVirtualMachine { + /** + * Specifies the sourceVirtualMachine property: The source virtual machine from which Image is created.. + * + * @param sourceVirtualMachine The source virtual machine from which Image is created. + * @return the next definition stage. + */ + Update withSourceVirtualMachine(SubResource sourceVirtualMachine); + } + /** The stage of the Image update allowing to specify storageProfile. */ + interface WithStorageProfile { + /** + * Specifies the storageProfile property: Specifies the storage settings for the virtual machine disks.. + * + * @param storageProfile Specifies the storage settings for the virtual machine disks. + * @return the next definition stage. + */ + Update withStorageProfile(ImageStorageProfile storageProfile); + } + /** The stage of the Image update allowing to specify hyperVGeneration. */ + interface WithHyperVGeneration { + /** + * Specifies the hyperVGeneration property: Specifies the HyperVGenerationType of the VirtualMachine created + * from the image. From API Version 2019-03-01 if the image source is a blob, then we need the user to + * specify the value, if the source is managed resource like disk or snapshot, we may require the user to + * specify the property if we cannot deduce it from the source managed resource.. + * + * @param hyperVGeneration Specifies the HyperVGenerationType of the VirtualMachine created from the image. + * From API Version 2019-03-01 if the image source is a blob, then we need the user to specify the + * value, if the source is managed resource like disk or snapshot, we may require the user to specify + * the property if we cannot deduce it from the source managed resource. + * @return the next definition stage. + */ + Update withHyperVGeneration(HyperVGenerationTypes hyperVGeneration); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Image refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Image refresh(Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ImageDataDisk.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ImageDataDisk.java new file mode 100644 index 0000000000000..ff3dfb58af571 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ImageDataDisk.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.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a data disk. */ +@Fluent +public final class ImageDataDisk extends ImageDisk { + /* + * 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; + + /** Creates an instance of ImageDataDisk class. */ + public ImageDataDisk() { + } + + /** + * 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/ImageDeprecationStatus.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ImageDeprecationStatus.java new file mode 100644 index 0000000000000..f72d610df971e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ImageDeprecationStatus.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.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Describes image deprecation status properties on the image. */ +@Fluent +public final class ImageDeprecationStatus { + /* + * Describes the state of the image. + */ + @JsonProperty(value = "imageState") + private ImageState imageState; + + /* + * The time, in future, at which this image will be marked as deprecated. This scheduled time is chosen by the + * Publisher. + */ + @JsonProperty(value = "scheduledDeprecationTime") + private OffsetDateTime scheduledDeprecationTime; + + /* + * Describes the alternative option specified by the Publisher for this image when this image is deprecated. + */ + @JsonProperty(value = "alternativeOption") + private AlternativeOption alternativeOption; + + /** Creates an instance of ImageDeprecationStatus class. */ + public ImageDeprecationStatus() { + } + + /** + * Get the imageState property: Describes the state of the image. + * + * @return the imageState value. + */ + public ImageState imageState() { + return this.imageState; + } + + /** + * Set the imageState property: Describes the state of the image. + * + * @param imageState the imageState value to set. + * @return the ImageDeprecationStatus object itself. + */ + public ImageDeprecationStatus withImageState(ImageState imageState) { + this.imageState = imageState; + return this; + } + + /** + * Get the scheduledDeprecationTime property: The time, in future, at which this image will be marked as deprecated. + * This scheduled time is chosen by the Publisher. + * + * @return the scheduledDeprecationTime value. + */ + public OffsetDateTime scheduledDeprecationTime() { + return this.scheduledDeprecationTime; + } + + /** + * Set the scheduledDeprecationTime property: The time, in future, at which this image will be marked as deprecated. + * This scheduled time is chosen by the Publisher. + * + * @param scheduledDeprecationTime the scheduledDeprecationTime value to set. + * @return the ImageDeprecationStatus object itself. + */ + public ImageDeprecationStatus withScheduledDeprecationTime(OffsetDateTime scheduledDeprecationTime) { + this.scheduledDeprecationTime = scheduledDeprecationTime; + return this; + } + + /** + * Get the alternativeOption property: Describes the alternative option specified by the Publisher for this image + * when this image is deprecated. + * + * @return the alternativeOption value. + */ + public AlternativeOption alternativeOption() { + return this.alternativeOption; + } + + /** + * Set the alternativeOption property: Describes the alternative option specified by the Publisher for this image + * when this image is deprecated. + * + * @param alternativeOption the alternativeOption value to set. + * @return the ImageDeprecationStatus object itself. + */ + public ImageDeprecationStatus withAlternativeOption(AlternativeOption alternativeOption) { + this.alternativeOption = alternativeOption; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (alternativeOption() != null) { + alternativeOption().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..add636299dd57 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ImageDisk.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.management.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a image disk. */ +@Fluent +public class ImageDisk { + /* + * 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.** The default + * values are: **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; + + /** Creates an instance of ImageDisk class. */ + public ImageDisk() { + } + + /** + * 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. Possible values are: **None,** **ReadOnly,** + * **ReadWrite.** The default values are: **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. Possible values are: **None,** **ReadOnly,** + * **ReadWrite.** The default values are: **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. 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. 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..8ab189f7da8e6 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ImageDiskReference.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.fasterxml.jackson.annotation.JsonProperty; + +/** The source image used for creating the disk. */ +@Fluent +public final class ImageDiskReference { + /* + * A relative uri containing either a Platform Image Repository, user image, or Azure Compute Gallery image + * reference. + */ + @JsonProperty(value = "id") + private String id; + + /* + * A relative uri containing a direct shared Azure Compute Gallery image reference. + */ + @JsonProperty(value = "sharedGalleryImageId") + private String sharedGalleryImageId; + + /* + * A relative uri containing a community Azure Compute Gallery image reference. + */ + @JsonProperty(value = "communityGalleryImageId") + private String communityGalleryImageId; + + /* + * 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; + + /** Creates an instance of ImageDiskReference class. */ + public ImageDiskReference() { + } + + /** + * Get the id property: A relative uri containing either a Platform Image Repository, user image, or Azure Compute + * Gallery 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, user image, or Azure Compute + * Gallery 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 sharedGalleryImageId property: A relative uri containing a direct shared Azure Compute Gallery image + * reference. + * + * @return the sharedGalleryImageId value. + */ + public String sharedGalleryImageId() { + return this.sharedGalleryImageId; + } + + /** + * Set the sharedGalleryImageId property: A relative uri containing a direct shared Azure Compute Gallery image + * reference. + * + * @param sharedGalleryImageId the sharedGalleryImageId value to set. + * @return the ImageDiskReference object itself. + */ + public ImageDiskReference withSharedGalleryImageId(String sharedGalleryImageId) { + this.sharedGalleryImageId = sharedGalleryImageId; + return this; + } + + /** + * Get the communityGalleryImageId property: A relative uri containing a community Azure Compute Gallery image + * reference. + * + * @return the communityGalleryImageId value. + */ + public String communityGalleryImageId() { + return this.communityGalleryImageId; + } + + /** + * Set the communityGalleryImageId property: A relative uri containing a community Azure Compute Gallery image + * reference. + * + * @param communityGalleryImageId the communityGalleryImageId value to set. + * @return the ImageDiskReference object itself. + */ + public ImageDiskReference withCommunityGalleryImageId(String communityGalleryImageId) { + this.communityGalleryImageId = communityGalleryImageId; + 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() { + } +} 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..c520d76af20a8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ImageListResult.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.ImageInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List Image operation response. */ +@Fluent +public final class ImageListResult { + /* + * 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; + + /** Creates an instance of ImageListResult class. */ + public ImageListResult() { + } + + /** + * 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()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ImageListResult.class); +} 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..629b86b1fd1df --- /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.JsonProperty; + +/** Describes an Operating System disk. */ +@Fluent +public final class ImageOSDisk extends ImageDisk { + /* + * 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. For managed images, use Generalized. + */ + @JsonProperty(value = "osState", required = true) + private OperatingSystemStateTypes osState; + + /** Creates an instance of ImageOSDisk class. */ + public ImageOSDisk() { + } + + /** + * 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. Possible values are: **Windows,** **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. Possible values are: **Windows,** **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. For managed images, use Generalized. + * + * @return the osState value. + */ + public OperatingSystemStateTypes osState() { + return this.osState; + } + + /** + * Set the osState property: The OS State. For managed images, use Generalized. + * + * @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")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ImageOSDisk.class); +} 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..88d5c043067a7 --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the gallery image definition purchase plan. This is used by marketplace images. */ +@Fluent +public final class ImagePurchasePlan { + /* + * 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; + + /** Creates an instance of ImagePurchasePlan class. */ + public ImagePurchasePlan() { + } + + /** + * 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..c6e613c47c8fa --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ImageReference.java @@ -0,0 +1,240 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +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 { + /* + * 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. Please do not use field + * 'version' for gallery image deployment, gallery image should always use 'id' field for deployment, to use + * 'latest' version of gallery image, just set + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageName}' + * in the 'id' field without version input. + */ + @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; + + /* + * Specified the shared gallery image unique id for vm deployment. This can be fetched from shared gallery image + * GET call. + */ + @JsonProperty(value = "sharedGalleryImageId") + private String sharedGalleryImageId; + + /* + * Specified the community gallery image unique id for vm deployment. This can be fetched from community gallery + * image GET call. + */ + @JsonProperty(value = "communityGalleryImageId") + private String communityGalleryImageId; + + /** Creates an instance of ImageReference class. */ + public ImageReference() { + } + + /** + * 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. + * Please do not use field 'version' for gallery image deployment, gallery image should always use 'id' field for + * deployment, to use 'latest' version of gallery image, just set + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageName}' + * in the 'id' field without version input. + * + * @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. + * Please do not use field 'version' for gallery image deployment, gallery image should always use 'id' field for + * deployment, to use 'latest' version of gallery image, just set + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageName}' + * in the 'id' field without version input. + * + * @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; + } + + /** + * Get the sharedGalleryImageId property: Specified the shared gallery image unique id for vm deployment. This can + * be fetched from shared gallery image GET call. + * + * @return the sharedGalleryImageId value. + */ + public String sharedGalleryImageId() { + return this.sharedGalleryImageId; + } + + /** + * Set the sharedGalleryImageId property: Specified the shared gallery image unique id for vm deployment. This can + * be fetched from shared gallery image GET call. + * + * @param sharedGalleryImageId the sharedGalleryImageId value to set. + * @return the ImageReference object itself. + */ + public ImageReference withSharedGalleryImageId(String sharedGalleryImageId) { + this.sharedGalleryImageId = sharedGalleryImageId; + return this; + } + + /** + * Get the communityGalleryImageId property: Specified the community gallery image unique id for vm deployment. This + * can be fetched from community gallery image GET call. + * + * @return the communityGalleryImageId value. + */ + public String communityGalleryImageId() { + return this.communityGalleryImageId; + } + + /** + * Set the communityGalleryImageId property: Specified the community gallery image unique id for vm deployment. This + * can be fetched from community gallery image GET call. + * + * @param communityGalleryImageId the communityGalleryImageId value to set. + * @return the ImageReference object itself. + */ + public ImageReference withCommunityGalleryImageId(String communityGalleryImageId) { + this.communityGalleryImageId = communityGalleryImageId; + return this; + } + + /** {@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/ImageState.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ImageState.java new file mode 100644 index 0000000000000..eec0fa89e3e8c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ImageState.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Describes the state of the image. */ +public final class ImageState extends ExpandableStringEnum { + /** Static value Active for ImageState. */ + public static final ImageState ACTIVE = fromString("Active"); + + /** Static value ScheduledForDeprecation for ImageState. */ + public static final ImageState SCHEDULED_FOR_DEPRECATION = fromString("ScheduledForDeprecation"); + + /** Static value Deprecated for ImageState. */ + public static final ImageState DEPRECATED = fromString("Deprecated"); + + /** + * Creates a new instance of ImageState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ImageState() { + } + + /** + * Creates or finds a ImageState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ImageState. + */ + @JsonCreator + public static ImageState fromString(String name) { + return fromString(name, ImageState.class); + } + + /** + * Gets known ImageState values. + * + * @return known ImageState values. + */ + public static Collection values() { + return values(ImageState.class); + } +} 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..c5cb05bc03f5f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ImageStorageProfile.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a storage profile. */ +@Fluent +public final class ImageStorageProfile { + /* + * Specifies information about the operating system disk used by the virtual machine.

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

For more information + * about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). + */ + @JsonProperty(value = "dataDisks") + private List dataDisks; + + /* + * Specifies whether an image is zone resilient or not. Default is false. Zone resilient images can be created only + * in regions that provide Zone Redundant Storage (ZRS). + */ + @JsonProperty(value = "zoneResilient") + private Boolean zoneResilient; + + /** Creates an instance of ImageStorageProfile class. */ + public ImageStorageProfile() { + } + + /** + * Get the osDisk property: Specifies information about the operating system disk used by the virtual machine. + * <br><br> For more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). + * + * @return the osDisk value. + */ + public ImageOSDisk osDisk() { + return this.osDisk; + } + + /** + * Set the osDisk property: Specifies information about the operating system disk used by the virtual machine. + * <br><br> For more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). + * + * @param osDisk the osDisk value to set. + * @return the ImageStorageProfile object itself. + */ + public ImageStorageProfile withOsDisk(ImageOSDisk osDisk) { + this.osDisk = osDisk; + return this; + } + + /** + * Get the dataDisks property: Specifies the parameters that are used to add a data disk to a virtual machine. + * <br><br> For more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). + * + * @return the dataDisks value. + */ + public List dataDisks() { + return this.dataDisks; + } + + /** + * Set the dataDisks property: Specifies the parameters that are used to add a data disk to a virtual machine. + * <br><br> For more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). + * + * @param dataDisks the dataDisks value to set. + * @return the ImageStorageProfile object itself. + */ + public ImageStorageProfile withDataDisks(List dataDisks) { + this.dataDisks = dataDisks; + return this; + } + + /** + * Get the zoneResilient property: Specifies whether an image is zone resilient or not. Default is false. Zone + * resilient images can be created only in regions that provide Zone Redundant Storage (ZRS). + * + * @return the zoneResilient value. + */ + public Boolean zoneResilient() { + return this.zoneResilient; + } + + /** + * Set the zoneResilient property: Specifies whether an image is zone resilient or not. Default is false. Zone + * resilient images can be created only in regions that provide Zone Redundant Storage (ZRS). + * + * @param zoneResilient the zoneResilient value to set. + * @return the ImageStorageProfile object itself. + */ + public ImageStorageProfile withZoneResilient(Boolean zoneResilient) { + this.zoneResilient = zoneResilient; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (osDisk() != null) { + osDisk().validate(); + } + if (dataDisks() != null) { + dataDisks().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ImageUpdate.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ImageUpdate.java new file mode 100644 index 0000000000000..d7a048f3ad13b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ImageUpdate.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.management.SubResource; +import com.azure.resourcemanager.compute.generated.fluent.models.ImageProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The source user image virtual hard disk. Only tags may be updated. */ +@Fluent +public final class ImageUpdate extends UpdateResource { + /* + * Describes the properties of an Image. + */ + @JsonProperty(value = "properties") + private ImageProperties innerProperties; + + /** Creates an instance of ImageUpdate class. */ + public ImageUpdate() { + } + + /** + * Get the innerProperties property: Describes the properties of an Image. + * + * @return the innerProperties value. + */ + private ImageProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public ImageUpdate withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the sourceVirtualMachine property: The source virtual machine from which Image is created. + * + * @return the sourceVirtualMachine value. + */ + public SubResource sourceVirtualMachine() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ImageProperties(); + } + this.innerProperties().withSourceVirtualMachine(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ImageProperties(); + } + this.innerProperties().withStorageProfile(storageProfile); + return this; + } + + /** + * Get the provisioningState property: The provisioning state. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the hyperVGeneration property: Specifies the HyperVGenerationType of the VirtualMachine created from the + * image. From API Version 2019-03-01 if the image source is a blob, then we need the user to specify the value, if + * the source is managed resource like disk or snapshot, we may require the user to specify the property if we + * cannot deduce it from the source managed resource. + * + * @return the hyperVGeneration value. + */ + public HyperVGenerationTypes hyperVGeneration() { + return this.innerProperties() == null ? null : this.innerProperties().hyperVGeneration(); + } + + /** + * Set the hyperVGeneration property: Specifies the HyperVGenerationType of the VirtualMachine created from the + * image. From API Version 2019-03-01 if the image source is a blob, then we need the user to specify the value, if + * the source is managed resource like disk or snapshot, we may require the user to specify the property if we + * cannot deduce it from the source managed resource. + * + * @param hyperVGeneration the hyperVGeneration value to set. + * @return the ImageUpdate object itself. + */ + public ImageUpdate withHyperVGeneration(HyperVGenerationTypes hyperVGeneration) { + if (this.innerProperties() == null) { + this.innerProperties = new ImageProperties(); + } + this.innerProperties().withHyperVGeneration(hyperVGeneration); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().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..5b98025b012fa --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Images.java @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.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.resourcemanager.compute.generated.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 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.resourcemanager.compute.generated.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 imageName, Context 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String imageName, String expand, 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.resourcemanager.compute.generated.models.ApiErrorException 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 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.resourcemanager.compute.generated.models.ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + 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.resourcemanager.compute.generated.models.ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + 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.resourcemanager.compute.generated.models.ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + 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.resourcemanager.compute.generated.models.ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Gets an 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. + * @return an image along with {@link Response}. + */ + 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.resourcemanager.compute.generated.models.ApiErrorException 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 along with {@link Response}. + */ + 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.resourcemanager.compute.generated.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 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.resourcemanager.compute.generated.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 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..daad349b81650 --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** Inner error details. */ +@Fluent +public final class InnerError { + /* + * The exception type. + */ + @JsonProperty(value = "exceptiontype") + private String exceptiontype; + + /* + * The internal error message or exception dump. + */ + @JsonProperty(value = "errordetail") + private String errordetail; + + /** Creates an instance of InnerError class. */ + public InnerError() { + } + + /** + * Get the exceptiontype property: The exception type. + * + * @return the exceptiontype value. + */ + public String exceptiontype() { + return this.exceptiontype; + } + + /** + * Set the exceptiontype property: The exception type. + * + * @param exceptiontype the exceptiontype value to set. + * @return the InnerError object itself. + */ + public InnerError withExceptiontype(String exceptiontype) { + this.exceptiontype = exceptiontype; + return this; + } + + /** + * Get the errordetail property: The internal error message or exception dump. + * + * @return the errordetail value. + */ + public String errordetail() { + return this.errordetail; + } + + /** + * Set the errordetail property: The internal error message or exception dump. + * + * @param errordetail the errordetail value to set. + * @return the InnerError object itself. + */ + public InnerError withErrordetail(String errordetail) { + this.errordetail = errordetail; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/InstanceSku.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/InstanceSku.java new file mode 100644 index 0000000000000..b8d3dbf03b04f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/InstanceSku.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The role instance SKU. */ +@Immutable +public final class InstanceSku { + /* + * The sku name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The tier of the cloud service role instance. + */ + @JsonProperty(value = "tier", access = JsonProperty.Access.WRITE_ONLY) + private String tier; + + /** Creates an instance of InstanceSku class. */ + public InstanceSku() { + } + + /** + * Get the name property: The sku name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the tier property: The tier of the cloud service role instance. + * + * @return the tier value. + */ + public String tier() { + return this.tier; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/InstanceViewStatus.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/InstanceViewStatus.java new file mode 100644 index 0000000000000..0b94a92f573b1 --- /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.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Instance view status. */ +@Fluent +public final class InstanceViewStatus { + /* + * 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; + + /** Creates an instance of InstanceViewStatus class. */ + public InstanceViewStatus() { + } + + /** + * Get the code property: The status code. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Set the code property: The status code. + * + * @param code the code value to set. + * @return the InstanceViewStatus object itself. + */ + public InstanceViewStatus withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the level property: The level code. + * + * @return the level value. + */ + public StatusLevelTypes level() { + return this.level; + } + + /** + * Set the level property: The level code. + * + * @param level the level value to set. + * @return the InstanceViewStatus object itself. + */ + public InstanceViewStatus withLevel(StatusLevelTypes level) { + this.level = level; + return this; + } + + /** + * Get the displayStatus property: The short localizable label for the status. + * + * @return the displayStatus value. + */ + public String displayStatus() { + return this.displayStatus; + } + + /** + * Set the displayStatus property: The short localizable label for the status. + * + * @param displayStatus the displayStatus value to set. + * @return the InstanceViewStatus object itself. + */ + public InstanceViewStatus withDisplayStatus(String displayStatus) { + this.displayStatus = displayStatus; + return this; + } + + /** + * Get the message property: The detailed status message, including for alerts and error messages. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: The detailed status message, including for alerts and error messages. + * + * @param message the message value to set. + * @return the InstanceViewStatus object itself. + */ + public InstanceViewStatus withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the time property: The time of the status. + * + * @return the time value. + */ + public OffsetDateTime time() { + return this.time; + } + + /** + * Set the time property: The time of the status. + * + * @param time the time value to set. + * @return the InstanceViewStatus object itself. + */ + public InstanceViewStatus withTime(OffsetDateTime time) { + this.time = time; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/InstanceViewStatusesSummary.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/InstanceViewStatusesSummary.java new file mode 100644 index 0000000000000..db222b2c4bd69 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/InstanceViewStatusesSummary.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Instance view statuses. */ +@Immutable +public final class InstanceViewStatusesSummary { + /* + * The summary. + */ + @JsonProperty(value = "statusesSummary", access = JsonProperty.Access.WRITE_ONLY) + private List statusesSummary; + + /** Creates an instance of InstanceViewStatusesSummary class. */ + public InstanceViewStatusesSummary() { + } + + /** + * Get the statusesSummary property: The summary. + * + * @return the statusesSummary value. + */ + public List statusesSummary() { + return this.statusesSummary; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (statusesSummary() != null) { + statusesSummary().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/InstanceViewTypes.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/InstanceViewTypes.java new file mode 100644 index 0000000000000..16af3be9595be --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/InstanceViewTypes.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.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for InstanceViewTypes. */ +public enum InstanceViewTypes { + /** Enum value instanceView. */ + INSTANCE_VIEW("instanceView"), + + /** Enum value userData. */ + USER_DATA("userData"); + + /** The actual serialized value for a InstanceViewTypes instance. */ + private final String value; + + InstanceViewTypes(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a InstanceViewTypes instance. + * + * @param value the serialized value to parse. + * @return the parsed InstanceViewTypes object, or null if unable to parse. + */ + @JsonCreator + public static InstanceViewTypes fromString(String value) { + if (value == null) { + return null; + } + InstanceViewTypes[] items = InstanceViewTypes.values(); + for (InstanceViewTypes item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @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..fe3c25691b8de --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/IntervalInMins.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.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Interval value in minutes used to create LogAnalytics call rate logs. */ +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) { + if (value == null) { + return null; + } + IntervalInMins[] items = IntervalInMins.values(); + for (IntervalInMins item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @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..7317bd4cc9984 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/IpVersion.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * 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'. + */ +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 a new instance of IpVersion value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public IpVersion() { + } + + /** + * 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); + } + + /** + * Gets known IpVersion values. + * + * @return known IpVersion values. + */ + public static Collection values() { + return values(IpVersion.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/IpVersions.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/IpVersions.java new file mode 100644 index 0000000000000..0fda5f090e81b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/IpVersions.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * 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'. + */ +public final class IpVersions extends ExpandableStringEnum { + /** Static value IPv4 for IpVersions. */ + public static final IpVersions IPV4 = fromString("IPv4"); + + /** Static value IPv6 for IpVersions. */ + public static final IpVersions IPV6 = fromString("IPv6"); + + /** + * Creates a new instance of IpVersions value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public IpVersions() { + } + + /** + * Creates or finds a IpVersions from its string representation. + * + * @param name a name to look for. + * @return the corresponding IpVersions. + */ + @JsonCreator + public static IpVersions fromString(String name) { + return fromString(name, IpVersions.class); + } + + /** + * Gets known IpVersions values. + * + * @return known IpVersions values. + */ + public static Collection values() { + return values(IpVersions.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/KeyForDiskEncryptionSet.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/KeyForDiskEncryptionSet.java new file mode 100644 index 0000000000000..2ac2ea43c81f8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/KeyForDiskEncryptionSet.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +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 { + /* + * Resource id of the KeyVault containing the key or secret. This property is optional and cannot be used if the + * KeyVault subscription is not the same as the Disk Encryption Set subscription. + */ + @JsonProperty(value = "sourceVault") + private SourceVault sourceVault; + + /* + * Fully versioned Key Url pointing to a key in KeyVault. Version segment of the Url is required regardless of + * rotationToLatestKeyVersionEnabled value. + */ + @JsonProperty(value = "keyUrl", required = true) + private String keyUrl; + + /** Creates an instance of KeyForDiskEncryptionSet class. */ + public KeyForDiskEncryptionSet() { + } + + /** + * Get the sourceVault property: Resource id of the KeyVault containing the key or secret. This property is optional + * and cannot be used if the KeyVault subscription is not the same as the Disk Encryption Set subscription. + * + * @return the sourceVault value. + */ + public SourceVault sourceVault() { + return this.sourceVault; + } + + /** + * Set the sourceVault property: Resource id of the KeyVault containing the key or secret. This property is optional + * and cannot be used if the KeyVault subscription is not the same as the Disk Encryption Set subscription. + * + * @param sourceVault the sourceVault value to set. + * @return the KeyForDiskEncryptionSet object itself. + */ + public KeyForDiskEncryptionSet withSourceVault(SourceVault sourceVault) { + this.sourceVault = sourceVault; + return this; + } + + /** + * Get the keyUrl property: Fully versioned Key Url pointing to a key in KeyVault. Version segment of the Url is + * required regardless of rotationToLatestKeyVersionEnabled value. + * + * @return the keyUrl value. + */ + public String keyUrl() { + return this.keyUrl; + } + + /** + * Set the keyUrl property: Fully versioned Key Url pointing to a key in KeyVault. Version segment of the Url is + * required regardless of rotationToLatestKeyVersionEnabled value. + * + * @param keyUrl the keyUrl value to set. + * @return the KeyForDiskEncryptionSet object itself. + */ + public KeyForDiskEncryptionSet withKeyUrl(String keyUrl) { + this.keyUrl = keyUrl; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sourceVault() != null) { + sourceVault().validate(); + } + if (keyUrl() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property keyUrl in model KeyForDiskEncryptionSet")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(KeyForDiskEncryptionSet.class); +} 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..20e4f805a77ac --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/KeyVaultAndKeyReference.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.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 { + /* + * 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; + + /** Creates an instance of KeyVaultAndKeyReference class. */ + public KeyVaultAndKeyReference() { + } + + /** + * 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")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(KeyVaultAndKeyReference.class); +} 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..15d41091e4075 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/KeyVaultAndSecretReference.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Key Vault Secret Url and vault id of the encryption key. */ +@Fluent +public final class KeyVaultAndSecretReference { + /* + * 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; + + /** Creates an instance of KeyVaultAndSecretReference class. */ + public KeyVaultAndSecretReference() { + } + + /** + * 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")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(KeyVaultAndSecretReference.class); +} 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..0a856a594253b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/KeyVaultKeyReference.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.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a reference to Key Vault Key. */ +@Fluent +public final class KeyVaultKeyReference { + /* + * 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; + + /** Creates an instance of KeyVaultKeyReference class. */ + public KeyVaultKeyReference() { + } + + /** + * 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")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(KeyVaultKeyReference.class); +} 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..bcc0e2d988652 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/KeyVaultSecretReference.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.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a reference to Key Vault Secret. */ +@Fluent +public final class KeyVaultSecretReference { + /* + * 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; + + /** Creates an instance of KeyVaultSecretReference class. */ + public KeyVaultSecretReference() { + } + + /** + * 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")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(KeyVaultSecretReference.class); +} 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..611d3aa494b98 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LastPatchInstallationSummary.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.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Describes the properties of the last installed patch summary. */ +@Immutable +public final class LastPatchInstallationSummary { + /* + * 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; + + /** Creates an instance of LastPatchInstallationSummary class. */ + public LastPatchInstallationSummary() { + } + + /** + * 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..c232bf001f831 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LinuxConfiguration.java @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifies the Linux operating system settings on the virtual machine. For a list of supported Linux distributions, + * see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/linux/endorsed-distros). + */ +@Fluent +public final class LinuxConfiguration { + /* + * 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; + + /* + * Indicates whether VMAgent Platform Updates is enabled for the Linux virtual machine. Default value is false. + */ + @JsonProperty(value = "enableVMAgentPlatformUpdates") + private Boolean enableVMAgentPlatformUpdates; + + /** Creates an instance of LinuxConfiguration class. */ + public LinuxConfiguration() { + } + + /** + * 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. 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. 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; + } + + /** + * Get the enableVMAgentPlatformUpdates property: Indicates whether VMAgent Platform Updates is enabled for the + * Linux virtual machine. Default value is false. + * + * @return the enableVMAgentPlatformUpdates value. + */ + public Boolean enableVMAgentPlatformUpdates() { + return this.enableVMAgentPlatformUpdates; + } + + /** + * Set the enableVMAgentPlatformUpdates property: Indicates whether VMAgent Platform Updates is enabled for the + * Linux virtual machine. Default value is false. + * + * @param enableVMAgentPlatformUpdates the enableVMAgentPlatformUpdates value to set. + * @return the LinuxConfiguration object itself. + */ + public LinuxConfiguration withEnableVMAgentPlatformUpdates(Boolean enableVMAgentPlatformUpdates) { + this.enableVMAgentPlatformUpdates = enableVMAgentPlatformUpdates; + 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..96d07ab0c5856 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LinuxParameters.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.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 { + /* + * 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; + + /** Creates an instance of LinuxParameters class. */ + public LinuxParameters() { + } + + /** + * Get the classificationsToInclude property: The update classifications to select when installing patches for + * Linux. + * + * @return the classificationsToInclude value. + */ + public List classificationsToInclude() { + return this.classificationsToInclude; + } + + /** + * Set the classificationsToInclude property: The update classifications to select when installing patches for + * Linux. + * + * @param classificationsToInclude the classificationsToInclude value to set. + * @return the LinuxParameters object itself. + */ + public LinuxParameters withClassificationsToInclude( + List classificationsToInclude) { + this.classificationsToInclude = classificationsToInclude; + return this; + } + + /** + * Get the packageNameMasksToInclude property: packages to include in the patch operation. Format: + * packageName_packageVersion. + * + * @return the packageNameMasksToInclude value. + */ + public List packageNameMasksToInclude() { + return this.packageNameMasksToInclude; + } + + /** + * Set the packageNameMasksToInclude property: packages to include in the patch operation. Format: + * packageName_packageVersion. + * + * @param packageNameMasksToInclude the packageNameMasksToInclude value to set. + * @return the LinuxParameters object itself. + */ + public LinuxParameters withPackageNameMasksToInclude(List packageNameMasksToInclude) { + this.packageNameMasksToInclude = packageNameMasksToInclude; + return this; + } + + /** + * Get the packageNameMasksToExclude property: packages to exclude in the patch operation. Format: + * packageName_packageVersion. + * + * @return the packageNameMasksToExclude value. + */ + public List packageNameMasksToExclude() { + return this.packageNameMasksToExclude; + } + + /** + * Set the packageNameMasksToExclude property: packages to exclude in the patch operation. Format: + * packageName_packageVersion. + * + * @param packageNameMasksToExclude the packageNameMasksToExclude value to set. + * @return the LinuxParameters object itself. + */ + public LinuxParameters withPackageNameMasksToExclude(List packageNameMasksToExclude) { + this.packageNameMasksToExclude = packageNameMasksToExclude; + return this; + } + + /** + * Get the maintenanceRunId property: This is used as a maintenance run identifier for Auto VM Guest Patching in + * Linux. + * + * @return the maintenanceRunId value. + */ + public String maintenanceRunId() { + return this.maintenanceRunId; + } + + /** + * Set the maintenanceRunId property: This is used as a maintenance run identifier for Auto VM Guest Patching in + * Linux. + * + * @param maintenanceRunId the maintenanceRunId value to set. + * @return the LinuxParameters object itself. + */ + public LinuxParameters withMaintenanceRunId(String maintenanceRunId) { + this.maintenanceRunId = maintenanceRunId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LinuxPatchAssessmentMode.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LinuxPatchAssessmentMode.java new file mode 100644 index 0000000000000..4650b4552d9f7 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LinuxPatchAssessmentMode.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; + +/** + * Specifies the mode of VM Guest Patch Assessment for the IaaS virtual machine.<br /><br /> Possible values + * are:<br /><br /> **ImageDefault** - You control the timing of patch assessments on a virtual machine. + * <br /><br /> **AutomaticByPlatform** - The platform will trigger periodic patch assessments. The property + * provisionVMAgent must be true. + */ +public final class LinuxPatchAssessmentMode extends ExpandableStringEnum { + /** Static value ImageDefault for LinuxPatchAssessmentMode. */ + public static final LinuxPatchAssessmentMode IMAGE_DEFAULT = fromString("ImageDefault"); + + /** Static value AutomaticByPlatform for LinuxPatchAssessmentMode. */ + public static final LinuxPatchAssessmentMode AUTOMATIC_BY_PLATFORM = fromString("AutomaticByPlatform"); + + /** + * Creates a new instance of LinuxPatchAssessmentMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LinuxPatchAssessmentMode() { + } + + /** + * Creates or finds a LinuxPatchAssessmentMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding LinuxPatchAssessmentMode. + */ + @JsonCreator + public static LinuxPatchAssessmentMode fromString(String name) { + return fromString(name, LinuxPatchAssessmentMode.class); + } + + /** + * Gets known LinuxPatchAssessmentMode values. + * + * @return known LinuxPatchAssessmentMode values. + */ + public static Collection values() { + return values(LinuxPatchAssessmentMode.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LinuxPatchSettings.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LinuxPatchSettings.java new file mode 100644 index 0000000000000..d8f6e8081748f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LinuxPatchSettings.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Specifies settings related to VM Guest Patching on Linux. */ +@Fluent +public final class LinuxPatchSettings { + /* + * Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual machines associated to virtual + * machine scale set with OrchestrationMode as Flexible.

Possible values are:

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

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

Possible values + * are:

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

**AutomaticByPlatform** - The platform will trigger periodic patch assessments. The property provisionVMAgent + * must be true. + */ + @JsonProperty(value = "assessmentMode") + private LinuxPatchAssessmentMode assessmentMode; + + /* + * Specifies additional settings for patch mode AutomaticByPlatform in VM Guest Patching on Linux. + */ + @JsonProperty(value = "automaticByPlatformSettings") + private LinuxVMGuestPatchAutomaticByPlatformSettings automaticByPlatformSettings; + + /** Creates an instance of LinuxPatchSettings class. */ + public LinuxPatchSettings() { + } + + /** + * Get the patchMode property: Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual machines + * associated to virtual machine scale set with OrchestrationMode as Flexible.<br /><br /> Possible + * values are:<br /><br /> **ImageDefault** - The virtual machine's default patching configuration is + * used. <br /><br /> **AutomaticByPlatform** - The virtual machine will be automatically updated by the + * platform. The property provisionVMAgent must be true. + * + * @return the patchMode value. + */ + public LinuxVMGuestPatchMode patchMode() { + return this.patchMode; + } + + /** + * Set the patchMode property: Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual machines + * associated to virtual machine scale set with OrchestrationMode as Flexible.<br /><br /> Possible + * values are:<br /><br /> **ImageDefault** - The virtual machine's default patching configuration is + * used. <br /><br /> **AutomaticByPlatform** - The virtual machine will be automatically updated by the + * platform. The property provisionVMAgent must be true. + * + * @param patchMode the patchMode value to set. + * @return the LinuxPatchSettings object itself. + */ + public LinuxPatchSettings withPatchMode(LinuxVMGuestPatchMode patchMode) { + this.patchMode = patchMode; + return this; + } + + /** + * Get the assessmentMode property: Specifies the mode of VM Guest Patch Assessment for the IaaS virtual + * machine.<br /><br /> Possible values are:<br /><br /> **ImageDefault** - You control the + * timing of patch assessments on a virtual machine. <br /><br /> **AutomaticByPlatform** - The platform + * will trigger periodic patch assessments. The property provisionVMAgent must be true. + * + * @return the assessmentMode value. + */ + public LinuxPatchAssessmentMode assessmentMode() { + return this.assessmentMode; + } + + /** + * Set the assessmentMode property: Specifies the mode of VM Guest Patch Assessment for the IaaS virtual + * machine.<br /><br /> Possible values are:<br /><br /> **ImageDefault** - You control the + * timing of patch assessments on a virtual machine. <br /><br /> **AutomaticByPlatform** - The platform + * will trigger periodic patch assessments. The property provisionVMAgent must be true. + * + * @param assessmentMode the assessmentMode value to set. + * @return the LinuxPatchSettings object itself. + */ + public LinuxPatchSettings withAssessmentMode(LinuxPatchAssessmentMode assessmentMode) { + this.assessmentMode = assessmentMode; + return this; + } + + /** + * Get the automaticByPlatformSettings property: Specifies additional settings for patch mode AutomaticByPlatform in + * VM Guest Patching on Linux. + * + * @return the automaticByPlatformSettings value. + */ + public LinuxVMGuestPatchAutomaticByPlatformSettings automaticByPlatformSettings() { + return this.automaticByPlatformSettings; + } + + /** + * Set the automaticByPlatformSettings property: Specifies additional settings for patch mode AutomaticByPlatform in + * VM Guest Patching on Linux. + * + * @param automaticByPlatformSettings the automaticByPlatformSettings value to set. + * @return the LinuxPatchSettings object itself. + */ + public LinuxPatchSettings withAutomaticByPlatformSettings( + LinuxVMGuestPatchAutomaticByPlatformSettings automaticByPlatformSettings) { + this.automaticByPlatformSettings = automaticByPlatformSettings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (automaticByPlatformSettings() != null) { + automaticByPlatformSettings().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LinuxVMGuestPatchAutomaticByPlatformRebootSetting.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LinuxVMGuestPatchAutomaticByPlatformRebootSetting.java new file mode 100644 index 0000000000000..bd8e833e1906c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LinuxVMGuestPatchAutomaticByPlatformRebootSetting.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Specifies the reboot setting for all AutomaticByPlatform patch installation operations. */ +public final class LinuxVMGuestPatchAutomaticByPlatformRebootSetting + extends ExpandableStringEnum { + /** Static value Unknown for LinuxVMGuestPatchAutomaticByPlatformRebootSetting. */ + public static final LinuxVMGuestPatchAutomaticByPlatformRebootSetting UNKNOWN = fromString("Unknown"); + + /** Static value IfRequired for LinuxVMGuestPatchAutomaticByPlatformRebootSetting. */ + public static final LinuxVMGuestPatchAutomaticByPlatformRebootSetting IF_REQUIRED = fromString("IfRequired"); + + /** Static value Never for LinuxVMGuestPatchAutomaticByPlatformRebootSetting. */ + public static final LinuxVMGuestPatchAutomaticByPlatformRebootSetting NEVER = fromString("Never"); + + /** Static value Always for LinuxVMGuestPatchAutomaticByPlatformRebootSetting. */ + public static final LinuxVMGuestPatchAutomaticByPlatformRebootSetting ALWAYS = fromString("Always"); + + /** + * Creates a new instance of LinuxVMGuestPatchAutomaticByPlatformRebootSetting value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LinuxVMGuestPatchAutomaticByPlatformRebootSetting() { + } + + /** + * Creates or finds a LinuxVMGuestPatchAutomaticByPlatformRebootSetting from its string representation. + * + * @param name a name to look for. + * @return the corresponding LinuxVMGuestPatchAutomaticByPlatformRebootSetting. + */ + @JsonCreator + public static LinuxVMGuestPatchAutomaticByPlatformRebootSetting fromString(String name) { + return fromString(name, LinuxVMGuestPatchAutomaticByPlatformRebootSetting.class); + } + + /** + * Gets known LinuxVMGuestPatchAutomaticByPlatformRebootSetting values. + * + * @return known LinuxVMGuestPatchAutomaticByPlatformRebootSetting values. + */ + public static Collection values() { + return values(LinuxVMGuestPatchAutomaticByPlatformRebootSetting.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LinuxVMGuestPatchAutomaticByPlatformSettings.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LinuxVMGuestPatchAutomaticByPlatformSettings.java new file mode 100644 index 0000000000000..d69a9022c9147 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LinuxVMGuestPatchAutomaticByPlatformSettings.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.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifies additional settings to be applied when patch mode AutomaticByPlatform is selected in Linux patch settings. + */ +@Fluent +public final class LinuxVMGuestPatchAutomaticByPlatformSettings { + /* + * Specifies the reboot setting for all AutomaticByPlatform patch installation operations. + */ + @JsonProperty(value = "rebootSetting") + private LinuxVMGuestPatchAutomaticByPlatformRebootSetting rebootSetting; + + /* + * Enables customer to schedule patching without accidental upgrades + */ + @JsonProperty(value = "bypassPlatformSafetyChecksOnUserSchedule") + private Boolean bypassPlatformSafetyChecksOnUserSchedule; + + /** Creates an instance of LinuxVMGuestPatchAutomaticByPlatformSettings class. */ + public LinuxVMGuestPatchAutomaticByPlatformSettings() { + } + + /** + * Get the rebootSetting property: Specifies the reboot setting for all AutomaticByPlatform patch installation + * operations. + * + * @return the rebootSetting value. + */ + public LinuxVMGuestPatchAutomaticByPlatformRebootSetting rebootSetting() { + return this.rebootSetting; + } + + /** + * Set the rebootSetting property: Specifies the reboot setting for all AutomaticByPlatform patch installation + * operations. + * + * @param rebootSetting the rebootSetting value to set. + * @return the LinuxVMGuestPatchAutomaticByPlatformSettings object itself. + */ + public LinuxVMGuestPatchAutomaticByPlatformSettings withRebootSetting( + LinuxVMGuestPatchAutomaticByPlatformRebootSetting rebootSetting) { + this.rebootSetting = rebootSetting; + return this; + } + + /** + * Get the bypassPlatformSafetyChecksOnUserSchedule property: Enables customer to schedule patching without + * accidental upgrades. + * + * @return the bypassPlatformSafetyChecksOnUserSchedule value. + */ + public Boolean bypassPlatformSafetyChecksOnUserSchedule() { + return this.bypassPlatformSafetyChecksOnUserSchedule; + } + + /** + * Set the bypassPlatformSafetyChecksOnUserSchedule property: Enables customer to schedule patching without + * accidental upgrades. + * + * @param bypassPlatformSafetyChecksOnUserSchedule the bypassPlatformSafetyChecksOnUserSchedule value to set. + * @return the LinuxVMGuestPatchAutomaticByPlatformSettings object itself. + */ + public LinuxVMGuestPatchAutomaticByPlatformSettings withBypassPlatformSafetyChecksOnUserSchedule( + Boolean bypassPlatformSafetyChecksOnUserSchedule) { + this.bypassPlatformSafetyChecksOnUserSchedule = bypassPlatformSafetyChecksOnUserSchedule; + 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..81c52e747c695 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LinuxVMGuestPatchMode.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * 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. + */ +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 a new instance of LinuxVMGuestPatchMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LinuxVMGuestPatchMode() { + } + + /** + * 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); + } + + /** + * Gets known LinuxVMGuestPatchMode values. + * + * @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..caf7f6566e8ee --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ListUsagesResult.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.azure.resourcemanager.compute.generated.fluent.models.UsageInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List Usages operation response. */ +@Fluent +public final class ListUsagesResult { + /* + * 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; + + /** Creates an instance of ListUsagesResult class. */ + public ListUsagesResult() { + } + + /** + * 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()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ListUsagesResult.class); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LoadBalancerConfiguration.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LoadBalancerConfiguration.java new file mode 100644 index 0000000000000..fbee493ecfa4b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LoadBalancerConfiguration.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.JsonProperty; + +/** Describes the load balancer configuration. */ +@Fluent +public final class LoadBalancerConfiguration { + /* + * Resource Id + */ + @JsonProperty(value = "id") + private String id; + + /* + * The name of the Load balancer + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Properties of the load balancer configuration. + */ + @JsonProperty(value = "properties", required = true) + private LoadBalancerConfigurationProperties properties; + + /** Creates an instance of LoadBalancerConfiguration class. */ + public LoadBalancerConfiguration() { + } + + /** + * Get the id property: Resource Id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource Id. + * + * @param id the id value to set. + * @return the LoadBalancerConfiguration object itself. + */ + public LoadBalancerConfiguration withId(String id) { + this.id = id; + return this; + } + + /** + * Get the name property: The name of the Load balancer. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the Load balancer. + * + * @param name the name value to set. + * @return the LoadBalancerConfiguration object itself. + */ + public LoadBalancerConfiguration withName(String name) { + this.name = name; + return this; + } + + /** + * Get the properties property: Properties of the load balancer configuration. + * + * @return the properties value. + */ + public LoadBalancerConfigurationProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of the load balancer configuration. + * + * @param properties the properties value to set. + * @return the LoadBalancerConfiguration object itself. + */ + public LoadBalancerConfiguration withProperties(LoadBalancerConfigurationProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model LoadBalancerConfiguration")); + } + if (properties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property properties in model LoadBalancerConfiguration")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(LoadBalancerConfiguration.class); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LoadBalancerConfigurationProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LoadBalancerConfigurationProperties.java new file mode 100644 index 0000000000000..ece7a64a8728b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LoadBalancerConfigurationProperties.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.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes the properties of the load balancer configuration. */ +@Fluent +public final class LoadBalancerConfigurationProperties { + /* + * Specifies the frontend IP to be used for the load balancer. Only IPv4 frontend IP address is supported. Each + * load balancer configuration must have exactly one frontend IP configuration. + */ + @JsonProperty(value = "frontendIpConfigurations", required = true) + private List frontendIpConfigurations; + + /** Creates an instance of LoadBalancerConfigurationProperties class. */ + public LoadBalancerConfigurationProperties() { + } + + /** + * Get the frontendIpConfigurations property: Specifies the frontend IP to be used for the load balancer. Only IPv4 + * frontend IP address is supported. Each load balancer configuration must have exactly one frontend IP + * configuration. + * + * @return the frontendIpConfigurations value. + */ + public List frontendIpConfigurations() { + return this.frontendIpConfigurations; + } + + /** + * Set the frontendIpConfigurations property: Specifies the frontend IP to be used for the load balancer. Only IPv4 + * frontend IP address is supported. Each load balancer configuration must have exactly one frontend IP + * configuration. + * + * @param frontendIpConfigurations the frontendIpConfigurations value to set. + * @return the LoadBalancerConfigurationProperties object itself. + */ + public LoadBalancerConfigurationProperties withFrontendIpConfigurations( + List frontendIpConfigurations) { + this.frontendIpConfigurations = frontendIpConfigurations; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (frontendIpConfigurations() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property frontendIpConfigurations in model" + + " LoadBalancerConfigurationProperties")); + } else { + frontendIpConfigurations().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(LoadBalancerConfigurationProperties.class); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LoadBalancerFrontendIpConfiguration.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LoadBalancerFrontendIpConfiguration.java new file mode 100644 index 0000000000000..6ce9df6ff855e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LoadBalancerFrontendIpConfiguration.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.JsonProperty; + +/** + * Specifies the frontend IP to be used for the load balancer. Only IPv4 frontend IP address is supported. Each load + * balancer configuration must have exactly one frontend IP configuration. + */ +@Fluent +public final class LoadBalancerFrontendIpConfiguration { + /* + * The name of the resource that is unique within the set of frontend IP configurations used by the load balancer. + * This name can be used to access the resource. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Properties of load balancer frontend ip configuration. + */ + @JsonProperty(value = "properties", required = true) + private LoadBalancerFrontendIpConfigurationProperties properties; + + /** Creates an instance of LoadBalancerFrontendIpConfiguration class. */ + public LoadBalancerFrontendIpConfiguration() { + } + + /** + * Get the name property: The name of the resource that is unique within the set of frontend IP configurations used + * by the load balancer. This name can be used to access the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the resource that is unique within the set of frontend IP configurations used + * by the load balancer. This name can be used to access the resource. + * + * @param name the name value to set. + * @return the LoadBalancerFrontendIpConfiguration object itself. + */ + public LoadBalancerFrontendIpConfiguration withName(String name) { + this.name = name; + return this; + } + + /** + * Get the properties property: Properties of load balancer frontend ip configuration. + * + * @return the properties value. + */ + public LoadBalancerFrontendIpConfigurationProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of load balancer frontend ip configuration. + * + * @param properties the properties value to set. + * @return the LoadBalancerFrontendIpConfiguration object itself. + */ + public LoadBalancerFrontendIpConfiguration withProperties( + LoadBalancerFrontendIpConfigurationProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property name in model LoadBalancerFrontendIpConfiguration")); + } + if (properties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property properties in model LoadBalancerFrontendIpConfiguration")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(LoadBalancerFrontendIpConfiguration.class); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LoadBalancerFrontendIpConfigurationProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LoadBalancerFrontendIpConfigurationProperties.java new file mode 100644 index 0000000000000..501153b4f311f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LoadBalancerFrontendIpConfigurationProperties.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a cloud service IP Configuration. */ +@Fluent +public final class LoadBalancerFrontendIpConfigurationProperties { + /* + * The reference to the public ip address resource. + */ + @JsonProperty(value = "publicIPAddress") + private SubResource publicIpAddress; + + /* + * The reference to the virtual network subnet resource. + */ + @JsonProperty(value = "subnet") + private SubResource subnet; + + /* + * The virtual network private IP address of the IP configuration. + */ + @JsonProperty(value = "privateIPAddress") + private String privateIpAddress; + + /** Creates an instance of LoadBalancerFrontendIpConfigurationProperties class. */ + public LoadBalancerFrontendIpConfigurationProperties() { + } + + /** + * Get the publicIpAddress property: The reference to the public ip address resource. + * + * @return the publicIpAddress value. + */ + public SubResource publicIpAddress() { + return this.publicIpAddress; + } + + /** + * Set the publicIpAddress property: The reference to the public ip address resource. + * + * @param publicIpAddress the publicIpAddress value to set. + * @return the LoadBalancerFrontendIpConfigurationProperties object itself. + */ + public LoadBalancerFrontendIpConfigurationProperties withPublicIpAddress(SubResource publicIpAddress) { + this.publicIpAddress = publicIpAddress; + return this; + } + + /** + * Get the subnet property: The reference to the virtual network subnet resource. + * + * @return the subnet value. + */ + public SubResource subnet() { + return this.subnet; + } + + /** + * Set the subnet property: The reference to the virtual network subnet resource. + * + * @param subnet the subnet value to set. + * @return the LoadBalancerFrontendIpConfigurationProperties object itself. + */ + public LoadBalancerFrontendIpConfigurationProperties withSubnet(SubResource subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get the privateIpAddress property: The virtual network private IP address of the IP configuration. + * + * @return the privateIpAddress value. + */ + public String privateIpAddress() { + return this.privateIpAddress; + } + + /** + * Set the privateIpAddress property: The virtual network private IP address of the IP configuration. + * + * @param privateIpAddress the privateIpAddress value to set. + * @return the LoadBalancerFrontendIpConfigurationProperties object itself. + */ + public LoadBalancerFrontendIpConfigurationProperties withPrivateIpAddress(String privateIpAddress) { + this.privateIpAddress = privateIpAddress; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LogAnalytics.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LogAnalytics.java new file mode 100644 index 0000000000000..a943f6149748a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LogAnalytics.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.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.resourcemanager.compute.generated.models.ApiErrorException 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.resourcemanager.compute.generated.models.ApiErrorException 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.resourcemanager.compute.generated.models.ApiErrorException 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.resourcemanager.compute.generated.models.ApiErrorException 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..ae130e90652ed --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LogAnalyticsInputBase.java @@ -0,0 +1,254 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Api input base class for LogAnalytics Api. */ +@Fluent +public class LogAnalyticsInputBase { + /* + * 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; + + /** Creates an instance of LogAnalyticsInputBase class. */ + public LogAnalyticsInputBase() { + } + + /** + * 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")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(LogAnalyticsInputBase.class); +} 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..3024027385b4c --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** LogAnalytics output properties. */ +@Immutable +public final class LogAnalyticsOutput { + /* + * Output file Uri path to blob container. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private String output; + + /** Creates an instance of LogAnalyticsOutput class. */ + public LogAnalyticsOutput() { + } + + /** + * 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..2d4a2a9b7e478 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/MaintenanceOperationResultCodeTypes.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.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** The Last Maintenance Operation Result Code. */ +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) { + if (value == null) { + return null; + } + MaintenanceOperationResultCodeTypes[] items = MaintenanceOperationResultCodeTypes.values(); + for (MaintenanceOperationResultCodeTypes item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @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..de51a17318fcf --- /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.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Maintenance Operation Status. */ +@Fluent +public final class MaintenanceRedeployStatus { + /* + * 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; + + /** Creates an instance of MaintenanceRedeployStatus class. */ + public MaintenanceRedeployStatus() { + } + + /** + * 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/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..f0c7497ff31e6 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ManagedDiskParameters.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code 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.fasterxml.jackson.annotation.JsonProperty; + +/** The parameters of a managed disk. */ +@Fluent +public final class ManagedDiskParameters extends SubResource { + /* + * 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; + + /* + * Specifies the security profile for the managed disk. + */ + @JsonProperty(value = "securityProfile") + private VMDiskSecurityProfile securityProfile; + + /** Creates an instance of ManagedDiskParameters class. */ + public ManagedDiskParameters() { + } + + /** + * 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; + } + + /** + * Get the securityProfile property: Specifies the security profile for the managed disk. + * + * @return the securityProfile value. + */ + public VMDiskSecurityProfile securityProfile() { + return this.securityProfile; + } + + /** + * Set the securityProfile property: Specifies the security profile for the managed disk. + * + * @param securityProfile the securityProfile value to set. + * @return the ManagedDiskParameters object itself. + */ + public ManagedDiskParameters withSecurityProfile(VMDiskSecurityProfile securityProfile) { + this.securityProfile = securityProfile; + 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(); + } + if (securityProfile() != null) { + securityProfile().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..9c6515298264c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/NetworkAccessPolicy.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Policy for accessing the disk via network. */ +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 a new instance of NetworkAccessPolicy value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NetworkAccessPolicy() { + } + + /** + * 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); + } + + /** + * Gets known NetworkAccessPolicy values. + * + * @return known NetworkAccessPolicy values. + */ + public static Collection values() { + return values(NetworkAccessPolicy.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/NetworkApiVersion.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/NetworkApiVersion.java new file mode 100644 index 0000000000000..0a99582f7588f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/NetworkApiVersion.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; + +/** + * specifies the Microsoft.Network API version used when creating networking resources in the Network Interface + * Configurations. + */ +public final class NetworkApiVersion extends ExpandableStringEnum { + /** Static value 2020-11-01 for NetworkApiVersion. */ + public static final NetworkApiVersion TWO_ZERO_TWO_ZERO_ONE_ONE_ZERO_ONE = fromString("2020-11-01"); + + /** + * Creates a new instance of NetworkApiVersion value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NetworkApiVersion() { + } + + /** + * Creates or finds a NetworkApiVersion from its string representation. + * + * @param name a name to look for. + * @return the corresponding NetworkApiVersion. + */ + @JsonCreator + public static NetworkApiVersion fromString(String name) { + return fromString(name, NetworkApiVersion.class); + } + + /** + * Gets known NetworkApiVersion values. + * + * @return known NetworkApiVersion values. + */ + public static Collection values() { + return values(NetworkApiVersion.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/NetworkInterfaceReference.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/NetworkInterfaceReference.java new file mode 100644 index 0000000000000..25123b90eb506 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/NetworkInterfaceReference.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.management.SubResource; +import com.azure.resourcemanager.compute.generated.fluent.models.NetworkInterfaceReferenceProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a network interface reference. */ +@Fluent +public final class NetworkInterfaceReference extends SubResource { + /* + * Describes a network interface reference properties. + */ + @JsonProperty(value = "properties") + private NetworkInterfaceReferenceProperties innerProperties; + + /** Creates an instance of NetworkInterfaceReference class. */ + public NetworkInterfaceReference() { + } + + /** + * Get the innerProperties property: Describes a network interface reference properties. + * + * @return the innerProperties value. + */ + private NetworkInterfaceReferenceProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public NetworkInterfaceReference withId(String id) { + super.withId(id); + 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkInterfaceReferenceProperties(); + } + this.innerProperties().withPrimary(primary); + return this; + } + + /** + * Get the deleteOption property: Specify what happens to the network interface when the VM is deleted. + * + * @return the deleteOption value. + */ + public DeleteOptions deleteOption() { + return this.innerProperties() == null ? null : this.innerProperties().deleteOption(); + } + + /** + * Set the deleteOption property: Specify what happens to the network interface when the VM is deleted. + * + * @param deleteOption the deleteOption value to set. + * @return the NetworkInterfaceReference object itself. + */ + public NetworkInterfaceReference withDeleteOption(DeleteOptions deleteOption) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkInterfaceReferenceProperties(); + } + this.innerProperties().withDeleteOption(deleteOption); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().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..7715660bb14db --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/NetworkProfile.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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Specifies the network interfaces or the networking configuration of the virtual machine. */ +@Fluent +public final class NetworkProfile { + /* + * Specifies the list of resource Ids for the network interfaces associated with the virtual machine. + */ + @JsonProperty(value = "networkInterfaces") + private List networkInterfaces; + + /* + * specifies the Microsoft.Network API version used when creating networking resources in the Network Interface + * Configurations + */ + @JsonProperty(value = "networkApiVersion") + private NetworkApiVersion networkApiVersion; + + /* + * Specifies the networking configurations that will be used to create the virtual machine networking resources. + */ + @JsonProperty(value = "networkInterfaceConfigurations") + private List networkInterfaceConfigurations; + + /** Creates an instance of NetworkProfile class. */ + public NetworkProfile() { + } + + /** + * Get the networkInterfaces property: Specifies the list of resource Ids for the network interfaces associated with + * the virtual machine. + * + * @return the networkInterfaces value. + */ + public List networkInterfaces() { + return this.networkInterfaces; + } + + /** + * Set the networkInterfaces property: Specifies the list of resource Ids for the network interfaces associated with + * the virtual machine. + * + * @param networkInterfaces the networkInterfaces value to set. + * @return the NetworkProfile object itself. + */ + public NetworkProfile withNetworkInterfaces(List networkInterfaces) { + this.networkInterfaces = networkInterfaces; + return this; + } + + /** + * Get the networkApiVersion property: specifies the Microsoft.Network API version used when creating networking + * resources in the Network Interface Configurations. + * + * @return the networkApiVersion value. + */ + public NetworkApiVersion networkApiVersion() { + return this.networkApiVersion; + } + + /** + * Set the networkApiVersion property: specifies the Microsoft.Network API version used when creating networking + * resources in the Network Interface Configurations. + * + * @param networkApiVersion the networkApiVersion value to set. + * @return the NetworkProfile object itself. + */ + public NetworkProfile withNetworkApiVersion(NetworkApiVersion networkApiVersion) { + this.networkApiVersion = networkApiVersion; + return this; + } + + /** + * Get the networkInterfaceConfigurations property: Specifies the networking configurations that will be used to + * create the virtual machine networking resources. + * + * @return the networkInterfaceConfigurations value. + */ + public List networkInterfaceConfigurations() { + return this.networkInterfaceConfigurations; + } + + /** + * Set the networkInterfaceConfigurations property: Specifies the networking configurations that will be used to + * create the virtual machine networking resources. + * + * @param networkInterfaceConfigurations the networkInterfaceConfigurations value to set. + * @return the NetworkProfile object itself. + */ + public NetworkProfile withNetworkInterfaceConfigurations( + List networkInterfaceConfigurations) { + this.networkInterfaceConfigurations = networkInterfaceConfigurations; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (networkInterfaces() != null) { + networkInterfaces().forEach(e -> e.validate()); + } + if (networkInterfaceConfigurations() != null) { + networkInterfaceConfigurations().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSDisk.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSDisk.java new file mode 100644 index 0000000000000..4ee1c5ad765ad --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSDisk.java @@ -0,0 +1,409 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifies information about the operating system disk used by the virtual machine. For more information about disks, + * see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). + */ +@Fluent +public final class OSDisk { + /* + * 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.** The defaulting + * behavior is: **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.** This value is used when + * you are using a specialized disk to create the virtual machine. **FromImage.** This value is used when you are + * using an image to create the virtual machine. If you are using a platform image, you should also use the + * imageReference element described above. If you are using a marketplace image, you should 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. The property 'diskSizeGB' is the number of bytes x 1024^3 for the disk and the + * value cannot be larger than 1023. + */ + @JsonProperty(value = "diskSizeGB") + private Integer diskSizeGB; + + /* + * The managed disk parameters. + */ + @JsonProperty(value = "managedDisk") + private ManagedDiskParameters managedDisk; + + /* + * Specifies whether OS Disk should be deleted or detached upon VM deletion. Possible values are: **Delete.** If + * this value is used, the OS disk is deleted when VM is deleted. **Detach.** If this value is used, the os disk is + * retained after VM is deleted. The default value is set to **Detach**. For an ephemeral OS Disk, the default + * value is set to **Delete**. The user cannot change the delete option for an ephemeral OS Disk. + */ + @JsonProperty(value = "deleteOption") + private DiskDeleteOptionTypes deleteOption; + + /** Creates an instance of OSDisk class. */ + public OSDisk() { + } + + /** + * 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. Possible values are: **Windows,** **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. Possible values are: **Windows,** **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. 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. 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. Possible values are: **None,** **ReadOnly,** + * **ReadWrite.** The defaulting behavior is: **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. Possible values are: **None,** **ReadOnly,** + * **ReadWrite.** The defaulting behavior is: **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. Possible values are: + * **Attach.** This value is used when you are using a specialized disk to create the virtual machine. + * **FromImage.** This value is used when you are using an image to create the virtual machine. If you are using a + * platform image, you should also use the imageReference element described above. If you are using a marketplace + * image, you should 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. Possible values are: + * **Attach.** This value is used when you are using a specialized disk to create the virtual machine. + * **FromImage.** This value is used when you are using an image to create the virtual machine. If you are using a + * platform image, you should also use the imageReference element described above. If you are using a marketplace + * image, you should 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. The property 'diskSizeGB' is the number of bytes x + * 1024^3 for the disk and the value cannot be larger than 1023. + * + * @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. The property 'diskSizeGB' is the number of bytes x + * 1024^3 for the disk and the value cannot be larger than 1023. + * + * @param diskSizeGB the diskSizeGB value to set. + * @return the OSDisk object itself. + */ + public OSDisk withDiskSizeGB(Integer diskSizeGB) { + this.diskSizeGB = diskSizeGB; + return this; + } + + /** + * Get the managedDisk property: The managed disk parameters. + * + * @return the managedDisk value. + */ + public ManagedDiskParameters managedDisk() { + return this.managedDisk; + } + + /** + * Set the managedDisk property: The managed disk parameters. + * + * @param managedDisk the managedDisk value to set. + * @return the OSDisk object itself. + */ + public OSDisk withManagedDisk(ManagedDiskParameters managedDisk) { + this.managedDisk = managedDisk; + return this; + } + + /** + * Get the deleteOption property: Specifies whether OS Disk should be deleted or detached upon VM deletion. Possible + * values are: **Delete.** If this value is used, the OS disk is deleted when VM is deleted. **Detach.** If this + * value is used, the os disk is retained after VM is deleted. The default value is set to **Detach**. For an + * ephemeral OS Disk, the default value is set to **Delete**. The user cannot change the delete option for an + * ephemeral OS Disk. + * + * @return the deleteOption value. + */ + public DiskDeleteOptionTypes deleteOption() { + return this.deleteOption; + } + + /** + * Set the deleteOption property: Specifies whether OS Disk should be deleted or detached upon VM deletion. Possible + * values are: **Delete.** If this value is used, the OS disk is deleted when VM is deleted. **Detach.** If this + * value is used, the os disk is retained after VM is deleted. The default value is set to **Detach**. For an + * ephemeral OS Disk, the default value is set to **Delete**. The user cannot change the delete option for an + * ephemeral OS Disk. + * + * @param deleteOption the deleteOption value to set. + * @return the OSDisk object itself. + */ + public OSDisk withDeleteOption(DiskDeleteOptionTypes deleteOption) { + this.deleteOption = deleteOption; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (encryptionSettings() != null) { + encryptionSettings().validate(); + } + if (vhd() != null) { + vhd().validate(); + } + if (image() != null) { + image().validate(); + } + if (diffDiskSettings() != null) { + diffDiskSettings().validate(); + } + if (createOption() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property createOption in model OSDisk")); + } + if (managedDisk() != null) { + managedDisk().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(OSDisk.class); +} 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..e2604e965006a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSDiskImage.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.JsonProperty; + +/** Contains the os disk image information. */ +@Fluent +public final class OSDiskImage { + /* + * The operating system of the osDiskImage. + */ + @JsonProperty(value = "operatingSystem", required = true) + private OperatingSystemTypes operatingSystem; + + /** Creates an instance of OSDiskImage class. */ + public OSDiskImage() { + } + + /** + * 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")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(OSDiskImage.class); +} 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..1f4fec814a92b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSDiskImageEncryption.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.fasterxml.jackson.annotation.JsonProperty; + +/** Contains encryption settings for an OS disk image. */ +@Fluent +public final class OSDiskImageEncryption extends DiskImageEncryption { + /* + * This property specifies the security profile of an OS disk image. + */ + @JsonProperty(value = "securityProfile") + private OSDiskImageSecurityProfile securityProfile; + + /** Creates an instance of OSDiskImageEncryption class. */ + public OSDiskImageEncryption() { + } + + /** + * Get the securityProfile property: This property specifies the security profile of an OS disk image. + * + * @return the securityProfile value. + */ + public OSDiskImageSecurityProfile securityProfile() { + return this.securityProfile; + } + + /** + * Set the securityProfile property: This property specifies the security profile of an OS disk image. + * + * @param securityProfile the securityProfile value to set. + * @return the OSDiskImageEncryption object itself. + */ + public OSDiskImageEncryption withSecurityProfile(OSDiskImageSecurityProfile securityProfile) { + this.securityProfile = securityProfile; + return this; + } + + /** {@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(); + if (securityProfile() != null) { + securityProfile().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSDiskImageSecurityProfile.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSDiskImageSecurityProfile.java new file mode 100644 index 0000000000000..88cacbf322132 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSDiskImageSecurityProfile.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Contains security profile for an OS disk image. */ +@Fluent +public final class OSDiskImageSecurityProfile { + /* + * confidential VM encryption types + */ + @JsonProperty(value = "confidentialVMEncryptionType") + private ConfidentialVMEncryptionType confidentialVMEncryptionType; + + /* + * secure VM disk encryption set id + */ + @JsonProperty(value = "secureVMDiskEncryptionSetId") + private String secureVMDiskEncryptionSetId; + + /** Creates an instance of OSDiskImageSecurityProfile class. */ + public OSDiskImageSecurityProfile() { + } + + /** + * Get the confidentialVMEncryptionType property: confidential VM encryption types. + * + * @return the confidentialVMEncryptionType value. + */ + public ConfidentialVMEncryptionType confidentialVMEncryptionType() { + return this.confidentialVMEncryptionType; + } + + /** + * Set the confidentialVMEncryptionType property: confidential VM encryption types. + * + * @param confidentialVMEncryptionType the confidentialVMEncryptionType value to set. + * @return the OSDiskImageSecurityProfile object itself. + */ + public OSDiskImageSecurityProfile withConfidentialVMEncryptionType( + ConfidentialVMEncryptionType confidentialVMEncryptionType) { + this.confidentialVMEncryptionType = confidentialVMEncryptionType; + return this; + } + + /** + * Get the secureVMDiskEncryptionSetId property: secure VM disk encryption set id. + * + * @return the secureVMDiskEncryptionSetId value. + */ + public String secureVMDiskEncryptionSetId() { + return this.secureVMDiskEncryptionSetId; + } + + /** + * Set the secureVMDiskEncryptionSetId property: secure VM disk encryption set id. + * + * @param secureVMDiskEncryptionSetId the secureVMDiskEncryptionSetId value to set. + * @return the OSDiskImageSecurityProfile object itself. + */ + public OSDiskImageSecurityProfile withSecureVMDiskEncryptionSetId(String secureVMDiskEncryptionSetId) { + this.secureVMDiskEncryptionSetId = secureVMDiskEncryptionSetId; + 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/OSFamily.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSFamily.java new file mode 100644 index 0000000000000..2ea532fe1585b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSFamily.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.resourcemanager.compute.generated.fluent.models.OSFamilyInner; + +/** An immutable client-side representation of OSFamily. */ +public interface OSFamily { + /** + * Gets the id property: Resource Id. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: Resource name. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: Resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: Resource location. + * + * @return the location value. + */ + String location(); + + /** + * Gets the properties property: OS family properties. + * + * @return the properties value. + */ + OSFamilyProperties properties(); + + /** + * Gets the inner com.azure.resourcemanager.compute.generated.fluent.models.OSFamilyInner object. + * + * @return the inner object. + */ + OSFamilyInner innerModel(); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSFamilyListResult.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSFamilyListResult.java new file mode 100644 index 0000000000000..361e61be25263 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSFamilyListResult.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.azure.resourcemanager.compute.generated.fluent.models.OSFamilyInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list operation result. */ +@Fluent +public final class OSFamilyListResult { + /* + * The list of resources. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The URI to fetch the next page of resources. Use this to get the next page of resources. Do this till nextLink + * is null to fetch all the resources. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of OSFamilyListResult class. */ + public OSFamilyListResult() { + } + + /** + * Get the value property: The list of resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of resources. + * + * @param value the value value to set. + * @return the OSFamilyListResult object itself. + */ + public OSFamilyListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URI to fetch the next page of resources. Use this to get the next page of + * resources. Do this till nextLink is null to fetch all the resources. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URI to fetch the next page of resources. Use this to get the next page of + * resources. Do this till nextLink is null to fetch all the resources. + * + * @param nextLink the nextLink value to set. + * @return the OSFamilyListResult object itself. + */ + public OSFamilyListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model OSFamilyListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(OSFamilyListResult.class); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSFamilyProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSFamilyProperties.java new file mode 100644 index 0000000000000..f64e281089a2d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSFamilyProperties.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** OS family properties. */ +@Immutable +public final class OSFamilyProperties { + /* + * The OS family name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The OS family label. + */ + @JsonProperty(value = "label", access = JsonProperty.Access.WRITE_ONLY) + private String label; + + /* + * List of OS versions belonging to this family. + */ + @JsonProperty(value = "versions", access = JsonProperty.Access.WRITE_ONLY) + private List versions; + + /** Creates an instance of OSFamilyProperties class. */ + public OSFamilyProperties() { + } + + /** + * Get the name property: The OS family name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the label property: The OS family label. + * + * @return the label value. + */ + public String label() { + return this.label; + } + + /** + * Get the versions property: List of OS versions belonging to this family. + * + * @return the versions value. + */ + public List versions() { + return this.versions; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (versions() != null) { + versions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSImageNotificationProfile.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSImageNotificationProfile.java new file mode 100644 index 0000000000000..ec871dc7944f5 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSImageNotificationProfile.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.fasterxml.jackson.annotation.JsonProperty; + +/** The OSImageNotificationProfile model. */ +@Fluent +public final class OSImageNotificationProfile { + /* + * Length of time a Virtual Machine being reimaged or having its OS upgraded will have to potentially approve the + * OS Image Scheduled Event before the event is auto approved (timed out). The configuration is specified in ISO + * 8601 format, and the value must be 15 minutes (PT15M) + */ + @JsonProperty(value = "notBeforeTimeout") + private String notBeforeTimeout; + + /* + * Specifies whether the OS Image Scheduled event is enabled or disabled. + */ + @JsonProperty(value = "enable") + private Boolean enable; + + /** Creates an instance of OSImageNotificationProfile class. */ + public OSImageNotificationProfile() { + } + + /** + * Get the notBeforeTimeout property: Length of time a Virtual Machine being reimaged or having its OS upgraded will + * have to potentially approve the OS Image Scheduled Event before the event is auto approved (timed out). The + * configuration is specified in ISO 8601 format, and the value must be 15 minutes (PT15M). + * + * @return the notBeforeTimeout value. + */ + public String notBeforeTimeout() { + return this.notBeforeTimeout; + } + + /** + * Set the notBeforeTimeout property: Length of time a Virtual Machine being reimaged or having its OS upgraded will + * have to potentially approve the OS Image Scheduled Event before the event is auto approved (timed out). The + * configuration is specified in ISO 8601 format, and the value must be 15 minutes (PT15M). + * + * @param notBeforeTimeout the notBeforeTimeout value to set. + * @return the OSImageNotificationProfile object itself. + */ + public OSImageNotificationProfile withNotBeforeTimeout(String notBeforeTimeout) { + this.notBeforeTimeout = notBeforeTimeout; + return this; + } + + /** + * Get the enable property: Specifies whether the OS Image Scheduled event is enabled or disabled. + * + * @return the enable value. + */ + public Boolean enable() { + return this.enable; + } + + /** + * Set the enable property: Specifies whether the OS Image Scheduled event is enabled or disabled. + * + * @param enable the enable value to set. + * @return the OSImageNotificationProfile object itself. + */ + public OSImageNotificationProfile 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/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..29904269fb36a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSProfile.java @@ -0,0 +1,368 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +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 { + /* + * Specifies the host OS name of the virtual machine. This name cannot be updated after the VM is created. + * **Max-length (Windows):** 15 characters. **Max-length (Linux):** 64 characters. For naming conventions and + * restrictions see [Azure infrastructure services implementation + * guidelines](https://docs.microsoft.com/azure/azure-resource-manager/management/resource-name-rules). + */ + @JsonProperty(value = "computerName") + private String computerName; + + /* + * Specifies the name of the administrator account.

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

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

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

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

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

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

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

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

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

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

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

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

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

For resetting root + * password, see [Manage users, SSH, and check or repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection) + */ + @JsonProperty(value = "adminPassword") + private String adminPassword; + + /* + * Specifies a base-64 encoded string of custom data. The base-64 encoded string is decoded to a binary array that + * is saved as a file on the Virtual Machine. The maximum length of the binary array is 65535 bytes. **Note: Do not + * pass any secrets or passwords in customData property.** This property cannot be updated after the VM is created. + * The property 'customData' is passed to the VM to be saved as a file, for more information see [Custom Data on + * Azure VMs](https://azure.microsoft.com/blog/custom-data-and-cloud-init-on-windows-azure/). For using cloud-init + * for your Linux VM, see [Using cloud-init to customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/linux/using-cloud-init). + */ + @JsonProperty(value = "customData") + private String customData; + + /* + * Specifies Windows operating system settings on the virtual machine. + */ + @JsonProperty(value = "windowsConfiguration") + private WindowsConfiguration windowsConfiguration; + + /* + * Specifies the Linux operating system settings on the virtual machine. For a list of supported Linux + * distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/linux/endorsed-distros). + */ + @JsonProperty(value = "linuxConfiguration") + private LinuxConfiguration linuxConfiguration; + + /* + * Specifies set of certificates that should be installed onto the virtual machine. To install certificates on a + * virtual machine it is recommended to use the [Azure Key Vault virtual machine extension for + * Linux](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux) or the [Azure Key Vault + * virtual machine extension for + * Windows](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows). + */ + @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; + + /* + * Optional property which must either be set to True or omitted. + */ + @JsonProperty(value = "requireGuestProvisionSignal") + private Boolean requireGuestProvisionSignal; + + /** Creates an instance of OSProfile class. */ + public OSProfile() { + } + + /** + * Get the computerName property: Specifies the host OS name of the virtual machine. This name cannot be updated + * after the VM is created. **Max-length (Windows):** 15 characters. **Max-length (Linux):** 64 characters. For + * naming conventions and restrictions see [Azure infrastructure services implementation + * guidelines](https://docs.microsoft.com/azure/azure-resource-manager/management/resource-name-rules). + * + * @return the computerName value. + */ + public String computerName() { + return this.computerName; + } + + /** + * Set the computerName property: Specifies the host OS name of the virtual machine. This name cannot be updated + * after the VM is created. **Max-length (Windows):** 15 characters. **Max-length (Linux):** 64 characters. For + * naming conventions and restrictions see [Azure infrastructure services implementation + * guidelines](https://docs.microsoft.com/azure/azure-resource-manager/management/resource-name-rules). + * + * @param computerName the computerName value to set. + * @return the OSProfile object itself. + */ + public OSProfile withComputerName(String computerName) { + this.computerName = computerName; + return this; + } + + /** + * Get the adminUsername property: Specifies the name of the administrator account. <br><br> This + * property cannot be updated after the VM is created. <br><br> **Windows-only restriction:** Cannot end + * in "." <br><br> **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", + * "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", + * "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", + * "user4", "user5". <br><br> **Minimum-length (Linux):** 1 character <br><br> **Max-length + * (Linux):** 64 characters <br><br> **Max-length (Windows):** 20 characters. + * + * @return the adminUsername value. + */ + public String adminUsername() { + return this.adminUsername; + } + + /** + * Set the adminUsername property: Specifies the name of the administrator account. <br><br> This + * property cannot be updated after the VM is created. <br><br> **Windows-only restriction:** Cannot end + * in "." <br><br> **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", + * "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", + * "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", + * "user4", "user5". <br><br> **Minimum-length (Linux):** 1 character <br><br> **Max-length + * (Linux):** 64 characters <br><br> **Max-length (Windows):** 20 characters. + * + * @param adminUsername the adminUsername value to set. + * @return the OSProfile object itself. + */ + public OSProfile withAdminUsername(String adminUsername) { + this.adminUsername = adminUsername; + return this; + } + + /** + * Get the adminPassword property: Specifies the password of the administrator account. <br><br> + * **Minimum-length (Windows):** 8 characters <br><br> **Minimum-length (Linux):** 6 characters + * <br><br> **Max-length (Windows):** 123 characters <br><br> **Max-length (Linux):** 72 + * characters <br><br> **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled + * <br> Has lower characters <br>Has upper characters <br> Has a digit <br> Has a special + * character (Regex match [\W_]) <br><br> **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", + * "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!" <br><br> + * For resetting the password, see [How to reset the Remote Desktop service or its login password in a Windows + * VM](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/reset-rdp) <br><br> For resetting + * root password, see [Manage users, SSH, and check or repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection). + * + * @return the adminPassword value. + */ + public String adminPassword() { + return this.adminPassword; + } + + /** + * Set the adminPassword property: Specifies the password of the administrator account. <br><br> + * **Minimum-length (Windows):** 8 characters <br><br> **Minimum-length (Linux):** 6 characters + * <br><br> **Max-length (Windows):** 123 characters <br><br> **Max-length (Linux):** 72 + * characters <br><br> **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled + * <br> Has lower characters <br>Has upper characters <br> Has a digit <br> Has a special + * character (Regex match [\W_]) <br><br> **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", + * "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!" <br><br> + * For resetting the password, see [How to reset the Remote Desktop service or its login password in a Windows + * VM](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/reset-rdp) <br><br> For resetting + * root password, see [Manage users, SSH, and check or repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection). + * + * @param adminPassword the adminPassword value to set. + * @return the OSProfile object itself. + */ + public OSProfile withAdminPassword(String adminPassword) { + this.adminPassword = adminPassword; + return this; + } + + /** + * Get the customData property: Specifies a base-64 encoded string of custom data. The base-64 encoded string is + * decoded to a binary array that is saved as a file on the Virtual Machine. The maximum length of the binary array + * is 65535 bytes. **Note: Do not pass any secrets or passwords in customData property.** This property cannot be + * updated after the VM is created. The property 'customData' is passed to the VM to be saved as a file, for more + * information see [Custom Data on Azure + * VMs](https://azure.microsoft.com/blog/custom-data-and-cloud-init-on-windows-azure/). For using cloud-init for + * your Linux VM, see [Using cloud-init to customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/linux/using-cloud-init). + * + * @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. **Note: Do not pass any secrets or passwords in customData property.** This property cannot be + * updated after the VM is created. The property 'customData' is passed to the VM to be saved as a file, for more + * information see [Custom Data on Azure + * VMs](https://azure.microsoft.com/blog/custom-data-and-cloud-init-on-windows-azure/). For using cloud-init for + * your Linux VM, see [Using cloud-init to customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/linux/using-cloud-init). + * + * @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. For a + * list of supported Linux distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/linux/endorsed-distros). + * + * @return the linuxConfiguration value. + */ + public LinuxConfiguration linuxConfiguration() { + return this.linuxConfiguration; + } + + /** + * Set the linuxConfiguration property: Specifies the Linux operating system settings on the virtual machine. For a + * list of supported Linux distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/linux/endorsed-distros). + * + * @param linuxConfiguration the linuxConfiguration value to set. + * @return the OSProfile object itself. + */ + public OSProfile withLinuxConfiguration(LinuxConfiguration linuxConfiguration) { + this.linuxConfiguration = linuxConfiguration; + return this; + } + + /** + * Get the secrets property: Specifies set of certificates that should be installed onto the virtual machine. To + * install certificates on a virtual machine it is recommended to use the [Azure Key Vault virtual machine extension + * for Linux](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux) or the [Azure Key Vault + * virtual machine extension for + * Windows](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows). + * + * @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. To + * install certificates on a virtual machine it is recommended to use the [Azure Key Vault virtual machine extension + * for Linux](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux) or the [Azure Key Vault + * virtual machine extension for + * Windows](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows). + * + * @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. 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. 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: Optional property which must either be set to True or omitted. + * + * @return the requireGuestProvisionSignal value. + */ + public Boolean requireGuestProvisionSignal() { + return this.requireGuestProvisionSignal; + } + + /** + * Set the requireGuestProvisionSignal property: Optional property which must either be set to True or omitted. + * + * @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/OSProfileProvisioningData.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSProfileProvisioningData.java new file mode 100644 index 0000000000000..6dae6dc9e0225 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSProfileProvisioningData.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.fasterxml.jackson.annotation.JsonProperty; + +/** Additional parameters for Reimaging Non-Ephemeral Virtual Machine. */ +@Fluent +public final class OSProfileProvisioningData { + /* + * Specifies the password of the administrator account.

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

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

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

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

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

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

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

For resetting root + * password, see [Manage users, SSH, and check or repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection) + */ + @JsonProperty(value = "adminPassword") + private String adminPassword; + + /* + * Specifies a base-64 encoded string of custom data. The base-64 encoded string is decoded to a binary array that + * is saved as a file on the Virtual Machine. The maximum length of the binary array is 65535 bytes. **Note: Do not + * pass any secrets or passwords in customData property.** This property cannot be updated after the VM is created. + * The property customData is passed to the VM to be saved as a file, for more information see [Custom Data on + * Azure VMs](https://azure.microsoft.com/blog/custom-data-and-cloud-init-on-windows-azure/). If using cloud-init + * for your Linux VM, see [Using cloud-init to customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/linux/using-cloud-init). + */ + @JsonProperty(value = "customData") + private String customData; + + /** Creates an instance of OSProfileProvisioningData class. */ + public OSProfileProvisioningData() { + } + + /** + * Get the adminPassword property: Specifies the password of the administrator account. <br><br> + * **Minimum-length (Windows):** 8 characters <br><br> **Minimum-length (Linux):** 6 characters + * <br><br> **Max-length (Windows):** 123 characters <br><br> **Max-length (Linux):** 72 + * characters <br><br> **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled + * <br> Has lower characters <br>Has upper characters <br> Has a digit <br> Has a special + * character (Regex match [\W_]) <br><br> **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", + * "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!" <br><br> + * For resetting the password, see [How to reset the Remote Desktop service or its login password in a Windows + * VM](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/reset-rdp) <br><br> For resetting + * root password, see [Manage users, SSH, and check or repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection). + * + * @return the adminPassword value. + */ + public String adminPassword() { + return this.adminPassword; + } + + /** + * Set the adminPassword property: Specifies the password of the administrator account. <br><br> + * **Minimum-length (Windows):** 8 characters <br><br> **Minimum-length (Linux):** 6 characters + * <br><br> **Max-length (Windows):** 123 characters <br><br> **Max-length (Linux):** 72 + * characters <br><br> **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled + * <br> Has lower characters <br>Has upper characters <br> Has a digit <br> Has a special + * character (Regex match [\W_]) <br><br> **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", + * "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!" <br><br> + * For resetting the password, see [How to reset the Remote Desktop service or its login password in a Windows + * VM](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/reset-rdp) <br><br> For resetting + * root password, see [Manage users, SSH, and check or repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection). + * + * @param adminPassword the adminPassword value to set. + * @return the OSProfileProvisioningData object itself. + */ + public OSProfileProvisioningData 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. **Note: Do not pass any secrets or passwords in customData property.** This property cannot be + * updated after the VM is created. The property customData is passed to the VM to be saved as a file, for more + * information see [Custom Data on Azure + * VMs](https://azure.microsoft.com/blog/custom-data-and-cloud-init-on-windows-azure/). If using cloud-init for your + * Linux VM, see [Using cloud-init to customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/linux/using-cloud-init). + * + * @return the customData value. + */ + public String customData() { + return this.customData; + } + + /** + * Set the customData property: Specifies a base-64 encoded string of custom data. The base-64 encoded string is + * decoded to a binary array that is saved as a file on the Virtual Machine. The maximum length of the binary array + * is 65535 bytes. **Note: Do not pass any secrets or passwords in customData property.** This property cannot be + * updated after the VM is created. The property customData is passed to the VM to be saved as a file, for more + * information see [Custom Data on Azure + * VMs](https://azure.microsoft.com/blog/custom-data-and-cloud-init-on-windows-azure/). If using cloud-init for your + * Linux VM, see [Using cloud-init to customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/linux/using-cloud-init). + * + * @param customData the customData value to set. + * @return the OSProfileProvisioningData object itself. + */ + public OSProfileProvisioningData withCustomData(String customData) { + this.customData = customData; + 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/OSVersion.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSVersion.java new file mode 100644 index 0000000000000..b423efad99d64 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSVersion.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.resourcemanager.compute.generated.fluent.models.OSVersionInner; + +/** An immutable client-side representation of OSVersion. */ +public interface OSVersion { + /** + * Gets the id property: Resource Id. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: Resource name. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: Resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: Resource location. + * + * @return the location value. + */ + String location(); + + /** + * Gets the properties property: OS version properties. + * + * @return the properties value. + */ + OSVersionProperties properties(); + + /** + * Gets the inner com.azure.resourcemanager.compute.generated.fluent.models.OSVersionInner object. + * + * @return the inner object. + */ + OSVersionInner innerModel(); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSVersionListResult.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSVersionListResult.java new file mode 100644 index 0000000000000..ae9c6180e68cf --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSVersionListResult.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.azure.resourcemanager.compute.generated.fluent.models.OSVersionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list operation result. */ +@Fluent +public final class OSVersionListResult { + /* + * The list of resources. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The URI to fetch the next page of resources. Use this to get the next page of resources. Do this till nextLink + * is null to fetch all the resources. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of OSVersionListResult class. */ + public OSVersionListResult() { + } + + /** + * Get the value property: The list of resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of resources. + * + * @param value the value value to set. + * @return the OSVersionListResult object itself. + */ + public OSVersionListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URI to fetch the next page of resources. Use this to get the next page of + * resources. Do this till nextLink is null to fetch all the resources. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URI to fetch the next page of resources. Use this to get the next page of + * resources. Do this till nextLink is null to fetch all the resources. + * + * @param nextLink the nextLink value to set. + * @return the OSVersionListResult object itself. + */ + public OSVersionListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model OSVersionListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(OSVersionListResult.class); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSVersionProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSVersionProperties.java new file mode 100644 index 0000000000000..e2f03a09beedd --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSVersionProperties.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** OS version properties. */ +@Immutable +public final class OSVersionProperties { + /* + * The family of this OS version. + */ + @JsonProperty(value = "family", access = JsonProperty.Access.WRITE_ONLY) + private String family; + + /* + * The family label of this OS version. + */ + @JsonProperty(value = "familyLabel", access = JsonProperty.Access.WRITE_ONLY) + private String familyLabel; + + /* + * The OS version. + */ + @JsonProperty(value = "version", access = JsonProperty.Access.WRITE_ONLY) + private String version; + + /* + * The OS version label. + */ + @JsonProperty(value = "label", access = JsonProperty.Access.WRITE_ONLY) + private String label; + + /* + * Specifies whether this is the default OS version for its family. + */ + @JsonProperty(value = "isDefault", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isDefault; + + /* + * Specifies whether this OS version is active. + */ + @JsonProperty(value = "isActive", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isActive; + + /** Creates an instance of OSVersionProperties class. */ + public OSVersionProperties() { + } + + /** + * Get the family property: The family of this OS version. + * + * @return the family value. + */ + public String family() { + return this.family; + } + + /** + * Get the familyLabel property: The family label of this OS version. + * + * @return the familyLabel value. + */ + public String familyLabel() { + return this.familyLabel; + } + + /** + * Get the version property: The OS version. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Get the label property: The OS version label. + * + * @return the label value. + */ + public String label() { + return this.label; + } + + /** + * Get the isDefault property: Specifies whether this is the default OS version for its family. + * + * @return the isDefault value. + */ + public Boolean isDefault() { + return this.isDefault; + } + + /** + * Get the isActive property: Specifies whether this OS version is active. + * + * @return the isActive value. + */ + public Boolean isActive() { + return this.isActive; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSVersionPropertiesBase.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSVersionPropertiesBase.java new file mode 100644 index 0000000000000..2ffec049c6583 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSVersionPropertiesBase.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Configuration view of an OS version. */ +@Immutable +public final class OSVersionPropertiesBase { + /* + * The OS version. + */ + @JsonProperty(value = "version", access = JsonProperty.Access.WRITE_ONLY) + private String version; + + /* + * The OS version label. + */ + @JsonProperty(value = "label", access = JsonProperty.Access.WRITE_ONLY) + private String label; + + /* + * Specifies whether this is the default OS version for its family. + */ + @JsonProperty(value = "isDefault", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isDefault; + + /* + * Specifies whether this OS version is active. + */ + @JsonProperty(value = "isActive", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isActive; + + /** Creates an instance of OSVersionPropertiesBase class. */ + public OSVersionPropertiesBase() { + } + + /** + * Get the version property: The OS version. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Get the label property: The OS version label. + * + * @return the label value. + */ + public String label() { + return this.label; + } + + /** + * Get the isDefault property: Specifies whether this is the default OS version for its family. + * + * @return the isDefault value. + */ + public Boolean isDefault() { + return this.isDefault; + } + + /** + * Get the isActive property: Specifies whether this OS version is active. + * + * @return the isActive value. + */ + public Boolean isActive() { + return this.isActive; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OperatingSystemStateTypes.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OperatingSystemStateTypes.java new file mode 100644 index 0000000000000..fc1819ec8e536 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OperatingSystemStateTypes.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.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * This property allows the user to specify whether the virtual machines created under this image are 'Generalized' or + * 'Specialized'. + */ +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) { + if (value == null) { + return null; + } + OperatingSystemStateTypes[] items = OperatingSystemStateTypes.values(); + for (OperatingSystemStateTypes item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OperatingSystemType.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OperatingSystemType.java new file mode 100644 index 0000000000000..c76901974da1b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OperatingSystemType.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; + +/** Gets the Operating System type. */ +public final class OperatingSystemType extends ExpandableStringEnum { + /** Static value Windows for OperatingSystemType. */ + public static final OperatingSystemType WINDOWS = fromString("Windows"); + + /** Static value Linux for OperatingSystemType. */ + public static final OperatingSystemType LINUX = fromString("Linux"); + + /** + * Creates a new instance of OperatingSystemType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public OperatingSystemType() { + } + + /** + * Creates or finds a OperatingSystemType from its string representation. + * + * @param name a name to look for. + * @return the corresponding OperatingSystemType. + */ + @JsonCreator + public static OperatingSystemType fromString(String name) { + return fromString(name, OperatingSystemType.class); + } + + /** + * Gets known OperatingSystemType values. + * + * @return known OperatingSystemType values. + */ + public static Collection values() { + return values(OperatingSystemType.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OperatingSystemTypes.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OperatingSystemTypes.java new file mode 100644 index 0000000000000..8cf65f0ac6069 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OperatingSystemTypes.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.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * 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**. + */ +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) { + if (value == null) { + return null; + } + OperatingSystemTypes[] items = OperatingSystemTypes.values(); + for (OperatingSystemTypes item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @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..de78eb88e73ee --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Operations.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.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.resourcemanager.compute.generated.models.ApiErrorException thrown if 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 as paginated response with {@link PagedIterable}. + */ + 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.resourcemanager.compute.generated.models.ApiErrorException thrown if 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 as paginated response with {@link PagedIterable}. + */ + 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..cbd0ba02a6631 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OrchestrationMode.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; + +/** Specifies the orchestration mode for the virtual machine scale set. */ +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 a new instance of OrchestrationMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public OrchestrationMode() { + } + + /** + * 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); + } + + /** + * Gets known OrchestrationMode values. + * + * @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..ccd00a947f2eb --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OrchestrationServiceNames.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The name of the service. */ +public final class OrchestrationServiceNames extends ExpandableStringEnum { + /** Static value AutomaticRepairs for OrchestrationServiceNames. */ + public static final OrchestrationServiceNames AUTOMATIC_REPAIRS = fromString("AutomaticRepairs"); + + /** + * Creates a new instance of OrchestrationServiceNames value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public OrchestrationServiceNames() { + } + + /** + * 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); + } + + /** + * Gets known OrchestrationServiceNames values. + * + * @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..ec6ce79f5378a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OrchestrationServiceState.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The current state of the service. */ +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 a new instance of OrchestrationServiceState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public OrchestrationServiceState() { + } + + /** + * 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); + } + + /** + * Gets known OrchestrationServiceState values. + * + * @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..b1fa9fdbbf99f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OrchestrationServiceStateAction.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; + +/** The action to be performed. */ +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 a new instance of OrchestrationServiceStateAction value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public OrchestrationServiceStateAction() { + } + + /** + * 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); + } + + /** + * Gets known OrchestrationServiceStateAction values. + * + * @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..67f0dc611fa0b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OrchestrationServiceStateInput.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.JsonProperty; + +/** The input for OrchestrationServiceState. */ +@Fluent +public final class OrchestrationServiceStateInput { + /* + * 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; + + /** Creates an instance of OrchestrationServiceStateInput class. */ + public OrchestrationServiceStateInput() { + } + + /** + * 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")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(OrchestrationServiceStateInput.class); +} 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..98d13d1d3dfd6 --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** Summary for an orchestration service of a virtual machine scale set. */ +@Immutable +public final class OrchestrationServiceSummary { + /* + * 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; + + /** Creates an instance of OrchestrationServiceSummary class. */ + public OrchestrationServiceSummary() { + } + + /** + * 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..dfa51b4ff4928 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PassNames.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** The pass name. Currently, the only allowable value is OobeSystem. */ +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) { + if (value == null) { + return null; + } + PassNames[] items = PassNames.values(); + for (PassNames item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @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..ec6c95c646506 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PatchAssessmentState.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; + +/** Describes the availability of a given patch. */ +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 a new instance of PatchAssessmentState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PatchAssessmentState() { + } + + /** + * 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); + } + + /** + * Gets known PatchAssessmentState values. + * + * @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..2b8be2c0a3ee5 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PatchInstallationDetail.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.models; + +import com.azure.core.annotation.Immutable; +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 { + /* + * 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; + + /** Creates an instance of PatchInstallationDetail class. */ + public PatchInstallationDetail() { + } + + /** + * 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..4af4f049076b7 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PatchInstallationState.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The state of the patch after the installation operation completed. */ +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 a new instance of PatchInstallationState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PatchInstallationState() { + } + + /** + * 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); + } + + /** + * Gets known PatchInstallationState values. + * + * @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..36603e9691d0e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PatchOperationStatus.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * 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.". + */ +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 a new instance of PatchOperationStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PatchOperationStatus() { + } + + /** + * 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); + } + + /** + * Gets known PatchOperationStatus values. + * + * @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..587caafe66807 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PatchSettings.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.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Specifies settings related to VM Guest Patching on Windows. */ +@Fluent +public final class PatchSettings { + /* + * Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual machines associated to virtual + * machine scale set with OrchestrationMode as Flexible.

Possible values are:

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

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

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

Possible values + * are:

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

**AutomaticByPlatform** - The platform will trigger periodic patch assessments. The property provisionVMAgent + * must be true. + */ + @JsonProperty(value = "assessmentMode") + private WindowsPatchAssessmentMode assessmentMode; + + /* + * Specifies additional settings for patch mode AutomaticByPlatform in VM Guest Patching on Windows. + */ + @JsonProperty(value = "automaticByPlatformSettings") + private WindowsVMGuestPatchAutomaticByPlatformSettings automaticByPlatformSettings; + + /** Creates an instance of PatchSettings class. */ + public PatchSettings() { + } + + /** + * Get the patchMode property: Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual machines + * associated to virtual machine scale set with OrchestrationMode as Flexible.<br /><br /> Possible + * values are:<br /><br /> **Manual** - You control the application of patches to a virtual machine. You + * do this by applying patches manually inside the VM. In this mode, automatic updates are disabled; the property + * WindowsConfiguration.enableAutomaticUpdates must be false<br /><br /> **AutomaticByOS** - The virtual + * machine will automatically be updated by the OS. The property WindowsConfiguration.enableAutomaticUpdates must be + * true. <br /><br /> **AutomaticByPlatform** - the virtual machine will automatically updated by the + * platform. The properties provisionVMAgent and WindowsConfiguration.enableAutomaticUpdates must be true. + * + * @return the patchMode value. + */ + public WindowsVMGuestPatchMode patchMode() { + return this.patchMode; + } + + /** + * Set the patchMode property: Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual machines + * associated to virtual machine scale set with OrchestrationMode as Flexible.<br /><br /> Possible + * values are:<br /><br /> **Manual** - You control the application of patches to a virtual machine. You + * do this by applying patches manually inside the VM. In this mode, automatic updates are disabled; the property + * WindowsConfiguration.enableAutomaticUpdates must be false<br /><br /> **AutomaticByOS** - The virtual + * machine will automatically be updated by the OS. The property WindowsConfiguration.enableAutomaticUpdates must be + * true. <br /><br /> **AutomaticByPlatform** - the virtual machine will automatically updated by the + * platform. The properties provisionVMAgent and WindowsConfiguration.enableAutomaticUpdates must be true. + * + * @param patchMode the patchMode value to set. + * @return the PatchSettings object itself. + */ + public PatchSettings withPatchMode(WindowsVMGuestPatchMode patchMode) { + this.patchMode = patchMode; + return this; + } + + /** + * Get the enableHotpatching property: Enables customers to patch their Azure VMs without requiring a reboot. For + * enableHotpatching, the 'provisionVMAgent' must be set to true and 'patchMode' must be set to + * 'AutomaticByPlatform'. + * + * @return the enableHotpatching value. + */ + public Boolean enableHotpatching() { + return this.enableHotpatching; + } + + /** + * Set the enableHotpatching property: Enables customers to patch their Azure VMs without requiring a reboot. For + * enableHotpatching, the 'provisionVMAgent' must be set to true and 'patchMode' must be set to + * 'AutomaticByPlatform'. + * + * @param enableHotpatching the enableHotpatching value to set. + * @return the PatchSettings object itself. + */ + public PatchSettings withEnableHotpatching(Boolean enableHotpatching) { + this.enableHotpatching = enableHotpatching; + return this; + } + + /** + * Get the assessmentMode property: Specifies the mode of VM Guest patch assessment for the IaaS virtual + * machine.<br /><br /> Possible values are:<br /><br /> **ImageDefault** - You control the + * timing of patch assessments on a virtual machine.<br /><br /> **AutomaticByPlatform** - The platform + * will trigger periodic patch assessments. The property provisionVMAgent must be true. + * + * @return the assessmentMode value. + */ + public WindowsPatchAssessmentMode assessmentMode() { + return this.assessmentMode; + } + + /** + * Set the assessmentMode property: Specifies the mode of VM Guest patch assessment for the IaaS virtual + * machine.<br /><br /> Possible values are:<br /><br /> **ImageDefault** - You control the + * timing of patch assessments on a virtual machine.<br /><br /> **AutomaticByPlatform** - The platform + * will trigger periodic patch assessments. The property provisionVMAgent must be true. + * + * @param assessmentMode the assessmentMode value to set. + * @return the PatchSettings object itself. + */ + public PatchSettings withAssessmentMode(WindowsPatchAssessmentMode assessmentMode) { + this.assessmentMode = assessmentMode; + return this; + } + + /** + * Get the automaticByPlatformSettings property: Specifies additional settings for patch mode AutomaticByPlatform in + * VM Guest Patching on Windows. + * + * @return the automaticByPlatformSettings value. + */ + public WindowsVMGuestPatchAutomaticByPlatformSettings automaticByPlatformSettings() { + return this.automaticByPlatformSettings; + } + + /** + * Set the automaticByPlatformSettings property: Specifies additional settings for patch mode AutomaticByPlatform in + * VM Guest Patching on Windows. + * + * @param automaticByPlatformSettings the automaticByPlatformSettings value to set. + * @return the PatchSettings object itself. + */ + public PatchSettings withAutomaticByPlatformSettings( + WindowsVMGuestPatchAutomaticByPlatformSettings automaticByPlatformSettings) { + this.automaticByPlatformSettings = automaticByPlatformSettings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (automaticByPlatformSettings() != null) { + automaticByPlatformSettings().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PirCommunityGalleryResource.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PirCommunityGalleryResource.java new file mode 100644 index 0000000000000..1731086480d8a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PirCommunityGalleryResource.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.resourcemanager.compute.generated.fluent.models.CommunityGalleryIdentifier; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Base information about the community gallery resource in pir. */ +@Fluent +public class PirCommunityGalleryResource { + /* + * 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; + + /* + * Resource type + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * The identifier information of community gallery. + */ + @JsonProperty(value = "identifier") + private CommunityGalleryIdentifier innerIdentifier; + + /** Creates an instance of PirCommunityGalleryResource class. */ + public PirCommunityGalleryResource() { + } + + /** + * 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; + } + + /** + * Get the type property: Resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the innerIdentifier property: The identifier information of community gallery. + * + * @return the innerIdentifier value. + */ + private CommunityGalleryIdentifier innerIdentifier() { + return this.innerIdentifier; + } + + /** + * Get the uniqueId property: The unique id of this community gallery. + * + * @return the uniqueId value. + */ + public String uniqueId() { + return this.innerIdentifier() == null ? null : this.innerIdentifier().uniqueId(); + } + + /** + * Set the uniqueId property: The unique id of this community gallery. + * + * @param uniqueId the uniqueId value to set. + * @return the PirCommunityGalleryResource object itself. + */ + public PirCommunityGalleryResource withUniqueId(String uniqueId) { + if (this.innerIdentifier() == null) { + this.innerIdentifier = new CommunityGalleryIdentifier(); + } + this.innerIdentifier().withUniqueId(uniqueId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerIdentifier() != null) { + innerIdentifier().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..ff8fba6c27ec5 --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** The Resource model definition. */ +@Immutable +public class PirResource { + /* + * 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; + + /** Creates an instance of PirResource class. */ + public PirResource() { + } + + /** + * 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..639bb78dafcab --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PirSharedGalleryResource.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.resourcemanager.compute.generated.fluent.models.SharedGalleryIdentifier; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Base information about the shared gallery resource in pir. */ +@Fluent +public class PirSharedGalleryResource extends PirResource { + /* + * The identifier information of shared gallery. + */ + @JsonProperty(value = "identifier") + private SharedGalleryIdentifier innerIdentifier; + + /** Creates an instance of PirSharedGalleryResource class. */ + public PirSharedGalleryResource() { + } + + /** + * Get the innerIdentifier property: The identifier information of shared gallery. + * + * @return the innerIdentifier value. + */ + private SharedGalleryIdentifier innerIdentifier() { + return this.innerIdentifier; + } + + /** + * Get the uniqueId property: The unique id of this shared gallery. + * + * @return the uniqueId value. + */ + public String uniqueId() { + return this.innerIdentifier() == null ? null : this.innerIdentifier().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) { + if (this.innerIdentifier() == null) { + this.innerIdentifier = new SharedGalleryIdentifier(); + } + this.innerIdentifier().withUniqueId(uniqueId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerIdentifier() != null) { + innerIdentifier().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..f2f20384627ea --- /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.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 { + /* + * 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; + + /** Creates an instance of Plan class. */ + public Plan() { + } + + /** + * 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/PolicyViolation.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PolicyViolation.java new file mode 100644 index 0000000000000..f8e4715f8f424 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PolicyViolation.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.fasterxml.jackson.annotation.JsonProperty; + +/** A policy violation reported against a gallery artifact. */ +@Fluent +public final class PolicyViolation { + /* + * Describes the nature of the policy violation. + */ + @JsonProperty(value = "category") + private PolicyViolationCategory category; + + /* + * Describes specific details about why this policy violation was reported. + */ + @JsonProperty(value = "details") + private String details; + + /** Creates an instance of PolicyViolation class. */ + public PolicyViolation() { + } + + /** + * Get the category property: Describes the nature of the policy violation. + * + * @return the category value. + */ + public PolicyViolationCategory category() { + return this.category; + } + + /** + * Set the category property: Describes the nature of the policy violation. + * + * @param category the category value to set. + * @return the PolicyViolation object itself. + */ + public PolicyViolation withCategory(PolicyViolationCategory category) { + this.category = category; + return this; + } + + /** + * Get the details property: Describes specific details about why this policy violation was reported. + * + * @return the details value. + */ + public String details() { + return this.details; + } + + /** + * Set the details property: Describes specific details about why this policy violation was reported. + * + * @param details the details value to set. + * @return the PolicyViolation object itself. + */ + public PolicyViolation withDetails(String details) { + this.details = details; + 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/PolicyViolationCategory.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PolicyViolationCategory.java new file mode 100644 index 0000000000000..3b4f11d42c2ca --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PolicyViolationCategory.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Describes the nature of the policy violation. */ +public final class PolicyViolationCategory extends ExpandableStringEnum { + /** Static value Other for PolicyViolationCategory. */ + public static final PolicyViolationCategory OTHER = fromString("Other"); + + /** Static value ImageFlaggedUnsafe for PolicyViolationCategory. */ + public static final PolicyViolationCategory IMAGE_FLAGGED_UNSAFE = fromString("ImageFlaggedUnsafe"); + + /** Static value CopyrightValidation for PolicyViolationCategory. */ + public static final PolicyViolationCategory COPYRIGHT_VALIDATION = fromString("CopyrightValidation"); + + /** Static value IpTheft for PolicyViolationCategory. */ + public static final PolicyViolationCategory IP_THEFT = fromString("IpTheft"); + + /** + * Creates a new instance of PolicyViolationCategory value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PolicyViolationCategory() { + } + + /** + * Creates or finds a PolicyViolationCategory from its string representation. + * + * @param name a name to look for. + * @return the corresponding PolicyViolationCategory. + */ + @JsonCreator + public static PolicyViolationCategory fromString(String name) { + return fromString(name, PolicyViolationCategory.class); + } + + /** + * Gets known PolicyViolationCategory values. + * + * @return known PolicyViolationCategory values. + */ + public static Collection values() { + return values(PolicyViolationCategory.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PriorityMixPolicy.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PriorityMixPolicy.java new file mode 100644 index 0000000000000..6ea149fd37acb --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PriorityMixPolicy.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.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifies the target splits for Spot and Regular priority VMs within a scale set with flexible orchestration mode. + * With this property the customer is able to specify the base number of regular priority VMs created as the VMSS flex + * instance scales out and the split between Spot and Regular priority VMs after this base target has been reached. + */ +@Fluent +public final class PriorityMixPolicy { + /* + * The base number of regular priority VMs that will be created in this scale set as it scales out. + */ + @JsonProperty(value = "baseRegularPriorityCount") + private Integer baseRegularPriorityCount; + + /* + * The percentage of VM instances, after the base regular priority count has been reached, that are expected to use + * regular priority. + */ + @JsonProperty(value = "regularPriorityPercentageAboveBase") + private Integer regularPriorityPercentageAboveBase; + + /** Creates an instance of PriorityMixPolicy class. */ + public PriorityMixPolicy() { + } + + /** + * Get the baseRegularPriorityCount property: The base number of regular priority VMs that will be created in this + * scale set as it scales out. + * + * @return the baseRegularPriorityCount value. + */ + public Integer baseRegularPriorityCount() { + return this.baseRegularPriorityCount; + } + + /** + * Set the baseRegularPriorityCount property: The base number of regular priority VMs that will be created in this + * scale set as it scales out. + * + * @param baseRegularPriorityCount the baseRegularPriorityCount value to set. + * @return the PriorityMixPolicy object itself. + */ + public PriorityMixPolicy withBaseRegularPriorityCount(Integer baseRegularPriorityCount) { + this.baseRegularPriorityCount = baseRegularPriorityCount; + return this; + } + + /** + * Get the regularPriorityPercentageAboveBase property: The percentage of VM instances, after the base regular + * priority count has been reached, that are expected to use regular priority. + * + * @return the regularPriorityPercentageAboveBase value. + */ + public Integer regularPriorityPercentageAboveBase() { + return this.regularPriorityPercentageAboveBase; + } + + /** + * Set the regularPriorityPercentageAboveBase property: The percentage of VM instances, after the base regular + * priority count has been reached, that are expected to use regular priority. + * + * @param regularPriorityPercentageAboveBase the regularPriorityPercentageAboveBase value to set. + * @return the PriorityMixPolicy object itself. + */ + public PriorityMixPolicy withRegularPriorityPercentageAboveBase(Integer regularPriorityPercentageAboveBase) { + this.regularPriorityPercentageAboveBase = regularPriorityPercentageAboveBase; + 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..93c56ca1e1c49 --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** The Private Endpoint resource. */ +@Immutable +public final class PrivateEndpoint { + /* + * The ARM identifier for Private Endpoint + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** Creates an instance of PrivateEndpoint class. */ + public PrivateEndpoint() { + } + + /** + * 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..3b9f88be63242 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PrivateEndpointConnectionListResult.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.resourcemanager.compute.generated.fluent.models.PrivateEndpointConnectionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of private link resources. */ +@Fluent +public final class PrivateEndpointConnectionListResult { + /* + * 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; + + /** Creates an instance of PrivateEndpointConnectionListResult class. */ + public PrivateEndpointConnectionListResult() { + } + + /** + * 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..82681186bd44c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PrivateEndpointConnectionProvisioningState.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The current provisioning state. */ +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 a new instance of PrivateEndpointConnectionProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PrivateEndpointConnectionProvisioningState() { + } + + /** + * 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); + } + + /** + * Gets known PrivateEndpointConnectionProvisioningState values. + * + * @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..fe166b938263e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PrivateEndpointServiceConnectionStatus.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The private endpoint connection status. */ +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 a new instance of PrivateEndpointServiceConnectionStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PrivateEndpointServiceConnectionStatus() { + } + + /** + * 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); + } + + /** + * Gets known PrivateEndpointServiceConnectionStatus values. + * + * @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..9a9f23fea5ae7 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PrivateLinkResource.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.Fluent; +import com.azure.resourcemanager.compute.generated.fluent.models.PrivateLinkResourceProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A private link resource. */ +@Fluent +public final class PrivateLinkResource { + /* + * Resource properties. + */ + @JsonProperty(value = "properties") + private PrivateLinkResourceProperties innerProperties; + + /* + * 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; + + /** Creates an instance of PrivateLinkResource class. */ + public PrivateLinkResource() { + } + + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. + */ + private PrivateLinkResourceProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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.innerProperties() == null ? null : this.innerProperties().groupId(); + } + + /** + * Get the requiredMembers property: The private link resource required member names. + * + * @return the requiredMembers value. + */ + public List requiredMembers() { + return this.innerProperties() == null ? null : this.innerProperties().requiredMembers(); + } + + /** + * Get the requiredZoneNames property: The private link resource DNS zone name. + * + * @return the requiredZoneNames value. + */ + public List requiredZoneNames() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateLinkResourceProperties(); + } + this.innerProperties().withRequiredZoneNames(requiredZoneNames); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().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..03031c2258033 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PrivateLinkServiceConnectionState.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.fasterxml.jackson.annotation.JsonProperty; + +/** A collection of information about the state of the connection between service consumer and provider. */ +@Fluent +public final class PrivateLinkServiceConnectionState { + /* + * 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; + + /** Creates an instance of PrivateLinkServiceConnectionState class. */ + public PrivateLinkServiceConnectionState() { + } + + /** + * Get the status property: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the + * service. + * + * @return the status value. + */ + public PrivateEndpointServiceConnectionStatus status() { + return this.status; + } + + /** + * Set the status property: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the + * service. + * + * @param status the status value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withStatus(PrivateEndpointServiceConnectionStatus status) { + this.status = status; + return this; + } + + /** + * Get the description property: The reason for approval/rejection of the connection. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The reason for approval/rejection of the connection. + * + * @param description the description value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the actionsRequired property: A message indicating if changes on the service provider require any updates on + * the consumer. + * + * @return the actionsRequired value. + */ + public String actionsRequired() { + return this.actionsRequired; + } + + /** + * Set the actionsRequired property: A message indicating if changes on the service provider require any updates on + * the consumer. + * + * @param actionsRequired the actionsRequired value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withActionsRequired(String actionsRequired) { + this.actionsRequired = actionsRequired; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PropertyUpdatesInProgress.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PropertyUpdatesInProgress.java new file mode 100644 index 0000000000000..12173721c75fb --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PropertyUpdatesInProgress.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.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the disk for which update is pending. */ +@Fluent +public final class PropertyUpdatesInProgress { + /* + * The target performance tier of the disk if a tier change operation is in progress. + */ + @JsonProperty(value = "targetTier") + private String targetTier; + + /** Creates an instance of PropertyUpdatesInProgress class. */ + public PropertyUpdatesInProgress() { + } + + /** + * Get the targetTier property: The target performance tier of the disk if a tier change operation is in progress. + * + * @return the targetTier value. + */ + public String targetTier() { + return this.targetTier; + } + + /** + * Set the targetTier property: The target performance tier of the disk if a tier change operation is in progress. + * + * @param targetTier the targetTier value to set. + * @return the PropertyUpdatesInProgress object itself. + */ + public PropertyUpdatesInProgress withTargetTier(String targetTier) { + this.targetTier = targetTier; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ProtocolTypes.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ProtocolTypes.java new file mode 100644 index 0000000000000..3f78ace068548 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ProtocolTypes.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.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Specifies the protocol of WinRM listener. Possible values are: **http,** **https.**. */ +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) { + if (value == null) { + return null; + } + ProtocolTypes[] items = ProtocolTypes.values(); + for (ProtocolTypes item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @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..5023998ca6911 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ProximityPlacementGroup.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.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 zones property: Specifies the Availability Zone where virtual machine, virtual machine scale set or + * availability set associated with the proximity placement group can be created. + * + * @return the zones value. + */ + List zones(); + + /** + * Gets the proximityPlacementGroupType property: 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. + * + * @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 intent property: Specifies the user intent of the proximity placement group. + * + * @return the intent value. + */ + ProximityPlacementGroupPropertiesIntent intent(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.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.WithZones, + DefinitionStages.WithProximityPlacementGroupType, + DefinitionStages.WithColocationStatus, + DefinitionStages.WithIntent { + /** + * 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 zones. */ + interface WithZones { + /** + * Specifies the zones property: Specifies the Availability Zone where virtual machine, virtual machine + * scale set or availability set associated with the proximity placement group can be created.. + * + * @param zones Specifies the Availability Zone where virtual machine, virtual machine scale set or + * availability set associated with the proximity placement group can be created. + * @return the next definition stage. + */ + WithCreate withZones(List zones); + } + /** The stage of the ProximityPlacementGroup definition allowing to specify proximityPlacementGroupType. */ + interface WithProximityPlacementGroupType { + /** + * Specifies the proximityPlacementGroupType property: 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.. + * + * @param proximityPlacementGroupType 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. + * @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); + } + /** The stage of the ProximityPlacementGroup definition allowing to specify intent. */ + interface WithIntent { + /** + * Specifies the intent property: Specifies the user intent of the proximity placement group.. + * + * @param intent Specifies the user intent of the proximity placement group. + * @return the next definition stage. + */ + WithCreate withIntent(ProximityPlacementGroupPropertiesIntent intent); + } + } + /** + * 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..4c900dc5db9eb --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ProximityPlacementGroupListResult.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.ProximityPlacementGroupInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List Proximity Placement Group operation response. */ +@Fluent +public final class ProximityPlacementGroupListResult { + /* + * 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; + + /** Creates an instance of ProximityPlacementGroupListResult class. */ + public ProximityPlacementGroupListResult() { + } + + /** + * 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()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ProximityPlacementGroupListResult.class); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ProximityPlacementGroupPropertiesIntent.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ProximityPlacementGroupPropertiesIntent.java new file mode 100644 index 0000000000000..31e309039dc7d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ProximityPlacementGroupPropertiesIntent.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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Specifies the user intent of the proximity placement group. */ +@Fluent +public final class ProximityPlacementGroupPropertiesIntent { + /* + * Specifies possible sizes of virtual machines that can be created in the proximity placement group. + */ + @JsonProperty(value = "vmSizes") + private List vmSizes; + + /** Creates an instance of ProximityPlacementGroupPropertiesIntent class. */ + public ProximityPlacementGroupPropertiesIntent() { + } + + /** + * Get the vmSizes property: Specifies possible sizes of virtual machines that can be created in the proximity + * placement group. + * + * @return the vmSizes value. + */ + public List vmSizes() { + return this.vmSizes; + } + + /** + * Set the vmSizes property: Specifies possible sizes of virtual machines that can be created in the proximity + * placement group. + * + * @param vmSizes the vmSizes value to set. + * @return the ProximityPlacementGroupPropertiesIntent object itself. + */ + public ProximityPlacementGroupPropertiesIntent withVmSizes(List vmSizes) { + this.vmSizes = vmSizes; + 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/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..ab6bc2f279da8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ProximityPlacementGroupType.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * 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. + */ +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 a new instance of ProximityPlacementGroupType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ProximityPlacementGroupType() { + } + + /** + * 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); + } + + /** + * Gets known ProximityPlacementGroupType values. + * + * @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..49782afd69aa1 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ProximityPlacementGroupUpdate.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import java.util.Map; + +/** Specifies information about the proximity placement group. */ +@Fluent +public final class ProximityPlacementGroupUpdate extends UpdateResource { + /** Creates an instance of ProximityPlacementGroupUpdate class. */ + public ProximityPlacementGroupUpdate() { + } + + /** {@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..82f6ba980a633 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ProximityPlacementGroups.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 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByResourceGroupWithResponse( + String resourceGroupName, String proximityPlacementGroupName, 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.resourcemanager.compute.generated.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 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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 along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String proximityPlacementGroupName, String includeColocationStatus, 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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); + + /** + * Lists all proximity placement groups in 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 Proximity Placement Group operation response as paginated response with {@link PagedIterable}. + */ + 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.resourcemanager.compute.generated.models.ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + 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.resourcemanager.compute.generated.models.ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + 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.resourcemanager.compute.generated.models.ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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 along with {@link Response}. + */ + 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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 along with {@link Response}. + */ + 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.resourcemanager.compute.generated.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 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response 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..5c197faa0c77a --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** The ProxyOnly Resource model definition. */ +@Immutable +public class ProxyOnlyResource { + /* + * 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; + + /** Creates an instance of ProxyOnlyResource class. */ + public ProxyOnlyResource() { + } + + /** + * Get the id property: Resource Id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: Resource name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the type property: Resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PublicIpAddressSku.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PublicIpAddressSku.java new file mode 100644 index 0000000000000..f47de5f494a4f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PublicIpAddressSku.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the public IP Sku. It can only be set with OrchestrationMode as Flexible. */ +@Fluent +public final class PublicIpAddressSku { + /* + * Specify public IP sku name + */ + @JsonProperty(value = "name") + private PublicIpAddressSkuName name; + + /* + * Specify public IP sku tier + */ + @JsonProperty(value = "tier") + private PublicIpAddressSkuTier tier; + + /** Creates an instance of PublicIpAddressSku class. */ + public PublicIpAddressSku() { + } + + /** + * Get the name property: Specify public IP sku name. + * + * @return the name value. + */ + public PublicIpAddressSkuName name() { + return this.name; + } + + /** + * Set the name property: Specify public IP sku name. + * + * @param name the name value to set. + * @return the PublicIpAddressSku object itself. + */ + public PublicIpAddressSku withName(PublicIpAddressSkuName name) { + this.name = name; + return this; + } + + /** + * Get the tier property: Specify public IP sku tier. + * + * @return the tier value. + */ + public PublicIpAddressSkuTier tier() { + return this.tier; + } + + /** + * Set the tier property: Specify public IP sku tier. + * + * @param tier the tier value to set. + * @return the PublicIpAddressSku object itself. + */ + public PublicIpAddressSku withTier(PublicIpAddressSkuTier tier) { + this.tier = tier; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PublicIpAddressSkuName.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PublicIpAddressSkuName.java new file mode 100644 index 0000000000000..52d795b48aba0 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PublicIpAddressSkuName.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; + +/** Specify public IP sku name. */ +public final class PublicIpAddressSkuName extends ExpandableStringEnum { + /** Static value Basic for PublicIpAddressSkuName. */ + public static final PublicIpAddressSkuName BASIC = fromString("Basic"); + + /** Static value Standard for PublicIpAddressSkuName. */ + public static final PublicIpAddressSkuName STANDARD = fromString("Standard"); + + /** + * Creates a new instance of PublicIpAddressSkuName value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PublicIpAddressSkuName() { + } + + /** + * Creates or finds a PublicIpAddressSkuName from its string representation. + * + * @param name a name to look for. + * @return the corresponding PublicIpAddressSkuName. + */ + @JsonCreator + public static PublicIpAddressSkuName fromString(String name) { + return fromString(name, PublicIpAddressSkuName.class); + } + + /** + * Gets known PublicIpAddressSkuName values. + * + * @return known PublicIpAddressSkuName values. + */ + public static Collection values() { + return values(PublicIpAddressSkuName.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PublicIpAddressSkuTier.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PublicIpAddressSkuTier.java new file mode 100644 index 0000000000000..38fd2bb9e83cc --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PublicIpAddressSkuTier.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; + +/** Specify public IP sku tier. */ +public final class PublicIpAddressSkuTier extends ExpandableStringEnum { + /** Static value Regional for PublicIpAddressSkuTier. */ + public static final PublicIpAddressSkuTier REGIONAL = fromString("Regional"); + + /** Static value Global for PublicIpAddressSkuTier. */ + public static final PublicIpAddressSkuTier GLOBAL = fromString("Global"); + + /** + * Creates a new instance of PublicIpAddressSkuTier value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PublicIpAddressSkuTier() { + } + + /** + * Creates or finds a PublicIpAddressSkuTier from its string representation. + * + * @param name a name to look for. + * @return the corresponding PublicIpAddressSkuTier. + */ + @JsonCreator + public static PublicIpAddressSkuTier fromString(String name) { + return fromString(name, PublicIpAddressSkuTier.class); + } + + /** + * Gets known PublicIpAddressSkuTier values. + * + * @return known PublicIpAddressSkuTier values. + */ + public static Collection values() { + return values(PublicIpAddressSkuTier.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PublicIpAllocationMethod.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PublicIpAllocationMethod.java new file mode 100644 index 0000000000000..35888d4d5561c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PublicIpAllocationMethod.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; + +/** Specify the public IP allocation type. */ +public final class PublicIpAllocationMethod extends ExpandableStringEnum { + /** Static value Dynamic for PublicIpAllocationMethod. */ + public static final PublicIpAllocationMethod DYNAMIC = fromString("Dynamic"); + + /** Static value Static for PublicIpAllocationMethod. */ + public static final PublicIpAllocationMethod STATIC = fromString("Static"); + + /** + * Creates a new instance of PublicIpAllocationMethod value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PublicIpAllocationMethod() { + } + + /** + * Creates or finds a PublicIpAllocationMethod from its string representation. + * + * @param name a name to look for. + * @return the corresponding PublicIpAllocationMethod. + */ + @JsonCreator + public static PublicIpAllocationMethod fromString(String name) { + return fromString(name, PublicIpAllocationMethod.class); + } + + /** + * Gets known PublicIpAllocationMethod values. + * + * @return known PublicIpAllocationMethod values. + */ + public static Collection values() { + return values(PublicIpAllocationMethod.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PublicNetworkAccess.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PublicNetworkAccess.java new file mode 100644 index 0000000000000..26382f6db4340 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PublicNetworkAccess.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; + +/** Policy for controlling export on the disk. */ +public final class PublicNetworkAccess extends ExpandableStringEnum { + /** Static value Enabled for PublicNetworkAccess. */ + public static final PublicNetworkAccess ENABLED = fromString("Enabled"); + + /** Static value Disabled for PublicNetworkAccess. */ + public static final PublicNetworkAccess DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of PublicNetworkAccess value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PublicNetworkAccess() { + } + + /** + * Creates or finds a PublicNetworkAccess from its string representation. + * + * @param name a name to look for. + * @return the corresponding PublicNetworkAccess. + */ + @JsonCreator + public static PublicNetworkAccess fromString(String name) { + return fromString(name, PublicNetworkAccess.class); + } + + /** + * Gets known PublicNetworkAccess values. + * + * @return known PublicNetworkAccess values. + */ + public static Collection values() { + return values(PublicNetworkAccess.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PurchasePlan.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PurchasePlan.java new file mode 100644 index 0000000000000..a278ebc455bc3 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PurchasePlan.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Used for establishing the purchase context of any 3rd Party artifact through MarketPlace. */ +@Fluent +public final class PurchasePlan { + /* + * 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; + + /** Creates an instance of PurchasePlan class. */ + public PurchasePlan() { + } + + /** + * 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")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PurchasePlan.class); +} 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..8a9e5b3cccf8a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PurchasePlanAutoGenerated.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.JsonProperty; + +/** Used for establishing the purchase context of any 3rd Party artifact through MarketPlace. */ +@Fluent +public final class PurchasePlanAutoGenerated { + /* + * 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; + + /** Creates an instance of PurchasePlanAutoGenerated class. */ + public PurchasePlanAutoGenerated() { + } + + /** + * 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")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PurchasePlanAutoGenerated.class); +} 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..5126169d36153 --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties describe the recommended machine configuration for this Image Definition. These properties are + * updatable. + */ +@Fluent +public final class RecommendedMachineConfiguration { + /* + * Describes the resource range. + */ + @JsonProperty(value = "vCPUs") + private ResourceRange vCPUs; + + /* + * Describes the resource range. + */ + @JsonProperty(value = "memory") + private ResourceRange memory; + + /** Creates an instance of RecommendedMachineConfiguration class. */ + public RecommendedMachineConfiguration() { + } + + /** + * 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..bf8745ddcee8c --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** This is the regional replication status. */ +@Immutable +public final class RegionalReplicationStatus { + /* + * 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; + + /** Creates an instance of RegionalReplicationStatus class. */ + public RegionalReplicationStatus() { + } + + /** + * 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/RegionalSharingStatus.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RegionalSharingStatus.java new file mode 100644 index 0000000000000..ea0b04714ebd7 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RegionalSharingStatus.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.fasterxml.jackson.annotation.JsonProperty; + +/** Gallery regional sharing status. */ +@Fluent +public final class RegionalSharingStatus { + /* + * Region name + */ + @JsonProperty(value = "region") + private String region; + + /* + * The sharing state of the gallery. + * + * Gallery sharing state in current region + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private SharingState state; + + /* + * Details of gallery regional sharing failure. + */ + @JsonProperty(value = "details") + private String details; + + /** Creates an instance of RegionalSharingStatus class. */ + public RegionalSharingStatus() { + } + + /** + * Get the region property: Region name. + * + * @return the region value. + */ + public String region() { + return this.region; + } + + /** + * Set the region property: Region name. + * + * @param region the region value to set. + * @return the RegionalSharingStatus object itself. + */ + public RegionalSharingStatus withRegion(String region) { + this.region = region; + return this; + } + + /** + * Get the state property: The sharing state of the gallery. + * + *

Gallery sharing state in current region. + * + * @return the state value. + */ + public SharingState state() { + return this.state; + } + + /** + * Get the details property: Details of gallery regional sharing failure. + * + * @return the details value. + */ + public String details() { + return this.details; + } + + /** + * Set the details property: Details of gallery regional sharing failure. + * + * @param details the details value to set. + * @return the RegionalSharingStatus object itself. + */ + public RegionalSharingStatus withDetails(String details) { + this.details = details; + 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/RepairAction.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RepairAction.java new file mode 100644 index 0000000000000..cbf283bbf3d5b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RepairAction.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Type of repair action (replace, restart, reimage) that will be used for repairing unhealthy virtual machines in the + * scale set. Default value is replace. + */ +public final class RepairAction extends ExpandableStringEnum { + /** Static value Replace for RepairAction. */ + public static final RepairAction REPLACE = fromString("Replace"); + + /** Static value Restart for RepairAction. */ + public static final RepairAction RESTART = fromString("Restart"); + + /** Static value Reimage for RepairAction. */ + public static final RepairAction REIMAGE = fromString("Reimage"); + + /** + * Creates a new instance of RepairAction value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RepairAction() { + } + + /** + * Creates or finds a RepairAction from its string representation. + * + * @param name a name to look for. + * @return the corresponding RepairAction. + */ + @JsonCreator + public static RepairAction fromString(String name) { + return fromString(name, RepairAction.class); + } + + /** + * Gets known RepairAction values. + * + * @return known RepairAction values. + */ + public static Collection values() { + return values(RepairAction.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ReplicationMode.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ReplicationMode.java new file mode 100644 index 0000000000000..69b41278b91ce --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ReplicationMode.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; + +/** Optional parameter which specifies the mode to be used for replication. This property is not updatable. */ +public final class ReplicationMode extends ExpandableStringEnum { + /** Static value Full for ReplicationMode. */ + public static final ReplicationMode FULL = fromString("Full"); + + /** Static value Shallow for ReplicationMode. */ + public static final ReplicationMode SHALLOW = fromString("Shallow"); + + /** + * Creates a new instance of ReplicationMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ReplicationMode() { + } + + /** + * Creates or finds a ReplicationMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding ReplicationMode. + */ + @JsonCreator + public static ReplicationMode fromString(String name) { + return fromString(name, ReplicationMode.class); + } + + /** + * Gets known ReplicationMode values. + * + * @return known ReplicationMode values. + */ + public static Collection values() { + return values(ReplicationMode.class); + } +} 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..2dab163e3a581 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ReplicationState.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** This is the regional replication state. */ +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 a new instance of ReplicationState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ReplicationState() { + } + + /** + * 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); + } + + /** + * Gets known ReplicationState values. + * + * @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..d5d2d192aa09c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ReplicationStatus.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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** This is the replication status of the gallery image version. */ +@Immutable +public final class ReplicationStatus { + /* + * 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; + + /** Creates an instance of ReplicationStatus class. */ + public ReplicationStatus() { + } + + /** + * 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..2b8d8ec734746 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ReplicationStatusTypes.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.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 a new instance of ReplicationStatusTypes value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ReplicationStatusTypes() { + } + + /** + * 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); + } + + /** + * Gets known ReplicationStatusTypes values. + * + * @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..681516789891b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RequestRateByIntervalInput.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.JsonProperty; +import java.time.OffsetDateTime; + +/** Api request input for LogAnalytics getRequestRateByInterval Api. */ +@Fluent +public final class RequestRateByIntervalInput extends LogAnalyticsInputBase { + /* + * Interval value in minutes used to create LogAnalytics call rate logs. + */ + @JsonProperty(value = "intervalLength", required = true) + private IntervalInMins intervalLength; + + /** Creates an instance of RequestRateByIntervalInput class. */ + public RequestRateByIntervalInput() { + } + + /** + * 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")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RequestRateByIntervalInput.class); +} 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..a68bc498c91a5 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceIdentityType.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.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * 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. + */ +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) { + if (value == null) { + return null; + } + ResourceIdentityType[] items = ResourceIdentityType.values(); + for (ResourceIdentityType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceInstanceViewStatus.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceInstanceViewStatus.java new file mode 100644 index 0000000000000..e1c6930619d3e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceInstanceViewStatus.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Instance view status. */ +@Fluent +public final class ResourceInstanceViewStatus { + /* + * The status code. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /* + * The short localizable label for the status. + */ + @JsonProperty(value = "displayStatus", access = JsonProperty.Access.WRITE_ONLY) + private String displayStatus; + + /* + * The detailed status message, including for alerts and error messages. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /* + * The time of the status. + */ + @JsonProperty(value = "time", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime time; + + /* + * The level code. + */ + @JsonProperty(value = "level") + private StatusLevelTypes level; + + /** Creates an instance of ResourceInstanceViewStatus class. */ + public ResourceInstanceViewStatus() { + } + + /** + * Get the code property: The status code. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Get the displayStatus property: The short localizable label for the status. + * + * @return the displayStatus value. + */ + public String displayStatus() { + return this.displayStatus; + } + + /** + * Get the message property: The detailed status message, including for alerts and error messages. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Get the time property: The time of the status. + * + * @return the time value. + */ + public OffsetDateTime time() { + return this.time; + } + + /** + * Get the level property: The level code. + * + * @return the level value. + */ + public StatusLevelTypes level() { + return this.level; + } + + /** + * Set the level property: The level code. + * + * @param level the level value to set. + * @return the ResourceInstanceViewStatus object itself. + */ + public ResourceInstanceViewStatus withLevel(StatusLevelTypes level) { + this.level = level; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceRange.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceRange.java new file mode 100644 index 0000000000000..1c1052c99a16d --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the resource range. */ +@Fluent +public final class ResourceRange { + /* + * The minimum number of the resource. + */ + @JsonProperty(value = "min") + private Integer min; + + /* + * The maximum number of the resource. + */ + @JsonProperty(value = "max") + private Integer max; + + /** Creates an instance of ResourceRange class. */ + public ResourceRange() { + } + + /** + * 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..3383487145b53 --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** Describes The SKU capabilities object. */ +@Immutable +public final class ResourceSkuCapabilities { + /* + * 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; + + /** Creates an instance of ResourceSkuCapabilities class. */ + public ResourceSkuCapabilities() { + } + + /** + * 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..d3b40dab858df --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** Describes scaling information of a SKU. */ +@Immutable +public final class ResourceSkuCapacity { + /* + * 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; + + /** Creates an instance of ResourceSkuCapacity class. */ + public ResourceSkuCapacity() { + } + + /** + * 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..48410c99ab7b5 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSkuCapacityScaleType.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.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** The scale type applicable to the sku. */ +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) { + if (value == null) { + return null; + } + ResourceSkuCapacityScaleType[] items = ResourceSkuCapacityScaleType.values(); + for (ResourceSkuCapacityScaleType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @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..ff9ff17e41c15 --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** Describes metadata for retrieving price info. */ +@Immutable +public final class ResourceSkuCosts { + /* + * 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; + + /** Creates an instance of ResourceSkuCosts class. */ + public ResourceSkuCosts() { + } + + /** + * 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..3f8e3e1917a24 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSkuLocationInfo.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.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes an available Compute SKU Location Information. */ +@Immutable +public final class ResourceSkuLocationInfo { + /* + * 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; + + /* + * The names of extended locations. + */ + @JsonProperty(value = "extendedLocations", access = JsonProperty.Access.WRITE_ONLY) + private List extendedLocations; + + /* + * The type of the extended location. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private ExtendedLocationType type; + + /** Creates an instance of ResourceSkuLocationInfo class. */ + public ResourceSkuLocationInfo() { + } + + /** + * 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; + } + + /** + * Get the extendedLocations property: The names of extended locations. + * + * @return the extendedLocations value. + */ + public List extendedLocations() { + return this.extendedLocations; + } + + /** + * Get the type property: The type of the extended location. + * + * @return the type value. + */ + public ExtendedLocationType type() { + return this.type; + } + + /** + * 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..225c49b88682b --- /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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes an available Compute SKU Restriction Information. */ +@Immutable +public final class ResourceSkuRestrictionInfo { + /* + * 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; + + /** Creates an instance of ResourceSkuRestrictionInfo class. */ + public ResourceSkuRestrictionInfo() { + } + + /** + * 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..8ab60ef22f6d8 --- /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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes scaling information of a SKU. */ +@Immutable +public final class ResourceSkuRestrictions { + /* + * 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; + + /** Creates an instance of ResourceSkuRestrictions class. */ + public ResourceSkuRestrictions() { + } + + /** + * 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..7d4118246badf --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSkuRestrictionsReasonCode.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.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** The reason for restriction. */ +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) { + if (value == null) { + return null; + } + ResourceSkuRestrictionsReasonCode[] items = ResourceSkuRestrictionsReasonCode.values(); + for (ResourceSkuRestrictionsReasonCode item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @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..ac5c8b01d3a77 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSkuRestrictionsType.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.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** The type of restrictions. */ +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) { + if (value == null) { + return null; + } + ResourceSkuRestrictionsType[] items = ResourceSkuRestrictionsType.values(); + for (ResourceSkuRestrictionsType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @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..5a575693115e8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSkuZoneDetails.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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes The zonal capabilities of a SKU. */ +@Immutable +public final class ResourceSkuZoneDetails { + /* + * 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; + + /** Creates an instance of ResourceSkuZoneDetails class. */ + public ResourceSkuZoneDetails() { + } + + /** + * 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..260dbf4510c6a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSkus.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.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.Compute SKUs available for your Subscription as paginated response with {@link + * PagedIterable}. + */ + 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 includeExtendedLocations To Include Extended Locations information or not in the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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.Compute SKUs available for your Subscription as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String filter, String includeExtendedLocations, 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..ec397e63adaa1 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSkusResult.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.azure.resourcemanager.compute.generated.fluent.models.ResourceSkuInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List Resource Skus operation response. */ +@Fluent +public final class ResourceSkusResult { + /* + * 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; + + /** Creates an instance of ResourceSkusResult class. */ + public ResourceSkusResult() { + } + + /** + * 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()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ResourceSkusResult.class); +} 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..05729e83c131c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceUriList.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.JsonProperty; +import java.util.List; + +/** The List resources which are encrypted with the disk encryption set. */ +@Fluent +public final class ResourceUriList { + /* + * 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; + + /** Creates an instance of ResourceUriList class. */ + public ResourceUriList() { + } + + /** + * 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")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ResourceUriList.class); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceWithOptionalLocation.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceWithOptionalLocation.java new file mode 100644 index 0000000000000..09f0c1d9c0303 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceWithOptionalLocation.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import java.util.Map; + +/** The Resource model definition with location property as optional. */ +@Fluent +public class ResourceWithOptionalLocation extends Resource { + /** Creates an instance of ResourceWithOptionalLocation class. */ + public ResourceWithOptionalLocation() { + } + + /** {@inheritDoc} */ + @Override + public ResourceWithOptionalLocation withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceWithOptionalLocation 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/models/RestorePoint.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePoint.java new file mode 100644 index 0000000000000..a366e5077030c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePoint.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.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.RestorePointInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** An immutable client-side representation of RestorePoint. */ +public interface RestorePoint { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the excludeDisks property: List of disk resource ids that the customer wishes to exclude from the restore + * point. If no disks are specified, all disks will be included. + * + * @return the excludeDisks value. + */ + List excludeDisks(); + + /** + * Gets the sourceMetadata property: Gets the details of the VM captured at the time of the restore point creation. + * + * @return the sourceMetadata value. + */ + RestorePointSourceMetadata sourceMetadata(); + + /** + * Gets the provisioningState property: Gets the provisioning state of the restore point. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the consistencyMode property: ConsistencyMode of the RestorePoint. Can be specified in the input while + * creating a restore point. For now, only CrashConsistent is accepted as a valid input. Please refer to + * https://aka.ms/RestorePoints for more details. + * + * @return the consistencyMode value. + */ + ConsistencyModeTypes consistencyMode(); + + /** + * Gets the timeCreated property: Gets the creation time of the restore point. + * + * @return the timeCreated value. + */ + OffsetDateTime timeCreated(); + + /** + * Gets the sourceRestorePoint property: Resource Id of the source restore point from which a copy needs to be + * created. + * + * @return the sourceRestorePoint value. + */ + ApiEntityReference sourceRestorePoint(); + + /** + * Gets the instanceView property: The restore point instance view. + * + * @return the instanceView value. + */ + RestorePointInstanceView instanceView(); + + /** + * Gets the inner com.azure.resourcemanager.compute.generated.fluent.models.RestorePointInner object. + * + * @return the inner object. + */ + RestorePointInner innerModel(); + + /** The entirety of the RestorePoint definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The RestorePoint definition stages. */ + interface DefinitionStages { + /** The first stage of the RestorePoint definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the RestorePoint definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, restorePointCollectionName. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @return the next definition stage. + */ + WithCreate withExistingRestorePointCollection(String resourceGroupName, String restorePointCollectionName); + } + /** + * The stage of the RestorePoint definition which contains all the minimum required properties for the resource + * to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithExcludeDisks, + DefinitionStages.WithSourceMetadata, + DefinitionStages.WithConsistencyMode, + DefinitionStages.WithTimeCreated, + DefinitionStages.WithSourceRestorePoint { + /** + * Executes the create request. + * + * @return the created resource. + */ + RestorePoint create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + RestorePoint create(Context context); + } + /** The stage of the RestorePoint definition allowing to specify excludeDisks. */ + interface WithExcludeDisks { + /** + * Specifies the excludeDisks property: List of disk resource ids that the customer wishes to exclude from + * the restore point. If no disks are specified, all disks will be included.. + * + * @param excludeDisks List of disk resource ids that the customer wishes to exclude from the restore point. + * If no disks are specified, all disks will be included. + * @return the next definition stage. + */ + WithCreate withExcludeDisks(List excludeDisks); + } + /** The stage of the RestorePoint definition allowing to specify sourceMetadata. */ + interface WithSourceMetadata { + /** + * Specifies the sourceMetadata property: Gets the details of the VM captured at the time of the restore + * point creation.. + * + * @param sourceMetadata Gets the details of the VM captured at the time of the restore point creation. + * @return the next definition stage. + */ + WithCreate withSourceMetadata(RestorePointSourceMetadata sourceMetadata); + } + /** The stage of the RestorePoint definition allowing to specify consistencyMode. */ + interface WithConsistencyMode { + /** + * Specifies the consistencyMode property: ConsistencyMode of the RestorePoint. Can be specified in the + * input while creating a restore point. For now, only CrashConsistent is accepted as a valid input. Please + * refer to https://aka.ms/RestorePoints for more details.. + * + * @param consistencyMode ConsistencyMode of the RestorePoint. Can be specified in the input while creating + * a restore point. For now, only CrashConsistent is accepted as a valid input. Please refer to + * https://aka.ms/RestorePoints for more details. + * @return the next definition stage. + */ + WithCreate withConsistencyMode(ConsistencyModeTypes consistencyMode); + } + /** The stage of the RestorePoint definition allowing to specify timeCreated. */ + interface WithTimeCreated { + /** + * Specifies the timeCreated property: Gets the creation time of the restore point.. + * + * @param timeCreated Gets the creation time of the restore point. + * @return the next definition stage. + */ + WithCreate withTimeCreated(OffsetDateTime timeCreated); + } + /** The stage of the RestorePoint definition allowing to specify sourceRestorePoint. */ + interface WithSourceRestorePoint { + /** + * Specifies the sourceRestorePoint property: Resource Id of the source restore point from which a copy + * needs to be created.. + * + * @param sourceRestorePoint Resource Id of the source restore point from which a copy needs to be created. + * @return the next definition stage. + */ + WithCreate withSourceRestorePoint(ApiEntityReference sourceRestorePoint); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + RestorePoint refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + RestorePoint refresh(Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointCollection.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointCollection.java new file mode 100644 index 0000000000000..ba871efc09260 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointCollection.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.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.RestorePointCollectionInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of RestorePointCollection. */ +public interface RestorePointCollection { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the source property: The properties of the source resource that this restore point collection is created + * from. + * + * @return the source value. + */ + RestorePointCollectionSourceProperties source(); + + /** + * Gets the provisioningState property: The provisioning state of the restore point collection. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the restorePointCollectionId property: The unique id of the restore point collection. + * + * @return the restorePointCollectionId value. + */ + String restorePointCollectionId(); + + /** + * Gets the restorePoints property: A list containing all restore points created under this restore point + * collection. + * + * @return the restorePoints value. + */ + List restorePoints(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.compute.generated.fluent.models.RestorePointCollectionInner object. + * + * @return the inner object. + */ + RestorePointCollectionInner innerModel(); + + /** The entirety of the RestorePointCollection definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The RestorePointCollection definition stages. */ + interface DefinitionStages { + /** The first stage of the RestorePointCollection definition. */ + interface Blank extends WithLocation { + } + /** The stage of the RestorePointCollection definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the RestorePointCollection definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the RestorePointCollection definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithSource { + /** + * Executes the create request. + * + * @return the created resource. + */ + RestorePointCollection create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + RestorePointCollection create(Context context); + } + /** The stage of the RestorePointCollection definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the RestorePointCollection definition allowing to specify source. */ + interface WithSource { + /** + * Specifies the source property: The properties of the source resource that this restore point collection + * is created from.. + * + * @param source The properties of the source resource that this restore point collection is created from. + * @return the next definition stage. + */ + WithCreate withSource(RestorePointCollectionSourceProperties source); + } + } + /** + * Begins update for the RestorePointCollection resource. + * + * @return the stage of resource update. + */ + RestorePointCollection.Update update(); + + /** The template for RestorePointCollection update. */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithSource { + /** + * Executes the update request. + * + * @return the updated resource. + */ + RestorePointCollection apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + RestorePointCollection apply(Context context); + } + /** The RestorePointCollection update stages. */ + interface UpdateStages { + /** The stage of the RestorePointCollection update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the RestorePointCollection update allowing to specify source. */ + interface WithSource { + /** + * Specifies the source property: The properties of the source resource that this restore point collection + * is created from.. + * + * @param source The properties of the source resource that this restore point collection is created from. + * @return the next definition stage. + */ + Update withSource(RestorePointCollectionSourceProperties source); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + RestorePointCollection refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + RestorePointCollection refresh(Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointCollectionExpandOptions.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointCollectionExpandOptions.java new file mode 100644 index 0000000000000..42568e3680f9b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointCollectionExpandOptions.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for RestorePointCollectionExpandOptions. */ +public final class RestorePointCollectionExpandOptions + extends ExpandableStringEnum { + /** Static value restorePoints for RestorePointCollectionExpandOptions. */ + public static final RestorePointCollectionExpandOptions RESTORE_POINTS = fromString("restorePoints"); + + /** + * Creates a new instance of RestorePointCollectionExpandOptions value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RestorePointCollectionExpandOptions() { + } + + /** + * Creates or finds a RestorePointCollectionExpandOptions from its string representation. + * + * @param name a name to look for. + * @return the corresponding RestorePointCollectionExpandOptions. + */ + @JsonCreator + public static RestorePointCollectionExpandOptions fromString(String name) { + return fromString(name, RestorePointCollectionExpandOptions.class); + } + + /** + * Gets known RestorePointCollectionExpandOptions values. + * + * @return known RestorePointCollectionExpandOptions values. + */ + public static Collection values() { + return values(RestorePointCollectionExpandOptions.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointCollectionListResult.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointCollectionListResult.java new file mode 100644 index 0000000000000..b34ca28064747 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointCollectionListResult.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.compute.generated.fluent.models.RestorePointCollectionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List restore point collection operation response. */ +@Fluent +public final class RestorePointCollectionListResult { + /* + * Gets the list of restore point collections. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The uri to fetch the next page of RestorePointCollections. Call ListNext() with this to fetch the next page of + * RestorePointCollections + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of RestorePointCollectionListResult class. */ + public RestorePointCollectionListResult() { + } + + /** + * Get the value property: Gets the list of restore point collections. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Gets the list of restore point collections. + * + * @param value the value value to set. + * @return the RestorePointCollectionListResult object itself. + */ + public RestorePointCollectionListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The uri to fetch the next page of RestorePointCollections. Call ListNext() with this + * to fetch the next page of RestorePointCollections. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The uri to fetch the next page of RestorePointCollections. Call ListNext() with this + * to fetch the next page of RestorePointCollections. + * + * @param nextLink the nextLink value to set. + * @return the RestorePointCollectionListResult object itself. + */ + public RestorePointCollectionListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointCollectionSourceProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointCollectionSourceProperties.java new file mode 100644 index 0000000000000..1dc2d74645d4d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointCollectionSourceProperties.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.fasterxml.jackson.annotation.JsonProperty; + +/** The properties of the source resource that this restore point collection is created from. */ +@Fluent +public final class RestorePointCollectionSourceProperties { + /* + * Location of the source resource used to create this restore point collection. + */ + @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) + private String location; + + /* + * Resource Id of the source resource used to create this restore point collection + */ + @JsonProperty(value = "id") + private String id; + + /** Creates an instance of RestorePointCollectionSourceProperties class. */ + public RestorePointCollectionSourceProperties() { + } + + /** + * Get the location property: Location of the source resource used to create this restore point collection. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the id property: Resource Id of the source resource used to create this restore point collection. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource Id of the source resource used to create this restore point collection. + * + * @param id the id value to set. + * @return the RestorePointCollectionSourceProperties object itself. + */ + public RestorePointCollectionSourceProperties withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointCollectionUpdate.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointCollectionUpdate.java new file mode 100644 index 0000000000000..c2022d5200dcb --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointCollectionUpdate.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.resourcemanager.compute.generated.fluent.models.RestorePointCollectionProperties; +import com.azure.resourcemanager.compute.generated.fluent.models.RestorePointInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Update Restore Point collection parameters. */ +@Fluent +public final class RestorePointCollectionUpdate extends UpdateResource { + /* + * The restore point collection properties. + */ + @JsonProperty(value = "properties") + private RestorePointCollectionProperties innerProperties; + + /** Creates an instance of RestorePointCollectionUpdate class. */ + public RestorePointCollectionUpdate() { + } + + /** + * Get the innerProperties property: The restore point collection properties. + * + * @return the innerProperties value. + */ + private RestorePointCollectionProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public RestorePointCollectionUpdate withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the source property: The properties of the source resource that this restore point collection is created + * from. + * + * @return the source value. + */ + public RestorePointCollectionSourceProperties source() { + return this.innerProperties() == null ? null : this.innerProperties().source(); + } + + /** + * Set the source property: The properties of the source resource that this restore point collection is created + * from. + * + * @param source the source value to set. + * @return the RestorePointCollectionUpdate object itself. + */ + public RestorePointCollectionUpdate withSource(RestorePointCollectionSourceProperties source) { + if (this.innerProperties() == null) { + this.innerProperties = new RestorePointCollectionProperties(); + } + this.innerProperties().withSource(source); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the restore point collection. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the restorePointCollectionId property: The unique id of the restore point collection. + * + * @return the restorePointCollectionId value. + */ + public String restorePointCollectionId() { + return this.innerProperties() == null ? null : this.innerProperties().restorePointCollectionId(); + } + + /** + * Get the restorePoints property: A list containing all restore points created under this restore point collection. + * + * @return the restorePoints value. + */ + public List restorePoints() { + return this.innerProperties() == null ? null : this.innerProperties().restorePoints(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointCollections.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointCollections.java new file mode 100644 index 0000000000000..5fcf8bdab9287 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointCollections.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of RestorePointCollections. */ +public interface RestorePointCollections { + /** + * The operation to delete the restore point collection. This operation will also delete all the contained restore + * points. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the Restore Point Collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String restorePointCollectionName); + + /** + * The operation to delete the restore point collection. This operation will also delete all the contained restore + * points. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the Restore Point Collection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String restorePointCollectionName, Context context); + + /** + * The operation to get the restore point collection. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param expand The expand expression to apply on the operation. If expand=restorePoints, server will return all + * contained restore points in the restorePointCollection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return create or update Restore Point collection parameters along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, + String restorePointCollectionName, + RestorePointCollectionExpandOptions expand, + Context context); + + /** + * The operation to get the restore point collection. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return create or update Restore Point collection parameters. + */ + RestorePointCollection getByResourceGroup(String resourceGroupName, String restorePointCollectionName); + + /** + * Gets the list of restore point collections in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of restore point collections in a resource group as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets the list of restore point collections in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of restore point collections in a resource group as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets the list of restore point collections in the subscription. Use nextLink property in the response to get the + * next page of restore point collections. Do this till nextLink is not null to fetch all the restore point + * collections. + * + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of restore point collections in the subscription as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(); + + /** + * Gets the list of restore point collections in the subscription. Use nextLink property in the response to get the + * next page of restore point collections. Do this till nextLink is not null to fetch all the restore point + * collections. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of restore point collections in the subscription as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * The operation to get the restore point collection. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return create or update Restore Point collection parameters along with {@link Response}. + */ + RestorePointCollection getById(String id); + + /** + * The operation to get the restore point collection. + * + * @param id the resource ID. + * @param expand The expand expression to apply on the operation. If expand=restorePoints, server will return all + * contained restore points in the restorePointCollection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return create or update Restore Point collection parameters along with {@link Response}. + */ + Response getByIdWithResponse( + String id, RestorePointCollectionExpandOptions expand, Context context); + + /** + * The operation to delete the restore point collection. This operation will also delete all the contained restore + * points. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * The operation to delete the restore point collection. This operation will also delete all the contained restore + * points. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new RestorePointCollection resource. + * + * @param name resource name. + * @return the first stage of the new RestorePointCollection definition. + */ + RestorePointCollection.DefinitionStages.Blank define(String name); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointEncryption.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointEncryption.java new file mode 100644 index 0000000000000..a47ffaca60a84 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointEncryption.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.fasterxml.jackson.annotation.JsonProperty; + +/** + * Encryption at rest settings for disk restore point. It is an optional property that can be specified in the input + * while creating a restore point. + */ +@Fluent +public final class RestorePointEncryption { + /* + * Describes the parameter of customer managed disk encryption set resource id that can be specified for disk. + * **Note:** The disk encryption set resource id can only be specified for managed disk. Please refer + * https://aka.ms/mdssewithcmkoverview for more details. + */ + @JsonProperty(value = "diskEncryptionSet") + private DiskEncryptionSetParameters diskEncryptionSet; + + /* + * The type of key used to encrypt the data of the disk restore point. + */ + @JsonProperty(value = "type") + private RestorePointEncryptionType type; + + /** Creates an instance of RestorePointEncryption class. */ + public RestorePointEncryption() { + } + + /** + * Get the diskEncryptionSet property: Describes the parameter of customer managed disk encryption set resource id + * that can be specified for disk. **Note:** The disk encryption set resource id can only be specified for managed + * disk. Please refer https://aka.ms/mdssewithcmkoverview for more details. + * + * @return the diskEncryptionSet value. + */ + public DiskEncryptionSetParameters diskEncryptionSet() { + return this.diskEncryptionSet; + } + + /** + * Set the diskEncryptionSet property: Describes the parameter of customer managed disk encryption set resource id + * that can be specified for disk. **Note:** The disk encryption set resource id can only be specified for managed + * disk. Please refer https://aka.ms/mdssewithcmkoverview for more details. + * + * @param diskEncryptionSet the diskEncryptionSet value to set. + * @return the RestorePointEncryption object itself. + */ + public RestorePointEncryption withDiskEncryptionSet(DiskEncryptionSetParameters diskEncryptionSet) { + this.diskEncryptionSet = diskEncryptionSet; + return this; + } + + /** + * Get the type property: The type of key used to encrypt the data of the disk restore point. + * + * @return the type value. + */ + public RestorePointEncryptionType type() { + return this.type; + } + + /** + * Set the type property: The type of key used to encrypt the data of the disk restore point. + * + * @param type the type value to set. + * @return the RestorePointEncryption object itself. + */ + public RestorePointEncryption withType(RestorePointEncryptionType type) { + this.type = type; + 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/RestorePointEncryptionType.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointEncryptionType.java new file mode 100644 index 0000000000000..c25d8b7ba3c68 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointEncryptionType.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The type of key used to encrypt the data of the disk restore point. */ +public final class RestorePointEncryptionType extends ExpandableStringEnum { + /** Static value EncryptionAtRestWithPlatformKey for RestorePointEncryptionType. */ + public static final RestorePointEncryptionType ENCRYPTION_AT_REST_WITH_PLATFORM_KEY = + fromString("EncryptionAtRestWithPlatformKey"); + + /** Static value EncryptionAtRestWithCustomerKey for RestorePointEncryptionType. */ + public static final RestorePointEncryptionType ENCRYPTION_AT_REST_WITH_CUSTOMER_KEY = + fromString("EncryptionAtRestWithCustomerKey"); + + /** Static value EncryptionAtRestWithPlatformAndCustomerKeys for RestorePointEncryptionType. */ + public static final RestorePointEncryptionType ENCRYPTION_AT_REST_WITH_PLATFORM_AND_CUSTOMER_KEYS = + fromString("EncryptionAtRestWithPlatformAndCustomerKeys"); + + /** + * Creates a new instance of RestorePointEncryptionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RestorePointEncryptionType() { + } + + /** + * Creates or finds a RestorePointEncryptionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding RestorePointEncryptionType. + */ + @JsonCreator + public static RestorePointEncryptionType fromString(String name) { + return fromString(name, RestorePointEncryptionType.class); + } + + /** + * Gets known RestorePointEncryptionType values. + * + * @return known RestorePointEncryptionType values. + */ + public static Collection values() { + return values(RestorePointEncryptionType.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointExpandOptions.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointExpandOptions.java new file mode 100644 index 0000000000000..2e634f31a435d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointExpandOptions.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for RestorePointExpandOptions. */ +public final class RestorePointExpandOptions extends ExpandableStringEnum { + /** Static value instanceView for RestorePointExpandOptions. */ + public static final RestorePointExpandOptions INSTANCE_VIEW = fromString("instanceView"); + + /** + * Creates a new instance of RestorePointExpandOptions value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RestorePointExpandOptions() { + } + + /** + * Creates or finds a RestorePointExpandOptions from its string representation. + * + * @param name a name to look for. + * @return the corresponding RestorePointExpandOptions. + */ + @JsonCreator + public static RestorePointExpandOptions fromString(String name) { + return fromString(name, RestorePointExpandOptions.class); + } + + /** + * Gets known RestorePointExpandOptions values. + * + * @return known RestorePointExpandOptions values. + */ + public static Collection values() { + return values(RestorePointExpandOptions.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointInstanceView.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointInstanceView.java new file mode 100644 index 0000000000000..b14de5d90a368 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointInstanceView.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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The instance view of a restore point. */ +@Fluent +public final class RestorePointInstanceView { + /* + * The disk restore points information. + */ + @JsonProperty(value = "diskRestorePoints") + private List diskRestorePoints; + + /* + * The resource status information. + */ + @JsonProperty(value = "statuses") + private List statuses; + + /** Creates an instance of RestorePointInstanceView class. */ + public RestorePointInstanceView() { + } + + /** + * Get the diskRestorePoints property: The disk restore points information. + * + * @return the diskRestorePoints value. + */ + public List diskRestorePoints() { + return this.diskRestorePoints; + } + + /** + * Set the diskRestorePoints property: The disk restore points information. + * + * @param diskRestorePoints the diskRestorePoints value to set. + * @return the RestorePointInstanceView object itself. + */ + public RestorePointInstanceView withDiskRestorePoints(List diskRestorePoints) { + this.diskRestorePoints = diskRestorePoints; + 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 RestorePointInstanceView object itself. + */ + public RestorePointInstanceView withStatuses(List statuses) { + this.statuses = statuses; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (diskRestorePoints() != null) { + diskRestorePoints().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/RestorePointSourceMetadata.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointSourceMetadata.java new file mode 100644 index 0000000000000..ed769db0c6ddf --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointSourceMetadata.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.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the properties of the Virtual Machine for which the restore point was created. The properties provided are + * a subset and the snapshot of the overall Virtual Machine properties captured at the time of the restore point + * creation. + */ +@Fluent +public final class RestorePointSourceMetadata { + /* + * Gets the hardware profile. + */ + @JsonProperty(value = "hardwareProfile", access = JsonProperty.Access.WRITE_ONLY) + private HardwareProfile hardwareProfile; + + /* + * Gets the storage profile. + */ + @JsonProperty(value = "storageProfile") + private RestorePointSourceVMStorageProfile storageProfile; + + /* + * Gets the OS profile. + */ + @JsonProperty(value = "osProfile", access = JsonProperty.Access.WRITE_ONLY) + private OSProfile osProfile; + + /* + * Gets the diagnostics profile. + */ + @JsonProperty(value = "diagnosticsProfile", access = JsonProperty.Access.WRITE_ONLY) + private DiagnosticsProfile diagnosticsProfile; + + /* + * Gets the license type, which is for bring your own license scenario. + */ + @JsonProperty(value = "licenseType", access = JsonProperty.Access.WRITE_ONLY) + private String licenseType; + + /* + * Gets the virtual machine unique id. + */ + @JsonProperty(value = "vmId", access = JsonProperty.Access.WRITE_ONLY) + private String vmId; + + /* + * Gets the security profile. + */ + @JsonProperty(value = "securityProfile", access = JsonProperty.Access.WRITE_ONLY) + private SecurityProfile securityProfile; + + /* + * Location of the VM from which the restore point was created. + */ + @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) + private String location; + + /* + * UserData associated with the source VM for which restore point is captured, which is a base-64 encoded value. + */ + @JsonProperty(value = "userData", access = JsonProperty.Access.WRITE_ONLY) + private String userData; + + /* + * HyperVGeneration of the source VM for which restore point is captured. + */ + @JsonProperty(value = "hyperVGeneration", access = JsonProperty.Access.WRITE_ONLY) + private HyperVGenerationTypes hyperVGeneration; + + /** Creates an instance of RestorePointSourceMetadata class. */ + public RestorePointSourceMetadata() { + } + + /** + * Get the hardwareProfile property: Gets the hardware profile. + * + * @return the hardwareProfile value. + */ + public HardwareProfile hardwareProfile() { + return this.hardwareProfile; + } + + /** + * Get the storageProfile property: Gets the storage profile. + * + * @return the storageProfile value. + */ + public RestorePointSourceVMStorageProfile storageProfile() { + return this.storageProfile; + } + + /** + * Set the storageProfile property: Gets the storage profile. + * + * @param storageProfile the storageProfile value to set. + * @return the RestorePointSourceMetadata object itself. + */ + public RestorePointSourceMetadata withStorageProfile(RestorePointSourceVMStorageProfile storageProfile) { + this.storageProfile = storageProfile; + return this; + } + + /** + * Get the osProfile property: Gets the OS profile. + * + * @return the osProfile value. + */ + public OSProfile osProfile() { + return this.osProfile; + } + + /** + * Get the diagnosticsProfile property: Gets the diagnostics profile. + * + * @return the diagnosticsProfile value. + */ + public DiagnosticsProfile diagnosticsProfile() { + return this.diagnosticsProfile; + } + + /** + * Get the licenseType property: Gets the license type, which is for bring your own license scenario. + * + * @return the licenseType value. + */ + public String licenseType() { + return this.licenseType; + } + + /** + * Get the vmId property: Gets the virtual machine unique id. + * + * @return the vmId value. + */ + public String vmId() { + return this.vmId; + } + + /** + * Get the securityProfile property: Gets the security profile. + * + * @return the securityProfile value. + */ + public SecurityProfile securityProfile() { + return this.securityProfile; + } + + /** + * Get the location property: Location of the VM from which the restore point was created. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the userData property: UserData associated with the source VM for which restore point is captured, which is a + * base-64 encoded value. + * + * @return the userData value. + */ + public String userData() { + return this.userData; + } + + /** + * Get the hyperVGeneration property: HyperVGeneration of the source VM for which restore point is captured. + * + * @return the hyperVGeneration value. + */ + public HyperVGenerationTypes hyperVGeneration() { + return this.hyperVGeneration; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (hardwareProfile() != null) { + hardwareProfile().validate(); + } + if (storageProfile() != null) { + storageProfile().validate(); + } + if (osProfile() != null) { + osProfile().validate(); + } + if (diagnosticsProfile() != null) { + diagnosticsProfile().validate(); + } + if (securityProfile() != null) { + securityProfile().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointSourceVMDataDisk.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointSourceVMDataDisk.java new file mode 100644 index 0000000000000..6c8740d3facf5 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointSourceVMDataDisk.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.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a data disk. */ +@Fluent +public final class RestorePointSourceVMDataDisk { + /* + * Gets the logical unit number. + */ + @JsonProperty(value = "lun", access = JsonProperty.Access.WRITE_ONLY) + private Integer lun; + + /* + * Gets the disk name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Gets the caching type. + */ + @JsonProperty(value = "caching", access = JsonProperty.Access.WRITE_ONLY) + private CachingTypes caching; + + /* + * Gets the initial disk size in GB for blank data disks, and the new desired size for existing OS and Data disks. + */ + @JsonProperty(value = "diskSizeGB", access = JsonProperty.Access.WRITE_ONLY) + private Integer diskSizeGB; + + /* + * Contains the managed disk details. + */ + @JsonProperty(value = "managedDisk") + private ManagedDiskParameters managedDisk; + + /* + * Contains Disk Restore Point properties. + */ + @JsonProperty(value = "diskRestorePoint") + private DiskRestorePointAttributes diskRestorePoint; + + /* + * Shows true if the disk is write-accelerator enabled. + */ + @JsonProperty(value = "writeAcceleratorEnabled", access = JsonProperty.Access.WRITE_ONLY) + private Boolean writeAcceleratorEnabled; + + /** Creates an instance of RestorePointSourceVMDataDisk class. */ + public RestorePointSourceVMDataDisk() { + } + + /** + * Get the lun property: Gets the logical unit number. + * + * @return the lun value. + */ + public Integer lun() { + return this.lun; + } + + /** + * Get the name property: Gets the disk name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the caching property: Gets the caching type. + * + * @return the caching value. + */ + public CachingTypes caching() { + return this.caching; + } + + /** + * Get the diskSizeGB property: Gets the initial disk size in GB for blank data disks, and the new desired size for + * existing OS and Data disks. + * + * @return the diskSizeGB value. + */ + public Integer diskSizeGB() { + return this.diskSizeGB; + } + + /** + * Get the managedDisk property: Contains the managed disk details. + * + * @return the managedDisk value. + */ + public ManagedDiskParameters managedDisk() { + return this.managedDisk; + } + + /** + * Set the managedDisk property: Contains the managed disk details. + * + * @param managedDisk the managedDisk value to set. + * @return the RestorePointSourceVMDataDisk object itself. + */ + public RestorePointSourceVMDataDisk withManagedDisk(ManagedDiskParameters managedDisk) { + this.managedDisk = managedDisk; + return this; + } + + /** + * Get the diskRestorePoint property: Contains Disk Restore Point properties. + * + * @return the diskRestorePoint value. + */ + public DiskRestorePointAttributes diskRestorePoint() { + return this.diskRestorePoint; + } + + /** + * Set the diskRestorePoint property: Contains Disk Restore Point properties. + * + * @param diskRestorePoint the diskRestorePoint value to set. + * @return the RestorePointSourceVMDataDisk object itself. + */ + public RestorePointSourceVMDataDisk withDiskRestorePoint(DiskRestorePointAttributes diskRestorePoint) { + this.diskRestorePoint = diskRestorePoint; + return this; + } + + /** + * Get the writeAcceleratorEnabled property: Shows true if the disk is write-accelerator enabled. + * + * @return the writeAcceleratorEnabled value. + */ + public Boolean writeAcceleratorEnabled() { + return this.writeAcceleratorEnabled; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (managedDisk() != null) { + managedDisk().validate(); + } + if (diskRestorePoint() != null) { + diskRestorePoint().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointSourceVMStorageProfile.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointSourceVMStorageProfile.java new file mode 100644 index 0000000000000..631c3d38b0434 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointSourceVMStorageProfile.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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes the storage profile. */ +@Fluent +public final class RestorePointSourceVMStorageProfile { + /* + * Gets the OS disk of the VM captured at the time of the restore point creation. + */ + @JsonProperty(value = "osDisk") + private RestorePointSourceVmosDisk osDisk; + + /* + * Gets the data disks of the VM captured at the time of the restore point creation. + */ + @JsonProperty(value = "dataDisks") + private List dataDisks; + + /** Creates an instance of RestorePointSourceVMStorageProfile class. */ + public RestorePointSourceVMStorageProfile() { + } + + /** + * Get the osDisk property: Gets the OS disk of the VM captured at the time of the restore point creation. + * + * @return the osDisk value. + */ + public RestorePointSourceVmosDisk osDisk() { + return this.osDisk; + } + + /** + * Set the osDisk property: Gets the OS disk of the VM captured at the time of the restore point creation. + * + * @param osDisk the osDisk value to set. + * @return the RestorePointSourceVMStorageProfile object itself. + */ + public RestorePointSourceVMStorageProfile withOsDisk(RestorePointSourceVmosDisk osDisk) { + this.osDisk = osDisk; + return this; + } + + /** + * Get the dataDisks property: Gets the data disks of the VM captured at the time of the restore point creation. + * + * @return the dataDisks value. + */ + public List dataDisks() { + return this.dataDisks; + } + + /** + * Set the dataDisks property: Gets the data disks of the VM captured at the time of the restore point creation. + * + * @param dataDisks the dataDisks value to set. + * @return the RestorePointSourceVMStorageProfile object itself. + */ + public RestorePointSourceVMStorageProfile withDataDisks(List dataDisks) { + this.dataDisks = dataDisks; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (osDisk() != null) { + osDisk().validate(); + } + if (dataDisks() != null) { + dataDisks().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointSourceVmosDisk.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointSourceVmosDisk.java new file mode 100644 index 0000000000000..cf7ee8659f2e3 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointSourceVmosDisk.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.fasterxml.jackson.annotation.JsonProperty; + +/** Describes an Operating System disk. */ +@Fluent +public final class RestorePointSourceVmosDisk { + /* + * Gets the Operating System type. + */ + @JsonProperty(value = "osType", access = JsonProperty.Access.WRITE_ONLY) + private OperatingSystemType osType; + + /* + * Gets the disk encryption settings. + */ + @JsonProperty(value = "encryptionSettings", access = JsonProperty.Access.WRITE_ONLY) + private DiskEncryptionSettings encryptionSettings; + + /* + * Gets the disk name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Gets the caching type. + */ + @JsonProperty(value = "caching", access = JsonProperty.Access.WRITE_ONLY) + private CachingTypes caching; + + /* + * Gets the disk size in GB. + */ + @JsonProperty(value = "diskSizeGB", access = JsonProperty.Access.WRITE_ONLY) + private Integer diskSizeGB; + + /* + * Gets the managed disk details + */ + @JsonProperty(value = "managedDisk") + private ManagedDiskParameters managedDisk; + + /* + * Contains Disk Restore Point properties. + */ + @JsonProperty(value = "diskRestorePoint") + private DiskRestorePointAttributes diskRestorePoint; + + /* + * Shows true if the disk is write-accelerator enabled. + */ + @JsonProperty(value = "writeAcceleratorEnabled", access = JsonProperty.Access.WRITE_ONLY) + private Boolean writeAcceleratorEnabled; + + /** Creates an instance of RestorePointSourceVmosDisk class. */ + public RestorePointSourceVmosDisk() { + } + + /** + * Get the osType property: Gets the Operating System type. + * + * @return the osType value. + */ + public OperatingSystemType osType() { + return this.osType; + } + + /** + * Get the encryptionSettings property: Gets the disk encryption settings. + * + * @return the encryptionSettings value. + */ + public DiskEncryptionSettings encryptionSettings() { + return this.encryptionSettings; + } + + /** + * Get the name property: Gets the disk name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the caching property: Gets the caching type. + * + * @return the caching value. + */ + public CachingTypes caching() { + return this.caching; + } + + /** + * Get the diskSizeGB property: Gets the disk size in GB. + * + * @return the diskSizeGB value. + */ + public Integer diskSizeGB() { + return this.diskSizeGB; + } + + /** + * Get the managedDisk property: Gets the managed disk details. + * + * @return the managedDisk value. + */ + public ManagedDiskParameters managedDisk() { + return this.managedDisk; + } + + /** + * Set the managedDisk property: Gets the managed disk details. + * + * @param managedDisk the managedDisk value to set. + * @return the RestorePointSourceVmosDisk object itself. + */ + public RestorePointSourceVmosDisk withManagedDisk(ManagedDiskParameters managedDisk) { + this.managedDisk = managedDisk; + return this; + } + + /** + * Get the diskRestorePoint property: Contains Disk Restore Point properties. + * + * @return the diskRestorePoint value. + */ + public DiskRestorePointAttributes diskRestorePoint() { + return this.diskRestorePoint; + } + + /** + * Set the diskRestorePoint property: Contains Disk Restore Point properties. + * + * @param diskRestorePoint the diskRestorePoint value to set. + * @return the RestorePointSourceVmosDisk object itself. + */ + public RestorePointSourceVmosDisk withDiskRestorePoint(DiskRestorePointAttributes diskRestorePoint) { + this.diskRestorePoint = diskRestorePoint; + return this; + } + + /** + * Get the writeAcceleratorEnabled property: Shows true if the disk is write-accelerator enabled. + * + * @return the writeAcceleratorEnabled value. + */ + public Boolean writeAcceleratorEnabled() { + return this.writeAcceleratorEnabled; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (encryptionSettings() != null) { + encryptionSettings().validate(); + } + if (managedDisk() != null) { + managedDisk().validate(); + } + if (diskRestorePoint() != null) { + diskRestorePoint().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePoints.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePoints.java new file mode 100644 index 0000000000000..5fe7e51039937 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePoints.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of RestorePoints. */ +public interface RestorePoints { + /** + * The operation to delete the restore point. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the Restore Point Collection. + * @param restorePointName The name of the restore point. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String restorePointCollectionName, String restorePointName); + + /** + * The operation to delete the restore point. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the Restore Point Collection. + * @param restorePointName The name of the restore point. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String restorePointCollectionName, String restorePointName, Context context); + + /** + * The operation to get the restore point. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param restorePointName The name of the restore point. + * @param expand The expand expression to apply on the operation. 'InstanceView' retrieves information about the + * run-time state of a restore point. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return restore Point details along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, + String restorePointCollectionName, + String restorePointName, + RestorePointExpandOptions expand, + Context context); + + /** + * The operation to get the restore point. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param restorePointName The name of the restore point. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return restore Point details. + */ + RestorePoint get(String resourceGroupName, String restorePointCollectionName, String restorePointName); + + /** + * The operation to get the restore point. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return restore Point details along with {@link Response}. + */ + RestorePoint getById(String id); + + /** + * The operation to get the restore point. + * + * @param id the resource ID. + * @param expand The expand expression to apply on the operation. 'InstanceView' retrieves information about the + * run-time state of a restore point. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return restore Point details along with {@link Response}. + */ + Response getByIdWithResponse(String id, RestorePointExpandOptions expand, Context context); + + /** + * The operation to delete the restore point. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * The operation to delete the restore point. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new RestorePoint resource. + * + * @param name resource name. + * @return the first stage of the new RestorePoint definition. + */ + RestorePoint.DefinitionStages.Blank define(String name); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RetrieveBootDiagnosticsDataResult.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RetrieveBootDiagnosticsDataResult.java new file mode 100644 index 0000000000000..a5e5d34634cf8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RetrieveBootDiagnosticsDataResult.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.resourcemanager.compute.generated.fluent.models.RetrieveBootDiagnosticsDataResultInner; + +/** An immutable client-side representation of RetrieveBootDiagnosticsDataResult. */ +public interface RetrieveBootDiagnosticsDataResult { + /** + * Gets the consoleScreenshotBlobUri property: The console screenshot blob URI. + * + * @return the consoleScreenshotBlobUri value. + */ + String consoleScreenshotBlobUri(); + + /** + * Gets the serialConsoleLogBlobUri property: The serial console log blob URI. + * + * @return the serialConsoleLogBlobUri value. + */ + String serialConsoleLogBlobUri(); + + /** + * Gets the inner com.azure.resourcemanager.compute.generated.fluent.models.RetrieveBootDiagnosticsDataResultInner + * object. + * + * @return the inner object. + */ + RetrieveBootDiagnosticsDataResultInner innerModel(); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RoleInstance.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RoleInstance.java new file mode 100644 index 0000000000000..029320e352202 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RoleInstance.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.resourcemanager.compute.generated.fluent.models.RoleInstanceInner; +import java.util.Map; + +/** An immutable client-side representation of RoleInstance. */ +public interface RoleInstance { + /** + * Gets the id property: Resource Id. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: Resource Name. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: Resource Type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: Resource Location. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the sku property: The role instance SKU. + * + * @return the sku value. + */ + InstanceSku sku(); + + /** + * Gets the properties property: Role instance properties. + * + * @return the properties value. + */ + RoleInstanceProperties properties(); + + /** + * Gets the inner com.azure.resourcemanager.compute.generated.fluent.models.RoleInstanceInner object. + * + * @return the inner object. + */ + RoleInstanceInner innerModel(); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RoleInstanceListResult.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RoleInstanceListResult.java new file mode 100644 index 0000000000000..5c19aa0890935 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RoleInstanceListResult.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.azure.resourcemanager.compute.generated.fluent.models.RoleInstanceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list operation result. */ +@Fluent +public final class RoleInstanceListResult { + /* + * The list of resources. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The URI to fetch the next page of resources. Use this to get the next page of resources. Do this till nextLink + * is null to fetch all the resources. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of RoleInstanceListResult class. */ + public RoleInstanceListResult() { + } + + /** + * Get the value property: The list of resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of resources. + * + * @param value the value value to set. + * @return the RoleInstanceListResult object itself. + */ + public RoleInstanceListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URI to fetch the next page of resources. Use this to get the next page of + * resources. Do this till nextLink is null to fetch all the resources. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URI to fetch the next page of resources. Use this to get the next page of + * resources. Do this till nextLink is null to fetch all the resources. + * + * @param nextLink the nextLink value to set. + * @return the RoleInstanceListResult object itself. + */ + public RoleInstanceListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model RoleInstanceListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RoleInstanceListResult.class); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RoleInstanceNetworkProfile.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RoleInstanceNetworkProfile.java new file mode 100644 index 0000000000000..2355bbe72f107 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RoleInstanceNetworkProfile.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.management.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes the network profile for the role instance. */ +@Immutable +public final class RoleInstanceNetworkProfile { + /* + * Specifies the list of resource Ids for the network interfaces associated with the role instance. + */ + @JsonProperty(value = "networkInterfaces", access = JsonProperty.Access.WRITE_ONLY) + private List networkInterfaces; + + /** Creates an instance of RoleInstanceNetworkProfile class. */ + public RoleInstanceNetworkProfile() { + } + + /** + * Get the networkInterfaces property: Specifies the list of resource Ids for the network interfaces associated with + * the role instance. + * + * @return the networkInterfaces value. + */ + public List networkInterfaces() { + return this.networkInterfaces; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RoleInstanceProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RoleInstanceProperties.java new file mode 100644 index 0000000000000..5fe29b9f1d2c7 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RoleInstanceProperties.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.resourcemanager.compute.generated.fluent.models.RoleInstancePropertiesInner; + +/** An immutable client-side representation of RoleInstanceProperties. */ +public interface RoleInstanceProperties { + /** + * Gets the networkProfile property: Describes the network profile for the role instance. + * + * @return the networkProfile value. + */ + RoleInstanceNetworkProfile networkProfile(); + + /** + * Gets the instanceView property: The instance view of the role instance. + * + * @return the instanceView value. + */ + RoleInstanceView instanceView(); + + /** + * Gets the inner com.azure.resourcemanager.compute.generated.fluent.models.RoleInstancePropertiesInner object. + * + * @return the inner object. + */ + RoleInstancePropertiesInner innerModel(); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RoleInstanceView.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RoleInstanceView.java new file mode 100644 index 0000000000000..9018d06fe96f2 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RoleInstanceView.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.resourcemanager.compute.generated.fluent.models.RoleInstanceViewInner; +import java.util.List; + +/** An immutable client-side representation of RoleInstanceView. */ +public interface RoleInstanceView { + /** + * Gets the platformUpdateDomain property: The Update Domain. + * + * @return the platformUpdateDomain value. + */ + Integer platformUpdateDomain(); + + /** + * Gets the platformFaultDomain property: The Fault Domain. + * + * @return the platformFaultDomain value. + */ + Integer platformFaultDomain(); + + /** + * Gets the privateId property: Specifies a unique identifier generated internally for the cloud service associated + * with this role instance. <br /><br /> NOTE: If you are using Azure Diagnostics extension, this + * property can be used as 'DeploymentId' for querying details. + * + * @return the privateId value. + */ + String privateId(); + + /** + * Gets the statuses property: The statuses property. + * + * @return the statuses value. + */ + List statuses(); + + /** + * Gets the inner com.azure.resourcemanager.compute.generated.fluent.models.RoleInstanceViewInner object. + * + * @return the inner object. + */ + RoleInstanceViewInner innerModel(); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RoleInstances.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RoleInstances.java new file mode 100644 index 0000000000000..2d0cd9702df11 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RoleInstances.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.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Specifies a list of role instances from the cloud service. */ +@Fluent +public final class RoleInstances { + /* + * List of cloud service role instance names. Value of '*' will signify all role instances of the cloud service. + */ + @JsonProperty(value = "roleInstances", required = true) + private List roleInstances; + + /** Creates an instance of RoleInstances class. */ + public RoleInstances() { + } + + /** + * Get the roleInstances property: List of cloud service role instance names. Value of '*' will signify all role + * instances of the cloud service. + * + * @return the roleInstances value. + */ + public List roleInstances() { + return this.roleInstances; + } + + /** + * Set the roleInstances property: List of cloud service role instance names. Value of '*' will signify all role + * instances of the cloud service. + * + * @param roleInstances the roleInstances value to set. + * @return the RoleInstances object itself. + */ + public RoleInstances withRoleInstances(List roleInstances) { + this.roleInstances = roleInstances; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (roleInstances() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property roleInstances in model RoleInstances")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RoleInstances.class); +} 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..408d3938709ed --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** Information about rollback on failed VM instances after a OS Upgrade operation. */ +@Immutable +public final class RollbackStatusInfo { + /* + * 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; + + /** Creates an instance of RollbackStatusInfo class. */ + public RollbackStatusInfo() { + } + + /** + * 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..2f675c0fb039e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RollingUpgradeActionType.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.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** The last action performed on the rolling upgrade. */ +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) { + if (value == null) { + return null; + } + RollingUpgradeActionType[] items = RollingUpgradeActionType.values(); + for (RollingUpgradeActionType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @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..5717ca1b745e5 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RollingUpgradePolicy.java @@ -0,0 +1,274 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The configuration parameters used while performing a rolling upgrade. */ +@Fluent +public final class RollingUpgradePolicy { + /* + * 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; + + /* + * Rollback failed instances to previous model if the Rolling Upgrade policy is violated. + */ + @JsonProperty(value = "rollbackFailedInstancesOnPolicyBreach") + private Boolean rollbackFailedInstancesOnPolicyBreach; + + /* + * Create new virtual machines to upgrade the scale set, rather than updating the existing virtual machines. + * Existing virtual machines will be deleted once the new virtual machines are created for each batch. + */ + @JsonProperty(value = "maxSurge") + private Boolean maxSurge; + + /** Creates an instance of RollingUpgradePolicy class. */ + public RollingUpgradePolicy() { + } + + /** + * 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; + } + + /** + * Get the rollbackFailedInstancesOnPolicyBreach property: Rollback failed instances to previous model if the + * Rolling Upgrade policy is violated. + * + * @return the rollbackFailedInstancesOnPolicyBreach value. + */ + public Boolean rollbackFailedInstancesOnPolicyBreach() { + return this.rollbackFailedInstancesOnPolicyBreach; + } + + /** + * Set the rollbackFailedInstancesOnPolicyBreach property: Rollback failed instances to previous model if the + * Rolling Upgrade policy is violated. + * + * @param rollbackFailedInstancesOnPolicyBreach the rollbackFailedInstancesOnPolicyBreach value to set. + * @return the RollingUpgradePolicy object itself. + */ + public RollingUpgradePolicy withRollbackFailedInstancesOnPolicyBreach( + Boolean rollbackFailedInstancesOnPolicyBreach) { + this.rollbackFailedInstancesOnPolicyBreach = rollbackFailedInstancesOnPolicyBreach; + return this; + } + + /** + * Get the maxSurge property: Create new virtual machines to upgrade the scale set, rather than updating the + * existing virtual machines. Existing virtual machines will be deleted once the new virtual machines are created + * for each batch. + * + * @return the maxSurge value. + */ + public Boolean maxSurge() { + return this.maxSurge; + } + + /** + * Set the maxSurge property: Create new virtual machines to upgrade the scale set, rather than updating the + * existing virtual machines. Existing virtual machines will be deleted once the new virtual machines are created + * for each batch. + * + * @param maxSurge the maxSurge value to set. + * @return the RollingUpgradePolicy object itself. + */ + public RollingUpgradePolicy withMaxSurge(Boolean maxSurge) { + this.maxSurge = maxSurge; + 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..4ec07d7da45cc --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** Information about the number of virtual machine instances in each upgrade state. */ +@Immutable +public final class RollingUpgradeProgressInfo { + /* + * 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; + + /** Creates an instance of RollingUpgradeProgressInfo class. */ + public RollingUpgradeProgressInfo() { + } + + /** + * 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..fac204b66117b --- /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.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Information about the current running state of the overall upgrade. */ +@Immutable +public final class RollingUpgradeRunningStatus { + /* + * 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; + + /** Creates an instance of RollingUpgradeRunningStatus class. */ + public RollingUpgradeRunningStatus() { + } + + /** + * 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..9faa64a726029 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RollingUpgradeStatusCode.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.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Code indicating the current status of the upgrade. */ +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) { + if (value == null) { + return null; + } + RollingUpgradeStatusCode[] items = RollingUpgradeStatusCode.values(); + for (RollingUpgradeStatusCode item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @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..6ef50be82976a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RunCommandInput.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.JsonProperty; +import java.util.List; + +/** Capture Virtual Machine parameters. */ +@Fluent +public final class RunCommandInput { + /* + * 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; + + /** Creates an instance of RunCommandInput class. */ + public RunCommandInput() { + } + + /** + * 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()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RunCommandInput.class); +} 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..21d48c2125ffa --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RunCommandInputParameter.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.JsonProperty; + +/** Describes the properties of a run command parameter. */ +@Fluent +public final class RunCommandInputParameter { + /* + * 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; + + /** Creates an instance of RunCommandInputParameter class. */ + public RunCommandInputParameter() { + } + + /** + * 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")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RunCommandInputParameter.class); +} 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..4104cb0ab9986 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RunCommandListResult.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.azure.resourcemanager.compute.generated.fluent.models.RunCommandDocumentBaseInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List Virtual Machine operation response. */ +@Fluent +public final class RunCommandListResult { + /* + * 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; + + /** Creates an instance of RunCommandListResult class. */ + public RunCommandListResult() { + } + + /** + * 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()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RunCommandListResult.class); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RunCommandManagedIdentity.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RunCommandManagedIdentity.java new file mode 100644 index 0000000000000..6731cf49beee7 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RunCommandManagedIdentity.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.fasterxml.jackson.annotation.JsonProperty; + +/** + * Contains clientId or objectId (use only one, not both) of a user-assigned managed identity that has access to storage + * blob used in Run Command. Use an empty RunCommandManagedIdentity object in case of system-assigned identity. Make + * sure the Azure storage blob exists in case of scriptUri, and managed identity has been given access to blob's + * container with 'Storage Blob Data Reader' role assignment with scriptUri blob and 'Storage Blob Data Contributor' for + * Append blobs(outputBlobUri, errorBlobUri). In case of user assigned identity, make sure you add it under VM's + * identity. For more info on managed identity and Run Command, refer https://aka.ms/ManagedIdentity and + * https://aka.ms/RunCommandManaged. + */ +@Fluent +public final class RunCommandManagedIdentity { + /* + * Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. + */ + @JsonProperty(value = "clientId") + private String clientId; + + /* + * Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. + */ + @JsonProperty(value = "objectId") + private String objectId; + + /** Creates an instance of RunCommandManagedIdentity class. */ + public RunCommandManagedIdentity() { + } + + /** + * Get the clientId property: Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be + * used if this is provided. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Set the clientId property: Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be + * used if this is provided. + * + * @param clientId the clientId value to set. + * @return the RunCommandManagedIdentity object itself. + */ + public RunCommandManagedIdentity withClientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get the objectId property: Object Id (GUID value) of the user-assigned managed identity. ClientId should not be + * used if this is provided. + * + * @return the objectId value. + */ + public String objectId() { + return this.objectId; + } + + /** + * Set the objectId property: Object Id (GUID value) of the user-assigned managed identity. ClientId should not be + * used if this is provided. + * + * @param objectId the objectId value to set. + * @return the RunCommandManagedIdentity object itself. + */ + public RunCommandManagedIdentity withObjectId(String objectId) { + this.objectId = objectId; + 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/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..08a2c1e8ab5c6 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RunCommandParameterDefinition.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the properties of a run command parameter. */ +@Fluent +public final class RunCommandParameterDefinition { + /* + * 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; + + /** Creates an instance of RunCommandParameterDefinition class. */ + public RunCommandParameterDefinition() { + } + + /** + * 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")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RunCommandParameterDefinition.class); +} 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..1b29dd587e741 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ScaleInPolicy.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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a scale-in policy for a virtual machine scale set. */ +@Fluent +public final class ScaleInPolicy { + /* + * 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; + + /* + * This property allows you to specify if virtual machines chosen for removal have to be force deleted when a + * virtual machine scale set is being scaled-in.(Feature in Preview) + */ + @JsonProperty(value = "forceDeletion") + private Boolean forceDeletion; + + /** Creates an instance of ScaleInPolicy class. */ + public ScaleInPolicy() { + } + + /** + * 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; + } + + /** + * Get the forceDeletion property: This property allows you to specify if virtual machines chosen for removal have + * to be force deleted when a virtual machine scale set is being scaled-in.(Feature in Preview). + * + * @return the forceDeletion value. + */ + public Boolean forceDeletion() { + return this.forceDeletion; + } + + /** + * Set the forceDeletion property: This property allows you to specify if virtual machines chosen for removal have + * to be force deleted when a virtual machine scale set is being scaled-in.(Feature in Preview). + * + * @param forceDeletion the forceDeletion value to set. + * @return the ScaleInPolicy object itself. + */ + public ScaleInPolicy withForceDeletion(Boolean forceDeletion) { + this.forceDeletion = forceDeletion; + 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..9f5f128b16dc3 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ScheduledEventsProfile.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.fasterxml.jackson.annotation.JsonProperty; + +/** The ScheduledEventsProfile model. */ +@Fluent +public final class ScheduledEventsProfile { + /* + * Specifies Terminate Scheduled Event related configurations. + */ + @JsonProperty(value = "terminateNotificationProfile") + private TerminateNotificationProfile terminateNotificationProfile; + + /* + * Specifies OS Image Scheduled Event related configurations. + */ + @JsonProperty(value = "osImageNotificationProfile") + private OSImageNotificationProfile osImageNotificationProfile; + + /** Creates an instance of ScheduledEventsProfile class. */ + public ScheduledEventsProfile() { + } + + /** + * 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; + } + + /** + * Get the osImageNotificationProfile property: Specifies OS Image Scheduled Event related configurations. + * + * @return the osImageNotificationProfile value. + */ + public OSImageNotificationProfile osImageNotificationProfile() { + return this.osImageNotificationProfile; + } + + /** + * Set the osImageNotificationProfile property: Specifies OS Image Scheduled Event related configurations. + * + * @param osImageNotificationProfile the osImageNotificationProfile value to set. + * @return the ScheduledEventsProfile object itself. + */ + public ScheduledEventsProfile withOsImageNotificationProfile( + OSImageNotificationProfile osImageNotificationProfile) { + this.osImageNotificationProfile = osImageNotificationProfile; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (terminateNotificationProfile() != null) { + terminateNotificationProfile().validate(); + } + if (osImageNotificationProfile() != null) { + osImageNotificationProfile().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SecurityEncryptionTypes.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SecurityEncryptionTypes.java new file mode 100644 index 0000000000000..3b2fe759a55a6 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SecurityEncryptionTypes.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Specifies the EncryptionType of the managed disk. It is set to DiskWithVMGuestState for encryption of the managed + * disk along with VMGuestState blob, and VMGuestStateOnly for encryption of just the VMGuestState blob. **Note:** It + * can be set for only Confidential VMs. + */ +public final class SecurityEncryptionTypes extends ExpandableStringEnum { + /** Static value VMGuestStateOnly for SecurityEncryptionTypes. */ + public static final SecurityEncryptionTypes VMGUEST_STATE_ONLY = fromString("VMGuestStateOnly"); + + /** Static value DiskWithVMGuestState for SecurityEncryptionTypes. */ + public static final SecurityEncryptionTypes DISK_WITH_VMGUEST_STATE = fromString("DiskWithVMGuestState"); + + /** + * Creates a new instance of SecurityEncryptionTypes value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SecurityEncryptionTypes() { + } + + /** + * Creates or finds a SecurityEncryptionTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding SecurityEncryptionTypes. + */ + @JsonCreator + public static SecurityEncryptionTypes fromString(String name) { + return fromString(name, SecurityEncryptionTypes.class); + } + + /** + * Gets known SecurityEncryptionTypes values. + * + * @return known SecurityEncryptionTypes values. + */ + public static Collection values() { + return values(SecurityEncryptionTypes.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SecurityPostureReference.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SecurityPostureReference.java new file mode 100644 index 0000000000000..d88efdcd81fc3 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SecurityPostureReference.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.resourcemanager.compute.generated.fluent.models.VirtualMachineExtensionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Specifies the security posture to be used for all virtual machines in the scale set. Minimum api-version: 2023-03-01. + */ +@Fluent +public final class SecurityPostureReference { + /* + * The security posture reference id in the form of + * /CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|{major.*}|latest + */ + @JsonProperty(value = "id") + private String id; + + /* + * List of virtual machine extensions to exclude when applying the Security Posture. + */ + @JsonProperty(value = "excludeExtensions") + private List excludeExtensions; + + /** Creates an instance of SecurityPostureReference class. */ + public SecurityPostureReference() { + } + + /** + * Get the id property: The security posture reference id in the form of + * /CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|{major.*}|latest. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The security posture reference id in the form of + * /CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|{major.*}|latest. + * + * @param id the id value to set. + * @return the SecurityPostureReference object itself. + */ + public SecurityPostureReference withId(String id) { + this.id = id; + return this; + } + + /** + * Get the excludeExtensions property: List of virtual machine extensions to exclude when applying the Security + * Posture. + * + * @return the excludeExtensions value. + */ + public List excludeExtensions() { + return this.excludeExtensions; + } + + /** + * Set the excludeExtensions property: List of virtual machine extensions to exclude when applying the Security + * Posture. + * + * @param excludeExtensions the excludeExtensions value to set. + * @return the SecurityPostureReference object itself. + */ + public SecurityPostureReference withExcludeExtensions(List excludeExtensions) { + this.excludeExtensions = excludeExtensions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (excludeExtensions() != null) { + excludeExtensions().forEach(e -> e.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..8aef9b45b20b7 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SecurityProfile.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +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 { + /* + * 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. The default behavior is: 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 has to be set to any specified value to enable + * UefiSettings. The default behavior is: UefiSettings will not be enabled unless this property is set. + */ + @JsonProperty(value = "securityType") + private SecurityTypes securityType; + + /** Creates an instance of SecurityProfile class. */ + public SecurityProfile() { + } + + /** + * Get the uefiSettings property: Specifies the security settings like secure boot and vTPM used while creating the + * virtual machine. 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. 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. The default behavior is: 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. The default behavior is: 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 has to be set to any + * specified value to enable UefiSettings. The default behavior is: UefiSettings will not be enabled unless this + * property is set. + * + * @return the securityType value. + */ + public SecurityTypes securityType() { + return this.securityType; + } + + /** + * Set the securityType property: Specifies the SecurityType of the virtual machine. It has to be set to any + * specified value to enable UefiSettings. The default behavior is: UefiSettings will not be enabled unless this + * property is set. + * + * @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..46aaf835e3a1a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SecurityTypes.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Specifies the SecurityType of the virtual machine. It has to be set to any specified value to enable UefiSettings. + * The default behavior is: UefiSettings will not be enabled unless this property is set. + */ +public final class SecurityTypes extends ExpandableStringEnum { + /** Static value TrustedLaunch for SecurityTypes. */ + public static final SecurityTypes TRUSTED_LAUNCH = fromString("TrustedLaunch"); + + /** Static value ConfidentialVM for SecurityTypes. */ + public static final SecurityTypes CONFIDENTIAL_VM = fromString("ConfidentialVM"); + + /** + * Creates a new instance of SecurityTypes value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SecurityTypes() { + } + + /** + * Creates or finds a SecurityTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding SecurityTypes. + */ + @JsonCreator + public static SecurityTypes fromString(String name) { + return fromString(name, SecurityTypes.class); + } + + /** + * Gets known SecurityTypes values. + * + * @return known SecurityTypes values. + */ + public static Collection values() { + return values(SecurityTypes.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SelectPermissions.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SelectPermissions.java new file mode 100644 index 0000000000000..72b0e8019bb21 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SelectPermissions.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.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 a new instance of SelectPermissions value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SelectPermissions() { + } + + /** + * 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); + } + + /** + * Gets known SelectPermissions values. + * + * @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/ServiceArtifactReference.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ServiceArtifactReference.java new file mode 100644 index 0000000000000..9c03c68be061d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ServiceArtifactReference.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.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifies the service artifact reference id used to set same image version for all virtual machines in the scale set + * when using 'latest' image version. Minimum api-version: 2022-11-01. + */ +@Fluent +public final class ServiceArtifactReference { + /* + * The service artifact reference id in the form of + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/serviceArtifacts/{serviceArtifactName}/vmArtifactsProfiles/{vmArtifactsProfilesName} + */ + @JsonProperty(value = "id") + private String id; + + /** Creates an instance of ServiceArtifactReference class. */ + public ServiceArtifactReference() { + } + + /** + * Get the id property: The service artifact reference id in the form of + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/serviceArtifacts/{serviceArtifactName}/vmArtifactsProfiles/{vmArtifactsProfilesName}. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The service artifact reference id in the form of + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/serviceArtifacts/{serviceArtifactName}/vmArtifactsProfiles/{vmArtifactsProfilesName}. + * + * @param id the id value to set. + * @return the ServiceArtifactReference object itself. + */ + public ServiceArtifactReference 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/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..7573a1669bbed --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SettingNames.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.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Specifies the name of the setting to which the content applies. Possible values are: FirstLogonCommands and + * AutoLogon. + */ +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) { + if (value == null) { + return null; + } + SettingNames[] items = SettingNames.values(); + for (SettingNames item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @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..016fe99faf0d7 --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** The ShareInfoElement model. */ +@Immutable +public final class ShareInfoElement { + /* + * 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; + + /** Creates an instance of ShareInfoElement class. */ + public ShareInfoElement() { + } + + /** + * 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..ce53edf5038ec --- /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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 along with {@link Response}. + */ + Response getWithResponse(String location, String galleryUniqueName, 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); +} 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/SharedGalleryDataDiskImage.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharedGalleryDataDiskImage.java new file mode 100644 index 0000000000000..2ae7698149a35 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharedGalleryDataDiskImage.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.fasterxml.jackson.annotation.JsonProperty; + +/** This is the data disk image. */ +@Fluent +public final class SharedGalleryDataDiskImage extends SharedGalleryDiskImage { + /* + * 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; + + /** Creates an instance of SharedGalleryDataDiskImage class. */ + public SharedGalleryDataDiskImage() { + } + + /** + * 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 SharedGalleryDataDiskImage object itself. + */ + public SharedGalleryDataDiskImage withLun(int lun) { + this.lun = lun; + return this; + } + + /** {@inheritDoc} */ + @Override + public SharedGalleryDataDiskImage withHostCaching(SharedGalleryHostCaching hostCaching) { + super.withHostCaching(hostCaching); + 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/SharedGalleryDiskImage.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharedGalleryDiskImage.java new file mode 100644 index 0000000000000..9902eae9e6272 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharedGalleryDiskImage.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.fasterxml.jackson.annotation.JsonProperty; + +/** This is the disk image base class. */ +@Fluent +public class SharedGalleryDiskImage { + /* + * This property indicates the size of the VHD to be created. + */ + @JsonProperty(value = "diskSizeGB", access = JsonProperty.Access.WRITE_ONLY) + private Integer diskSizeGB; + + /* + * The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite' + */ + @JsonProperty(value = "hostCaching") + private SharedGalleryHostCaching hostCaching; + + /** Creates an instance of SharedGalleryDiskImage class. */ + public SharedGalleryDiskImage() { + } + + /** + * Get the diskSizeGB property: This property indicates the size of the VHD to be created. + * + * @return the diskSizeGB value. + */ + public Integer diskSizeGB() { + return this.diskSizeGB; + } + + /** + * Get the hostCaching property: The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'. + * + * @return the hostCaching value. + */ + public SharedGalleryHostCaching 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 SharedGalleryDiskImage object itself. + */ + public SharedGalleryDiskImage withHostCaching(SharedGalleryHostCaching hostCaching) { + this.hostCaching = hostCaching; + 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/SharedGalleryHostCaching.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharedGalleryHostCaching.java new file mode 100644 index 0000000000000..d6c58ea644e87 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharedGalleryHostCaching.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'. */ +public final class SharedGalleryHostCaching extends ExpandableStringEnum { + /** Static value None for SharedGalleryHostCaching. */ + public static final SharedGalleryHostCaching NONE = fromString("None"); + + /** Static value ReadOnly for SharedGalleryHostCaching. */ + public static final SharedGalleryHostCaching READ_ONLY = fromString("ReadOnly"); + + /** Static value ReadWrite for SharedGalleryHostCaching. */ + public static final SharedGalleryHostCaching READ_WRITE = fromString("ReadWrite"); + + /** + * Creates a new instance of SharedGalleryHostCaching value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SharedGalleryHostCaching() { + } + + /** + * Creates or finds a SharedGalleryHostCaching from its string representation. + * + * @param name a name to look for. + * @return the corresponding SharedGalleryHostCaching. + */ + @JsonCreator + public static SharedGalleryHostCaching fromString(String name) { + return fromString(name, SharedGalleryHostCaching.class); + } + + /** + * Gets known SharedGalleryHostCaching values. + * + * @return known SharedGalleryHostCaching values. + */ + public static Collection values() { + return values(SharedGalleryHostCaching.class); + } +} 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..64cd943cd95ea --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharedGalleryImage.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights 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 architecture property: The architecture of the image. Applicable to OS disks only. + * + * @return the architecture value. + */ + Architecture architecture(); + + /** + * Gets the privacyStatementUri property: Privacy statement uri for the current community gallery image. + * + * @return the privacyStatementUri value. + */ + String privacyStatementUri(); + + /** + * Gets the eula property: End-user license agreement for the current community gallery image. + * + * @return the eula value. + */ + String eula(); + + /** + * 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..3e02bc27bef2d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharedGalleryImageList.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.azure.resourcemanager.compute.generated.fluent.models.SharedGalleryImageInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List Shared Gallery Images operation response. */ +@Fluent +public final class SharedGalleryImageList { + /* + * 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; + + /** Creates an instance of SharedGalleryImageList class. */ + public SharedGalleryImageList() { + } + + /** + * 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()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SharedGalleryImageList.class); +} 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..7cb66bc68ea22 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharedGalleryImageVersion.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.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 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. + */ + Boolean excludeFromLatest(); + + /** + * Gets the storageProfile property: Describes the storage profile of the image version. + * + * @return the storageProfile value. + */ + SharedGalleryImageVersionStorageProfile storageProfile(); + + /** + * 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..c078dbb51e428 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharedGalleryImageVersionList.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.azure.resourcemanager.compute.generated.fluent.models.SharedGalleryImageVersionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List Shared Gallery Image versions operation response. */ +@Fluent +public final class SharedGalleryImageVersionList { + /* + * 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; + + /** Creates an instance of SharedGalleryImageVersionList class. */ + public SharedGalleryImageVersionList() { + } + + /** + * 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()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SharedGalleryImageVersionList.class); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharedGalleryImageVersionStorageProfile.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharedGalleryImageVersionStorageProfile.java new file mode 100644 index 0000000000000..0e421f007eff4 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharedGalleryImageVersionStorageProfile.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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** This is the storage profile of a Gallery Image Version. */ +@Fluent +public final class SharedGalleryImageVersionStorageProfile { + /* + * This is the OS disk image. + */ + @JsonProperty(value = "osDiskImage") + private SharedGalleryOSDiskImage osDiskImage; + + /* + * A list of data disk images. + */ + @JsonProperty(value = "dataDiskImages") + private List dataDiskImages; + + /** Creates an instance of SharedGalleryImageVersionStorageProfile class. */ + public SharedGalleryImageVersionStorageProfile() { + } + + /** + * Get the osDiskImage property: This is the OS disk image. + * + * @return the osDiskImage value. + */ + public SharedGalleryOSDiskImage osDiskImage() { + return this.osDiskImage; + } + + /** + * Set the osDiskImage property: This is the OS disk image. + * + * @param osDiskImage the osDiskImage value to set. + * @return the SharedGalleryImageVersionStorageProfile object itself. + */ + public SharedGalleryImageVersionStorageProfile withOsDiskImage(SharedGalleryOSDiskImage 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 SharedGalleryImageVersionStorageProfile object itself. + */ + public SharedGalleryImageVersionStorageProfile 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/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..2535bf87113ed --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharedGalleryImageVersions.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.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 as paginated response with {@link + * PagedIterable}. + */ + 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 as paginated response with {@link + * PagedIterable}. + */ + 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>. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 along with {@link Response}. + */ + Response getWithResponse( + String location, + String galleryUniqueName, + String galleryImageName, + String galleryImageVersionName, + 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); +} 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..310659d22b856 --- /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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 along with {@link Response}. + */ + Response getWithResponse( + String location, String galleryUniqueName, String galleryImageName, 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); +} 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..fee4a781236d4 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharedGalleryList.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.azure.resourcemanager.compute.generated.fluent.models.SharedGalleryInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List Shared Galleries operation response. */ +@Fluent +public final class SharedGalleryList { + /* + * 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; + + /** Creates an instance of SharedGalleryList class. */ + public SharedGalleryList() { + } + + /** + * 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()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SharedGalleryList.class); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharedGalleryOSDiskImage.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharedGalleryOSDiskImage.java new file mode 100644 index 0000000000000..e16bed2416c18 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharedGalleryOSDiskImage.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; + +/** This is the OS disk image. */ +@Fluent +public final class SharedGalleryOSDiskImage extends SharedGalleryDiskImage { + /** Creates an instance of SharedGalleryOSDiskImage class. */ + public SharedGalleryOSDiskImage() { + } + + /** {@inheritDoc} */ + @Override + public SharedGalleryOSDiskImage withHostCaching(SharedGalleryHostCaching hostCaching) { + super.withHostCaching(hostCaching); + 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/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..928d4dd2ebbfa --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharedToValues.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.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 a new instance of SharedToValues value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SharedToValues() { + } + + /** + * 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); + } + + /** + * Gets known SharedToValues values. + * + * @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..4dc6b5b679f5a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharingProfile.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.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Profile for gallery sharing to subscription or tenant. */ +@Fluent +public final class SharingProfile { + /* + * This property allows you to specify the permission of sharing gallery.

Possible values are:

+ * **Private**

**Groups**

**Community** + */ + @JsonProperty(value = "permissions") + private GallerySharingPermissionTypes permissions; + + /* + * A list of sharing profile groups. + */ + @JsonProperty(value = "groups", access = JsonProperty.Access.WRITE_ONLY) + private List groups; + + /* + * Information of community gallery if current gallery is shared to community. + */ + @JsonProperty(value = "communityGalleryInfo") + private CommunityGalleryInfo communityGalleryInfo; + + /** Creates an instance of SharingProfile class. */ + public SharingProfile() { + } + + /** + * 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** + * <br><br> **Community**. + * + * @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** + * <br><br> **Community**. + * + * @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; + } + + /** + * Get the communityGalleryInfo property: Information of community gallery if current gallery is shared to + * community. + * + * @return the communityGalleryInfo value. + */ + public CommunityGalleryInfo communityGalleryInfo() { + return this.communityGalleryInfo; + } + + /** + * Set the communityGalleryInfo property: Information of community gallery if current gallery is shared to + * community. + * + * @param communityGalleryInfo the communityGalleryInfo value to set. + * @return the SharingProfile object itself. + */ + public SharingProfile withCommunityGalleryInfo(CommunityGalleryInfo communityGalleryInfo) { + this.communityGalleryInfo = communityGalleryInfo; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (groups() != null) { + groups().forEach(e -> e.validate()); + } + if (communityGalleryInfo() != null) { + communityGalleryInfo().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..522e341ed3308 --- /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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Group of the gallery sharing profile. */ +@Fluent +public final class SharingProfileGroup { + /* + * 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; + + /** Creates an instance of SharingProfileGroup class. */ + public SharingProfileGroup() { + } + + /** + * 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..7dd3bf48cf605 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharingProfileGroupTypes.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * This property allows you to specify the type of sharing group. <br><br> Possible values are: + * <br><br> **Subscriptions** <br><br> **AADTenants**. + */ +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 a new instance of SharingProfileGroupTypes value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SharingProfileGroupTypes() { + } + + /** + * 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); + } + + /** + * Gets known SharingProfileGroupTypes values. + * + * @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/SharingState.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharingState.java new file mode 100644 index 0000000000000..1e236c9603f3c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharingState.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * The sharing state of the gallery. + * + *

The sharing state of the gallery, which only appears in the response. + */ +public final class SharingState extends ExpandableStringEnum { + /** Static value Succeeded for SharingState. */ + public static final SharingState SUCCEEDED = fromString("Succeeded"); + + /** Static value InProgress for SharingState. */ + public static final SharingState IN_PROGRESS = fromString("InProgress"); + + /** Static value Failed for SharingState. */ + public static final SharingState FAILED = fromString("Failed"); + + /** Static value Unknown for SharingState. */ + public static final SharingState UNKNOWN = fromString("Unknown"); + + /** + * Creates a new instance of SharingState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SharingState() { + } + + /** + * Creates or finds a SharingState from its string representation. + * + * @param name a name to look for. + * @return the corresponding SharingState. + */ + @JsonCreator + public static SharingState fromString(String name) { + return fromString(name, SharingState.class); + } + + /** + * Gets known SharingState values. + * + * @return known SharingState values. + */ + public static Collection values() { + return values(SharingState.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharingStatus.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharingStatus.java new file mode 100644 index 0000000000000..942fa8b013c5f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharingStatus.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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Sharing status of current gallery. */ +@Fluent +public final class SharingStatus { + /* + * The sharing state of the gallery. + * + * Aggregated sharing state of current gallery. + */ + @JsonProperty(value = "aggregatedState", access = JsonProperty.Access.WRITE_ONLY) + private SharingState aggregatedState; + + /* + * Summary of all regional sharing status. + */ + @JsonProperty(value = "summary") + private List summary; + + /** Creates an instance of SharingStatus class. */ + public SharingStatus() { + } + + /** + * Get the aggregatedState property: The sharing state of the gallery. + * + *

Aggregated sharing state of current gallery. + * + * @return the aggregatedState value. + */ + public SharingState aggregatedState() { + return this.aggregatedState; + } + + /** + * Get the summary property: Summary of all regional sharing status. + * + * @return the summary value. + */ + public List summary() { + return this.summary; + } + + /** + * Set the summary property: Summary of all regional sharing status. + * + * @param summary the summary value to set. + * @return the SharingStatus object itself. + */ + public SharingStatus withSummary(List summary) { + this.summary = summary; + return this; + } + + /** + * 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/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..1a6fa84c3717d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharingUpdateOperationTypes.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * 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**. + */ +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"); + + /** Static value EnableCommunity for SharingUpdateOperationTypes. */ + public static final SharingUpdateOperationTypes ENABLE_COMMUNITY = fromString("EnableCommunity"); + + /** + * Creates a new instance of SharingUpdateOperationTypes value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SharingUpdateOperationTypes() { + } + + /** + * 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); + } + + /** + * Gets known SharingUpdateOperationTypes values. + * + * @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..665e01b45795c --- /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.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 { + /* + * 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; + + /** Creates an instance of Sku class. */ + public Sku() { + } + + /** + * 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..d4f41e9f48c9b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Snapshot.java @@ -0,0 +1,823 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 supportedCapabilities property: List of supported capabilities for the image from which the source disk + * from the snapshot was originally created. + * + * @return the supportedCapabilities value. + */ + SupportedCapabilities supportedCapabilities(); + + /** + * 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 incrementalSnapshotFamilyId property: Incremental snapshots for a disk share an incremental snapshot + * family id. The Get Page Range Diff API can only be called on incremental snapshots with the same family id. + * + * @return the incrementalSnapshotFamilyId value. + */ + String incrementalSnapshotFamilyId(); + + /** + * 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 securityProfile property: Contains the security related information for the resource. + * + * @return the securityProfile value. + */ + DiskSecurityProfile securityProfile(); + + /** + * Gets the supportsHibernation property: Indicates the OS on a snapshot supports hibernation. + * + * @return the supportsHibernation value. + */ + Boolean supportsHibernation(); + + /** + * Gets the publicNetworkAccess property: Policy for controlling export on the disk. + * + * @return the publicNetworkAccess value. + */ + PublicNetworkAccess publicNetworkAccess(); + + /** + * Gets the completionPercent property: Percentage complete for the background copy when a resource is created via + * the CopyStart operation. + * + * @return the completionPercent value. + */ + Float completionPercent(); + + /** + * Gets the copyCompletionError property: Indicates the error details if the background copy of a resource created + * via the CopyStart operation fails. + * + * @return the copyCompletionError value. + */ + CopyCompletionError copyCompletionError(); + + /** + * Gets the dataAccessAuthMode property: Additional authentication requirements when exporting or uploading to a + * disk or snapshot. + * + * @return the dataAccessAuthMode value. + */ + DataAccessAuthMode dataAccessAuthMode(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.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.WithSupportedCapabilities, + DefinitionStages.WithCreationData, + DefinitionStages.WithDiskSizeGB, + DefinitionStages.WithEncryptionSettingsCollection, + DefinitionStages.WithIncremental, + DefinitionStages.WithEncryption, + DefinitionStages.WithNetworkAccessPolicy, + DefinitionStages.WithDiskAccessId, + DefinitionStages.WithSecurityProfile, + DefinitionStages.WithSupportsHibernation, + DefinitionStages.WithPublicNetworkAccess, + DefinitionStages.WithCompletionPercent, + DefinitionStages.WithCopyCompletionError, + DefinitionStages.WithDataAccessAuthMode { + /** + * 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 supportedCapabilities. */ + interface WithSupportedCapabilities { + /** + * Specifies the supportedCapabilities property: List of supported capabilities for the image from which the + * source disk from the snapshot was originally created.. + * + * @param supportedCapabilities List of supported capabilities for the image from which the source disk from + * the snapshot was originally created. + * @return the next definition stage. + */ + WithCreate withSupportedCapabilities(SupportedCapabilities supportedCapabilities); + } + /** The stage of the Snapshot definition allowing to specify creationData. */ + interface WithCreationData { + /** + * Specifies the creationData property: Disk source information. CreationData information cannot be changed + * after the disk has been created.. + * + * @param creationData Disk source information. CreationData information cannot be changed after the disk + * has been created. + * @return the next definition stage. + */ + WithCreate withCreationData(CreationData creationData); + } + /** The stage of the Snapshot definition allowing to specify diskSizeGB. */ + interface WithDiskSizeGB { + /** + * Specifies the diskSizeGB property: If creationData.createOption is Empty, this field is mandatory and it + * indicates the size of the disk to create. If this field is present for updates or creation with other + * options, it indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and + * can only increase the disk's size.. + * + * @param diskSizeGB If creationData.createOption is Empty, this field is mandatory and it indicates the + * size of the disk to create. If this field is present for updates or creation with other options, it + * indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and can + * only increase the disk's size. + * @return the next definition stage. + */ + WithCreate withDiskSizeGB(Integer diskSizeGB); + } + /** The stage of the Snapshot definition allowing to specify encryptionSettingsCollection. */ + interface WithEncryptionSettingsCollection { + /** + * Specifies the encryptionSettingsCollection property: Encryption settings collection used be Azure Disk + * Encryption, can contain multiple encryption settings per disk or snapshot.. + * + * @param encryptionSettingsCollection Encryption settings collection used be Azure Disk Encryption, can + * contain multiple encryption settings per disk or snapshot. + * @return the next definition stage. + */ + WithCreate withEncryptionSettingsCollection(EncryptionSettingsCollection encryptionSettingsCollection); + } + /** The stage of the Snapshot definition allowing to specify incremental. */ + interface WithIncremental { + /** + * Specifies the incremental property: Whether a snapshot is incremental. Incremental snapshots on the same + * disk occupy less space than full snapshots and can be diffed.. + * + * @param incremental Whether a snapshot is incremental. Incremental snapshots on the same disk occupy less + * space than full snapshots and can be diffed. + * @return the next definition stage. + */ + WithCreate withIncremental(Boolean incremental); + } + /** The stage of the Snapshot definition allowing to specify encryption. */ + interface WithEncryption { + /** + * Specifies the encryption property: Encryption property can be used to encrypt data at rest with customer + * managed keys or platform managed keys.. + * + * @param encryption Encryption property can be used to encrypt data at rest with customer managed keys or + * platform managed keys. + * @return the next definition stage. + */ + WithCreate withEncryption(Encryption encryption); + } + /** The stage of the Snapshot definition allowing to specify networkAccessPolicy. */ + interface WithNetworkAccessPolicy { + /** + * Specifies the networkAccessPolicy property: Policy for accessing the disk via network.. + * + * @param networkAccessPolicy Policy for accessing the disk via network. + * @return the next definition stage. + */ + WithCreate withNetworkAccessPolicy(NetworkAccessPolicy networkAccessPolicy); + } + /** The stage of the Snapshot definition allowing to specify diskAccessId. */ + interface WithDiskAccessId { + /** + * Specifies the diskAccessId property: ARM id of the DiskAccess resource for using private endpoints on + * disks.. + * + * @param diskAccessId ARM id of the DiskAccess resource for using private endpoints on disks. + * @return the next definition stage. + */ + WithCreate withDiskAccessId(String diskAccessId); + } + /** The stage of the Snapshot definition allowing to specify securityProfile. */ + interface WithSecurityProfile { + /** + * Specifies the securityProfile property: Contains the security related information for the resource.. + * + * @param securityProfile Contains the security related information for the resource. + * @return the next definition stage. + */ + WithCreate withSecurityProfile(DiskSecurityProfile securityProfile); + } + /** The stage of the Snapshot definition allowing to specify supportsHibernation. */ + interface WithSupportsHibernation { + /** + * Specifies the supportsHibernation property: Indicates the OS on a snapshot supports hibernation.. + * + * @param supportsHibernation Indicates the OS on a snapshot supports hibernation. + * @return the next definition stage. + */ + WithCreate withSupportsHibernation(Boolean supportsHibernation); + } + /** The stage of the Snapshot definition allowing to specify publicNetworkAccess. */ + interface WithPublicNetworkAccess { + /** + * Specifies the publicNetworkAccess property: Policy for controlling export on the disk.. + * + * @param publicNetworkAccess Policy for controlling export on the disk. + * @return the next definition stage. + */ + WithCreate withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess); + } + /** The stage of the Snapshot definition allowing to specify completionPercent. */ + interface WithCompletionPercent { + /** + * Specifies the completionPercent property: Percentage complete for the background copy when a resource is + * created via the CopyStart operation.. + * + * @param completionPercent Percentage complete for the background copy when a resource is created via the + * CopyStart operation. + * @return the next definition stage. + */ + WithCreate withCompletionPercent(Float completionPercent); + } + /** The stage of the Snapshot definition allowing to specify copyCompletionError. */ + interface WithCopyCompletionError { + /** + * Specifies the copyCompletionError property: Indicates the error details if the background copy of a + * resource created via the CopyStart operation fails.. + * + * @param copyCompletionError Indicates the error details if the background copy of a resource created via + * the CopyStart operation fails. + * @return the next definition stage. + */ + WithCreate withCopyCompletionError(CopyCompletionError copyCompletionError); + } + /** The stage of the Snapshot definition allowing to specify dataAccessAuthMode. */ + interface WithDataAccessAuthMode { + /** + * Specifies the dataAccessAuthMode property: Additional authentication requirements when exporting or + * uploading to a disk or snapshot.. + * + * @param dataAccessAuthMode Additional authentication requirements when exporting or uploading to a disk or + * snapshot. + * @return the next definition stage. + */ + WithCreate withDataAccessAuthMode(DataAccessAuthMode dataAccessAuthMode); + } + } + /** + * Begins update for the Snapshot resource. + * + * @return the stage of resource update. + */ + Snapshot.Update update(); + + /** The template for Snapshot update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithSku, + UpdateStages.WithOsType, + UpdateStages.WithDiskSizeGB, + UpdateStages.WithEncryptionSettingsCollection, + UpdateStages.WithEncryption, + UpdateStages.WithNetworkAccessPolicy, + UpdateStages.WithDiskAccessId, + UpdateStages.WithSupportsHibernation, + UpdateStages.WithPublicNetworkAccess, + UpdateStages.WithDataAccessAuthMode, + UpdateStages.WithSupportedCapabilities { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Snapshot apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Snapshot apply(Context context); + } + /** The Snapshot update stages. */ + interface UpdateStages { + /** The stage of the Snapshot update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the Snapshot update allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. + * This is an optional parameter for incremental snapshot and the default behavior is the SKU will be set to + * the same sku as the previous snapshot. + * + * @param sku The snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. This is an optional + * parameter for incremental snapshot and the default behavior is the SKU will be set to the same sku as + * the previous snapshot. + * @return the next definition stage. + */ + Update withSku(SnapshotSku sku); + } + /** The stage of the Snapshot update allowing to specify osType. */ + interface WithOsType { + /** + * Specifies the osType property: the Operating System type.. + * + * @param osType the Operating System type. + * @return the next definition stage. + */ + Update withOsType(OperatingSystemTypes osType); + } + /** The stage of the Snapshot update allowing to specify diskSizeGB. */ + interface WithDiskSizeGB { + /** + * Specifies the diskSizeGB property: If creationData.createOption is Empty, this field is mandatory and it + * indicates the size of the disk to create. If this field is present for updates or creation with other + * options, it indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and + * can only increase the disk's size.. + * + * @param diskSizeGB If creationData.createOption is Empty, this field is mandatory and it indicates the + * size of the disk to create. If this field is present for updates or creation with other options, it + * indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and can + * only increase the disk's size. + * @return the next definition stage. + */ + Update withDiskSizeGB(Integer diskSizeGB); + } + /** The stage of the Snapshot update allowing to specify encryptionSettingsCollection. */ + interface WithEncryptionSettingsCollection { + /** + * Specifies the encryptionSettingsCollection property: Encryption settings collection used be Azure Disk + * Encryption, can contain multiple encryption settings per disk or snapshot.. + * + * @param encryptionSettingsCollection Encryption settings collection used be Azure Disk Encryption, can + * contain multiple encryption settings per disk or snapshot. + * @return the next definition stage. + */ + Update withEncryptionSettingsCollection(EncryptionSettingsCollection encryptionSettingsCollection); + } + /** The stage of the Snapshot update allowing to specify encryption. */ + interface WithEncryption { + /** + * Specifies the encryption property: Encryption property can be used to encrypt data at rest with customer + * managed keys or platform managed keys.. + * + * @param encryption Encryption property can be used to encrypt data at rest with customer managed keys or + * platform managed keys. + * @return the next definition stage. + */ + Update withEncryption(Encryption encryption); + } + /** The stage of the Snapshot update allowing to specify networkAccessPolicy. */ + interface WithNetworkAccessPolicy { + /** + * Specifies the networkAccessPolicy property: Policy for accessing the disk via network.. + * + * @param networkAccessPolicy Policy for accessing the disk via network. + * @return the next definition stage. + */ + Update withNetworkAccessPolicy(NetworkAccessPolicy networkAccessPolicy); + } + /** The stage of the Snapshot update allowing to specify diskAccessId. */ + interface WithDiskAccessId { + /** + * Specifies the diskAccessId property: ARM id of the DiskAccess resource for using private endpoints on + * disks.. + * + * @param diskAccessId ARM id of the DiskAccess resource for using private endpoints on disks. + * @return the next definition stage. + */ + Update withDiskAccessId(String diskAccessId); + } + /** The stage of the Snapshot update allowing to specify supportsHibernation. */ + interface WithSupportsHibernation { + /** + * Specifies the supportsHibernation property: Indicates the OS on a snapshot supports hibernation.. + * + * @param supportsHibernation Indicates the OS on a snapshot supports hibernation. + * @return the next definition stage. + */ + Update withSupportsHibernation(Boolean supportsHibernation); + } + /** The stage of the Snapshot update allowing to specify publicNetworkAccess. */ + interface WithPublicNetworkAccess { + /** + * Specifies the publicNetworkAccess property: Policy for controlling export on the disk.. + * + * @param publicNetworkAccess Policy for controlling export on the disk. + * @return the next definition stage. + */ + Update withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess); + } + /** The stage of the Snapshot update allowing to specify dataAccessAuthMode. */ + interface WithDataAccessAuthMode { + /** + * Specifies the dataAccessAuthMode property: Additional authentication requirements when exporting or + * uploading to a disk or snapshot.. + * + * @param dataAccessAuthMode Additional authentication requirements when exporting or uploading to a disk or + * snapshot. + * @return the next definition stage. + */ + Update withDataAccessAuthMode(DataAccessAuthMode dataAccessAuthMode); + } + /** The stage of the Snapshot update allowing to specify supportedCapabilities. */ + interface WithSupportedCapabilities { + /** + * Specifies the supportedCapabilities property: List of supported capabilities for the image from which the + * OS disk was created.. + * + * @param supportedCapabilities List of supported capabilities for the image from which the OS disk was + * created. + * @return the next definition stage. + */ + Update withSupportedCapabilities(SupportedCapabilities supportedCapabilities); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Snapshot refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Snapshot refresh(Context context); + + /** + * Grants access to a snapshot. + * + * @param grantAccessData Access data object supplied in the body of the get snapshot access operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a disk access SAS uri. + */ + AccessUri grantAccess(GrantAccessData grantAccessData); + + /** + * Grants access to a snapshot. + * + * @param grantAccessData Access data object supplied in the body of the get snapshot access operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a disk access SAS uri. + */ + AccessUri grantAccess(GrantAccessData grantAccessData, Context context); + + /** + * Revokes access to a snapshot. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void revokeAccess(); + + /** + * Revokes access to a snapshot. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void revokeAccess(Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SnapshotList.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SnapshotList.java new file mode 100644 index 0000000000000..a9b7629d4cf7c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SnapshotList.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.SnapshotInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List Snapshots operation response. */ +@Fluent +public final class SnapshotList { + /* + * 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; + + /** Creates an instance of SnapshotList class. */ + public SnapshotList() { + } + + /** + * 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()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SnapshotList.class); +} 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..bc3c5664d0b51 --- /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.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 { + /* + * The sku name. + */ + @JsonProperty(value = "name") + private SnapshotStorageAccountTypes name; + + /* + * The sku tier. + */ + @JsonProperty(value = "tier", access = JsonProperty.Access.WRITE_ONLY) + private String tier; + + /** Creates an instance of SnapshotSku class. */ + public SnapshotSku() { + } + + /** + * 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..3db00292db347 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SnapshotStorageAccountTypes.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The sku name. */ +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 a new instance of SnapshotStorageAccountTypes value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SnapshotStorageAccountTypes() { + } + + /** + * 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); + } + + /** + * Gets known SnapshotStorageAccountTypes values. + * + * @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..deea6b7474818 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SnapshotUpdate.java @@ -0,0 +1,350 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.compute.generated.fluent.models.SnapshotUpdateProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Snapshot update resource. */ +@Fluent +public final class SnapshotUpdate { + /* + * Snapshot resource update properties. + */ + @JsonProperty(value = "properties") + private SnapshotUpdateProperties innerProperties; + + /* + * Resource tags + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + 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; + + /** Creates an instance of SnapshotUpdate class. */ + public SnapshotUpdate() { + } + + /** + * Get the innerProperties property: Snapshot resource update properties. + * + * @return the innerProperties value. + */ + private SnapshotUpdateProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new SnapshotUpdateProperties(); + } + this.innerProperties().withOsType(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new SnapshotUpdateProperties(); + } + this.innerProperties().withDiskSizeGB(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new SnapshotUpdateProperties(); + } + this.innerProperties().withEncryptionSettingsCollection(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new SnapshotUpdateProperties(); + } + this.innerProperties().withEncryption(encryption); + return this; + } + + /** + * Get the networkAccessPolicy property: Policy for accessing the disk via network. + * + * @return the networkAccessPolicy value. + */ + public NetworkAccessPolicy networkAccessPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new SnapshotUpdateProperties(); + } + this.innerProperties().withNetworkAccessPolicy(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new SnapshotUpdateProperties(); + } + this.innerProperties().withDiskAccessId(diskAccessId); + return this; + } + + /** + * Get the supportsHibernation property: Indicates the OS on a snapshot supports hibernation. + * + * @return the supportsHibernation value. + */ + public Boolean supportsHibernation() { + return this.innerProperties() == null ? null : this.innerProperties().supportsHibernation(); + } + + /** + * Set the supportsHibernation property: Indicates the OS on a snapshot supports hibernation. + * + * @param supportsHibernation the supportsHibernation value to set. + * @return the SnapshotUpdate object itself. + */ + public SnapshotUpdate withSupportsHibernation(Boolean supportsHibernation) { + if (this.innerProperties() == null) { + this.innerProperties = new SnapshotUpdateProperties(); + } + this.innerProperties().withSupportsHibernation(supportsHibernation); + return this; + } + + /** + * Get the publicNetworkAccess property: Policy for controlling export on the disk. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.innerProperties() == null ? null : this.innerProperties().publicNetworkAccess(); + } + + /** + * Set the publicNetworkAccess property: Policy for controlling export on the disk. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the SnapshotUpdate object itself. + */ + public SnapshotUpdate withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + if (this.innerProperties() == null) { + this.innerProperties = new SnapshotUpdateProperties(); + } + this.innerProperties().withPublicNetworkAccess(publicNetworkAccess); + return this; + } + + /** + * Get the dataAccessAuthMode property: Additional authentication requirements when exporting or uploading to a disk + * or snapshot. + * + * @return the dataAccessAuthMode value. + */ + public DataAccessAuthMode dataAccessAuthMode() { + return this.innerProperties() == null ? null : this.innerProperties().dataAccessAuthMode(); + } + + /** + * Set the dataAccessAuthMode property: Additional authentication requirements when exporting or uploading to a disk + * or snapshot. + * + * @param dataAccessAuthMode the dataAccessAuthMode value to set. + * @return the SnapshotUpdate object itself. + */ + public SnapshotUpdate withDataAccessAuthMode(DataAccessAuthMode dataAccessAuthMode) { + if (this.innerProperties() == null) { + this.innerProperties = new SnapshotUpdateProperties(); + } + this.innerProperties().withDataAccessAuthMode(dataAccessAuthMode); + return this; + } + + /** + * Get the supportedCapabilities property: List of supported capabilities for the image from which the OS disk was + * created. + * + * @return the supportedCapabilities value. + */ + public SupportedCapabilities supportedCapabilities() { + return this.innerProperties() == null ? null : this.innerProperties().supportedCapabilities(); + } + + /** + * Set the supportedCapabilities property: List of supported capabilities for the image from which the OS disk was + * created. + * + * @param supportedCapabilities the supportedCapabilities value to set. + * @return the SnapshotUpdate object itself. + */ + public SnapshotUpdate withSupportedCapabilities(SupportedCapabilities supportedCapabilities) { + if (this.innerProperties() == null) { + this.innerProperties = new SnapshotUpdateProperties(); + } + this.innerProperties().withSupportedCapabilities(supportedCapabilities); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + if (sku() != null) { + sku().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..035a387e1e189 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Snapshots.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.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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String snapshotName, 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. + */ + Snapshot getByResourceGroup(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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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/SoftDeletePolicy.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SoftDeletePolicy.java new file mode 100644 index 0000000000000..65e689a8084a3 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SoftDeletePolicy.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.fasterxml.jackson.annotation.JsonProperty; + +/** Contains information about the soft deletion policy of the gallery. */ +@Fluent +public final class SoftDeletePolicy { + /* + * Enables soft-deletion for resources in this gallery, allowing them to be recovered within retention time. + */ + @JsonProperty(value = "isSoftDeleteEnabled") + private Boolean isSoftDeleteEnabled; + + /** Creates an instance of SoftDeletePolicy class. */ + public SoftDeletePolicy() { + } + + /** + * Get the isSoftDeleteEnabled property: Enables soft-deletion for resources in this gallery, allowing them to be + * recovered within retention time. + * + * @return the isSoftDeleteEnabled value. + */ + public Boolean isSoftDeleteEnabled() { + return this.isSoftDeleteEnabled; + } + + /** + * Set the isSoftDeleteEnabled property: Enables soft-deletion for resources in this gallery, allowing them to be + * recovered within retention time. + * + * @param isSoftDeleteEnabled the isSoftDeleteEnabled value to set. + * @return the SoftDeletePolicy object itself. + */ + public SoftDeletePolicy withIsSoftDeleteEnabled(Boolean isSoftDeleteEnabled) { + this.isSoftDeleteEnabled = isSoftDeleteEnabled; + 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/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..94d16093f382f --- /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.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 { + /* + * Resource Id + */ + @JsonProperty(value = "id") + private String id; + + /** Creates an instance of SourceVault class. */ + public SourceVault() { + } + + /** + * Get the id property: Resource Id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource Id. + * + * @param id the id value to set. + * @return the SourceVault object itself. + */ + public SourceVault withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SpotRestorePolicy.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SpotRestorePolicy.java new file mode 100644 index 0000000000000..84dffcb0d585d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SpotRestorePolicy.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.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifies the Spot-Try-Restore properties for the virtual machine scale set. With this property customer can enable + * or disable automatic restore of the evicted Spot VMSS VM instances opportunistically based on capacity availability + * and pricing constraint. + */ +@Fluent +public final class SpotRestorePolicy { + /* + * Enables the Spot-Try-Restore feature where evicted VMSS SPOT instances will be tried to be restored + * opportunistically based on capacity availability and pricing constraints + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /* + * Timeout value expressed as an ISO 8601 time duration after which the platform will not try to restore the VMSS + * SPOT instances + */ + @JsonProperty(value = "restoreTimeout") + private String restoreTimeout; + + /** Creates an instance of SpotRestorePolicy class. */ + public SpotRestorePolicy() { + } + + /** + * Get the enabled property: Enables the Spot-Try-Restore feature where evicted VMSS SPOT instances will be tried to + * be restored opportunistically based on capacity availability and pricing constraints. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Enables the Spot-Try-Restore feature where evicted VMSS SPOT instances will be tried to + * be restored opportunistically based on capacity availability and pricing constraints. + * + * @param enabled the enabled value to set. + * @return the SpotRestorePolicy object itself. + */ + public SpotRestorePolicy withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the restoreTimeout property: Timeout value expressed as an ISO 8601 time duration after which the platform + * will not try to restore the VMSS SPOT instances. + * + * @return the restoreTimeout value. + */ + public String restoreTimeout() { + return this.restoreTimeout; + } + + /** + * Set the restoreTimeout property: Timeout value expressed as an ISO 8601 time duration after which the platform + * will not try to restore the VMSS SPOT instances. + * + * @param restoreTimeout the restoreTimeout value to set. + * @return the SpotRestorePolicy object itself. + */ + public SpotRestorePolicy withRestoreTimeout(String restoreTimeout) { + this.restoreTimeout = restoreTimeout; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SshConfiguration.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SshConfiguration.java new file mode 100644 index 0000000000000..1fe666744c073 --- /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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** SSH configuration for Linux based VMs running on Azure. */ +@Fluent +public final class SshConfiguration { + /* + * The list of SSH public keys used to authenticate with linux based VMs. + */ + @JsonProperty(value = "publicKeys") + private List publicKeys; + + /** Creates an instance of SshConfiguration class. */ + public SshConfiguration() { + } + + /** + * 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..4003f603ea9ad --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SshPublicKey.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.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 { + /* + * Specifies the full path on the created VM where ssh public key is stored. If the file already exists, the + * specified key is appended to the file. Example: /home/user/.ssh/authorized_keys + */ + @JsonProperty(value = "path") + private String path; + + /* + * SSH public key certificate used to authenticate with the VM through ssh. The key needs to be at least 2048-bit + * and in ssh-rsa format. For creating ssh keys, see [Create SSH keys on Linux and Mac for Linux VMs in + * Azure]https://docs.microsoft.com/azure/virtual-machines/linux/create-ssh-keys-detailed). + */ + @JsonProperty(value = "keyData") + private String keyData; + + /** Creates an instance of SshPublicKey class. */ + public SshPublicKey() { + } + + /** + * 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. For creating ssh keys, see [Create SSH keys on Linux and Mac for + * Linux VMs in Azure]https://docs.microsoft.com/azure/virtual-machines/linux/create-ssh-keys-detailed). + * + * @return the keyData value. + */ + public String keyData() { + return this.keyData; + } + + /** + * Set the keyData property: SSH public key certificate used to authenticate with the VM through ssh. The key needs + * to be at least 2048-bit and in ssh-rsa format. For creating ssh keys, see [Create SSH keys on Linux and Mac for + * Linux VMs in Azure]https://docs.microsoft.com/azure/virtual-machines/linux/create-ssh-keys-detailed). + * + * @param keyData the keyData value to set. + * @return the SshPublicKey object itself. + */ + public SshPublicKey withKeyData(String keyData) { + this.keyData = keyData; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SshPublicKeyGenerateKeyPairResult.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SshPublicKeyGenerateKeyPairResult.java new file mode 100644 index 0000000000000..b766d42705b4b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SshPublicKeyGenerateKeyPairResult.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.resourcemanager.compute.generated.fluent.models.SshPublicKeyGenerateKeyPairResultInner; + +/** An immutable client-side representation of SshPublicKeyGenerateKeyPairResult. */ +public interface SshPublicKeyGenerateKeyPairResult { + /** + * Gets the privateKey property: Private key portion of the key pair used to authenticate to a virtual machine + * through ssh. The private key is returned in RFC3447 format and should be treated as a secret. + * + * @return the privateKey value. + */ + String privateKey(); + + /** + * Gets the publicKey property: Public key portion of the key pair used to authenticate to a virtual machine through + * ssh. The public key is in ssh-rsa format. + * + * @return the publicKey value. + */ + String publicKey(); + + /** + * Gets the id property: The ARM resource id in the form of + * /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{SshPublicKeyName}. + * + * @return the id value. + */ + String id(); + + /** + * Gets the inner com.azure.resourcemanager.compute.generated.fluent.models.SshPublicKeyGenerateKeyPairResultInner + * object. + * + * @return the inner object. + */ + SshPublicKeyGenerateKeyPairResultInner innerModel(); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SshPublicKeyResource.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SshPublicKeyResource.java new file mode 100644 index 0000000000000..b96ea5c5cc11b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SshPublicKeyResource.java @@ -0,0 +1,266 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.SshPublicKeyResourceInner; +import java.util.Map; + +/** An immutable client-side representation of SshPublicKeyResource. */ +public interface SshPublicKeyResource { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the publicKey property: SSH public key used to authenticate to a virtual machine through ssh. If this + * property is not initially provided when the resource is created, the publicKey property will be populated when + * generateKeyPair is called. If the public key is provided upon resource creation, the provided public key needs to + * be at least 2048-bit and in ssh-rsa format. + * + * @return the publicKey value. + */ + String publicKey(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.compute.generated.fluent.models.SshPublicKeyResourceInner object. + * + * @return the inner object. + */ + SshPublicKeyResourceInner innerModel(); + + /** The entirety of the SshPublicKeyResource definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The SshPublicKeyResource definition stages. */ + interface DefinitionStages { + /** The first stage of the SshPublicKeyResource definition. */ + interface Blank extends WithLocation { + } + /** The stage of the SshPublicKeyResource definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the SshPublicKeyResource definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the SshPublicKeyResource definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithPublicKey { + /** + * Executes the create request. + * + * @return the created resource. + */ + SshPublicKeyResource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SshPublicKeyResource create(Context context); + } + /** The stage of the SshPublicKeyResource definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the SshPublicKeyResource definition allowing to specify publicKey. */ + interface WithPublicKey { + /** + * Specifies the publicKey property: SSH public key used to authenticate to a virtual machine through ssh. + * If this property is not initially provided when the resource is created, the publicKey property will be + * populated when generateKeyPair is called. If the public key is provided upon resource creation, the + * provided public key needs to be at least 2048-bit and in ssh-rsa format.. + * + * @param publicKey SSH public key used to authenticate to a virtual machine through ssh. If this property + * is not initially provided when the resource is created, the publicKey property will be populated when + * generateKeyPair is called. If the public key is provided upon resource creation, the provided public + * key needs to be at least 2048-bit and in ssh-rsa format. + * @return the next definition stage. + */ + WithCreate withPublicKey(String publicKey); + } + } + /** + * Begins update for the SshPublicKeyResource resource. + * + * @return the stage of resource update. + */ + SshPublicKeyResource.Update update(); + + /** The template for SshPublicKeyResource update. */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithPublicKey { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SshPublicKeyResource apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SshPublicKeyResource apply(Context context); + } + /** The SshPublicKeyResource update stages. */ + interface UpdateStages { + /** The stage of the SshPublicKeyResource update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the SshPublicKeyResource update allowing to specify publicKey. */ + interface WithPublicKey { + /** + * Specifies the publicKey property: SSH public key used to authenticate to a virtual machine through ssh. + * If this property is not initially provided when the resource is created, the publicKey property will be + * populated when generateKeyPair is called. If the public key is provided upon resource creation, the + * provided public key needs to be at least 2048-bit and in ssh-rsa format.. + * + * @param publicKey SSH public key used to authenticate to a virtual machine through ssh. If this property + * is not initially provided when the resource is created, the publicKey property will be populated when + * generateKeyPair is called. If the public key is provided upon resource creation, the provided public + * key needs to be at least 2048-bit and in ssh-rsa format. + * @return the next definition stage. + */ + Update withPublicKey(String publicKey); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SshPublicKeyResource refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SshPublicKeyResource refresh(Context context); + + /** + * Generates and returns a public/private key pair and populates the SSH public key resource with the public key. + * The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 along with {@link Response}. + */ + Response generateKeyPairWithResponse(Context context); + + /** + * Generates and returns a public/private key pair and populates the SSH public key resource with the public key. + * The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. + * + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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(); +} 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..f3d8e0ac159c4 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SshPublicKeyUpdateResource.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.resourcemanager.compute.generated.fluent.models.SshPublicKeyResourceProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Specifies information about the SSH public key. */ +@Fluent +public final class SshPublicKeyUpdateResource extends UpdateResource { + /* + * Properties of the SSH public key. + */ + @JsonProperty(value = "properties") + private SshPublicKeyResourceProperties innerProperties; + + /** Creates an instance of SshPublicKeyUpdateResource class. */ + public SshPublicKeyUpdateResource() { + } + + /** + * Get the innerProperties property: Properties of the SSH public key. + * + * @return the innerProperties value. + */ + private SshPublicKeyResourceProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public SshPublicKeyUpdateResource withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new SshPublicKeyResourceProperties(); + } + this.innerProperties().withPublicKey(publicKey); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().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..818aeb51dd60f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SshPublicKeys.java @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of 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.resourcemanager.compute.generated.models.ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + 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.resourcemanager.compute.generated.models.ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + 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.resourcemanager.compute.generated.models.ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + 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.resourcemanager.compute.generated.models.ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByResourceGroupWithResponse( + String resourceGroupName, String sshPublicKeyName, 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.resourcemanager.compute.generated.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 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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 along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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); + + /** + * 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.resourcemanager.compute.generated.models.ApiErrorException 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 along with {@link Response}. + */ + Response generateKeyPairWithResponse( + 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.resourcemanager.compute.generated.models.ApiErrorException 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); + + /** + * Retrieves information about an SSH public key. + * + * @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 SSH public key along with {@link Response}. + */ + 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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 along with {@link Response}. + */ + 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.resourcemanager.compute.generated.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 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response 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..9d238b22dc4d3 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SshPublicKeysGroupListResult.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.azure.resourcemanager.compute.generated.fluent.models.SshPublicKeyResourceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list SSH public keys operation response. */ +@Fluent +public final class SshPublicKeysGroupListResult { + /* + * 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; + + /** Creates an instance of SshPublicKeysGroupListResult class. */ + public SshPublicKeysGroupListResult() { + } + + /** + * 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()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SshPublicKeysGroupListResult.class); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/StatusCodeCount.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/StatusCodeCount.java new file mode 100644 index 0000000000000..c994a76aac09e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/StatusCodeCount.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The status code and count of the cloud service instance view statuses. */ +@Immutable +public final class StatusCodeCount { + /* + * The instance view status code + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /* + * Number of instances having this status code + */ + @JsonProperty(value = "count", access = JsonProperty.Access.WRITE_ONLY) + private Integer count; + + /** Creates an instance of StatusCodeCount class. */ + public StatusCodeCount() { + } + + /** + * Get the code property: The instance view status code. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Get the count property: Number of instances having this status code. + * + * @return the count value. + */ + public Integer count() { + return this.count; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/StatusLevelTypes.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/StatusLevelTypes.java new file mode 100644 index 0000000000000..4000c2759264b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/StatusLevelTypes.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.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** The level code. */ +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) { + if (value == null) { + return null; + } + StatusLevelTypes[] items = StatusLevelTypes.values(); + for (StatusLevelTypes item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @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..336265137c7c0 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/StorageAccountType.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Specifies the storage account type to be used to store the image. This property is not updatable. */ +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"); + + /** Static value StandardSSD_LRS for StorageAccountType. */ + public static final StorageAccountType STANDARD_SSD_LRS = fromString("StandardSSD_LRS"); + + /** + * Creates a new instance of StorageAccountType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public StorageAccountType() { + } + + /** + * 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); + } + + /** + * Gets known StorageAccountType values. + * + * @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..3e34177360f4f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/StorageAccountTypes.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Specifies the storage account type for the managed disk. Managed OS disk storage account type can only be set when + * you create the scale set. NOTE: UltraSSD_LRS can only be used with data disks. It cannot be used with OS Disk. + * Standard_LRS uses Standard HDD. StandardSSD_LRS uses Standard SSD. Premium_LRS uses Premium SSD. UltraSSD_LRS uses + * Ultra disk. Premium_ZRS uses Premium SSD zone redundant storage. StandardSSD_ZRS uses Standard SSD zone redundant + * storage. For more information regarding disks supported for Windows Virtual Machines, refer to + * https://docs.microsoft.com/azure/virtual-machines/windows/disks-types and, for Linux Virtual Machines, refer to + * https://docs.microsoft.com/azure/virtual-machines/linux/disks-types. + */ +public final class StorageAccountTypes extends ExpandableStringEnum { + /** Static value Standard_LRS for StorageAccountTypes. */ + public static final StorageAccountTypes STANDARD_LRS = fromString("Standard_LRS"); + + /** Static value Premium_LRS for StorageAccountTypes. */ + public static final StorageAccountTypes PREMIUM_LRS = fromString("Premium_LRS"); + + /** Static value StandardSSD_LRS for StorageAccountTypes. */ + public static final StorageAccountTypes STANDARD_SSD_LRS = fromString("StandardSSD_LRS"); + + /** Static value UltraSSD_LRS for StorageAccountTypes. */ + public static final StorageAccountTypes ULTRA_SSD_LRS = fromString("UltraSSD_LRS"); + + /** Static value Premium_ZRS for StorageAccountTypes. */ + public static final StorageAccountTypes PREMIUM_ZRS = fromString("Premium_ZRS"); + + /** Static value StandardSSD_ZRS for StorageAccountTypes. */ + public static final StorageAccountTypes STANDARD_SSD_ZRS = fromString("StandardSSD_ZRS"); + + /** Static value PremiumV2_LRS for StorageAccountTypes. */ + public static final StorageAccountTypes PREMIUM_V2_LRS = fromString("PremiumV2_LRS"); + + /** + * Creates a new instance of StorageAccountTypes value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public StorageAccountTypes() { + } + + /** + * 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); + } + + /** + * Gets known StorageAccountTypes values. + * + * @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..9d407884e21e3 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/StorageProfile.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.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Specifies the storage settings for the virtual machine disks. */ +@Fluent +public final class StorageProfile { + /* + * Specifies information about the image to use. You can specify information about platform images, marketplace + * images, or virtual machine images. This element is required when you want to use a platform image, marketplace + * image, or virtual machine image, but is not used in other creation operations. + */ + @JsonProperty(value = "imageReference") + private ImageReference imageReference; + + /* + * Specifies information about the operating system disk used by the virtual machine. For more information about + * disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). + */ + @JsonProperty(value = "osDisk") + private OSDisk osDisk; + + /* + * Specifies the parameters that are used to add a data disk to a virtual machine. For more information about + * disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). + */ + @JsonProperty(value = "dataDisks") + private List dataDisks; + + /* + * Specifies the disk controller type configured for the VM. **Note:** This property will be set to the default + * disk controller type if not specified provided virtual machine is being created with 'hyperVGeneration' set to + * V2 based on the capabilities of the operating system disk and VM size from the the specified minimum api + * version. You need to deallocate the VM before updating its disk controller type unless you are updating the VM + * size in the VM configuration which implicitly deallocates and reallocates the VM. Minimum api-version: + * 2022-08-01. + */ + @JsonProperty(value = "diskControllerType") + private DiskControllerTypes diskControllerType; + + /** Creates an instance of StorageProfile class. */ + public StorageProfile() { + } + + /** + * 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. For + * more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). + * + * @return the osDisk value. + */ + public OSDisk osDisk() { + return this.osDisk; + } + + /** + * Set the osDisk property: Specifies information about the operating system disk used by the virtual machine. For + * more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). + * + * @param osDisk the osDisk value to set. + * @return the StorageProfile object itself. + */ + public StorageProfile withOsDisk(OSDisk osDisk) { + this.osDisk = osDisk; + return this; + } + + /** + * Get the dataDisks property: Specifies the parameters that are used to add a data disk to a virtual machine. For + * more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). + * + * @return the dataDisks value. + */ + public List dataDisks() { + return this.dataDisks; + } + + /** + * Set the dataDisks property: Specifies the parameters that are used to add a data disk to a virtual machine. For + * more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). + * + * @param dataDisks the dataDisks value to set. + * @return the StorageProfile object itself. + */ + public StorageProfile withDataDisks(List dataDisks) { + this.dataDisks = dataDisks; + return this; + } + + /** + * Get the diskControllerType property: Specifies the disk controller type configured for the VM. **Note:** This + * property will be set to the default disk controller type if not specified provided virtual machine is being + * created with 'hyperVGeneration' set to V2 based on the capabilities of the operating system disk and VM size from + * the the specified minimum api version. You need to deallocate the VM before updating its disk controller type + * unless you are updating the VM size in the VM configuration which implicitly deallocates and reallocates the VM. + * Minimum api-version: 2022-08-01. + * + * @return the diskControllerType value. + */ + public DiskControllerTypes diskControllerType() { + return this.diskControllerType; + } + + /** + * Set the diskControllerType property: Specifies the disk controller type configured for the VM. **Note:** This + * property will be set to the default disk controller type if not specified provided virtual machine is being + * created with 'hyperVGeneration' set to V2 based on the capabilities of the operating system disk and VM size from + * the the specified minimum api version. You need to deallocate the VM before updating its disk controller type + * unless you are updating the VM size in the VM configuration which implicitly deallocates and reallocates the VM. + * Minimum api-version: 2022-08-01. + * + * @param diskControllerType the diskControllerType value to set. + * @return the StorageProfile object itself. + */ + public StorageProfile withDiskControllerType(DiskControllerTypes diskControllerType) { + this.diskControllerType = diskControllerType; + 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..b0b92d09f4077 --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** The SubResourceReadOnly model. */ +@Immutable +public class SubResourceReadOnly { + /* + * Resource Id + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** Creates an instance of SubResourceReadOnly class. */ + public SubResourceReadOnly() { + } + + /** + * 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..942952a4caeec --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SubResourceWithColocationStatus.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.Fluent; +import com.azure.core.management.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The SubResourceWithColocationStatus model. */ +@Fluent +public final class SubResourceWithColocationStatus extends SubResource { + /* + * Describes colocation status of a resource in the Proximity Placement Group. + */ + @JsonProperty(value = "colocationStatus") + private InstanceViewStatus colocationStatus; + + /** Creates an instance of SubResourceWithColocationStatus class. */ + public SubResourceWithColocationStatus() { + } + + /** + * 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/SupportedCapabilities.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SupportedCapabilities.java new file mode 100644 index 0000000000000..4c61f7ec3bff3 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SupportedCapabilities.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.fasterxml.jackson.annotation.JsonProperty; + +/** List of supported capabilities persisted on the disk resource for VM use. */ +@Fluent +public final class SupportedCapabilities { + /* + * The disk controllers that an OS disk supports. If set it can be SCSI or SCSI, NVME or NVME, SCSI. + */ + @JsonProperty(value = "diskControllerTypes") + private String diskControllerTypes; + + /* + * True if the image from which the OS disk is created supports accelerated networking. + */ + @JsonProperty(value = "acceleratedNetwork") + private Boolean acceleratedNetwork; + + /* + * CPU architecture supported by an OS disk. + */ + @JsonProperty(value = "architecture") + private Architecture architecture; + + /** Creates an instance of SupportedCapabilities class. */ + public SupportedCapabilities() { + } + + /** + * Get the diskControllerTypes property: The disk controllers that an OS disk supports. If set it can be SCSI or + * SCSI, NVME or NVME, SCSI. + * + * @return the diskControllerTypes value. + */ + public String diskControllerTypes() { + return this.diskControllerTypes; + } + + /** + * Set the diskControllerTypes property: The disk controllers that an OS disk supports. If set it can be SCSI or + * SCSI, NVME or NVME, SCSI. + * + * @param diskControllerTypes the diskControllerTypes value to set. + * @return the SupportedCapabilities object itself. + */ + public SupportedCapabilities withDiskControllerTypes(String diskControllerTypes) { + this.diskControllerTypes = diskControllerTypes; + return this; + } + + /** + * Get the acceleratedNetwork property: True if the image from which the OS disk is created supports accelerated + * networking. + * + * @return the acceleratedNetwork value. + */ + public Boolean acceleratedNetwork() { + return this.acceleratedNetwork; + } + + /** + * Set the acceleratedNetwork property: True if the image from which the OS disk is created supports accelerated + * networking. + * + * @param acceleratedNetwork the acceleratedNetwork value to set. + * @return the SupportedCapabilities object itself. + */ + public SupportedCapabilities withAcceleratedNetwork(Boolean acceleratedNetwork) { + this.acceleratedNetwork = acceleratedNetwork; + return this; + } + + /** + * Get the architecture property: CPU architecture supported by an OS disk. + * + * @return the architecture value. + */ + public Architecture architecture() { + return this.architecture; + } + + /** + * Set the architecture property: CPU architecture supported by an OS disk. + * + * @param architecture the architecture value to set. + * @return the SupportedCapabilities object itself. + */ + public SupportedCapabilities withArchitecture(Architecture architecture) { + this.architecture = architecture; + 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/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..86d8784c34a98 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/TargetRegion.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the target region information. */ +@Fluent +public final class TargetRegion { + /* + * 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; + + /* + * Contains the flag setting to hide an image when users specify version='latest' + */ + @JsonProperty(value = "excludeFromLatest") + private Boolean excludeFromLatest; + + /** Creates an instance of TargetRegion class. */ + public TargetRegion() { + } + + /** + * 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; + } + + /** + * Get the excludeFromLatest property: Contains the flag setting to hide an image when users specify + * version='latest'. + * + * @return the excludeFromLatest value. + */ + public Boolean excludeFromLatest() { + return this.excludeFromLatest; + } + + /** + * Set the excludeFromLatest property: Contains the flag setting to hide an image when users specify + * version='latest'. + * + * @param excludeFromLatest the excludeFromLatest value to set. + * @return the TargetRegion object itself. + */ + public TargetRegion withExcludeFromLatest(Boolean excludeFromLatest) { + this.excludeFromLatest = excludeFromLatest; + 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(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(TargetRegion.class); +} 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..61b3cf2913a20 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/TerminateNotificationProfile.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.fasterxml.jackson.annotation.JsonProperty; + +/** The TerminateNotificationProfile model. */ +@Fluent +public final class TerminateNotificationProfile { + /* + * 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; + + /** Creates an instance of TerminateNotificationProfile class. */ + public TerminateNotificationProfile() { + } + + /** + * 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..27f508408cfd8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ThrottledRequestsInput.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import java.time.OffsetDateTime; + +/** Api request input for LogAnalytics getThrottledRequests Api. */ +@Fluent +public final class ThrottledRequestsInput extends LogAnalyticsInputBase { + /** Creates an instance of ThrottledRequestsInput class. */ + public ThrottledRequestsInput() { + } + + /** {@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..7b7a9a7b3a426 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UefiSettings.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.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifies the security settings like secure boot and vTPM used while creating the virtual machine. Minimum + * api-version: 2020-12-01. + */ +@Fluent +public final class UefiSettings { + /* + * 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; + + /** Creates an instance of UefiSettings class. */ + public UefiSettings() { + } + + /** + * Get the secureBootEnabled property: Specifies whether secure boot should be enabled on the virtual machine. + * 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. + * 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. 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. Minimum + * api-version: 2020-12-01. + * + * @param vTpmEnabled the vTpmEnabled value to set. + * @return the UefiSettings object itself. + */ + public UefiSettings withVTpmEnabled(Boolean vTpmEnabled) { + this.vTpmEnabled = vTpmEnabled; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UpdateDomain.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UpdateDomain.java new file mode 100644 index 0000000000000..cde640c51f4d5 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UpdateDomain.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.resourcemanager.compute.generated.fluent.models.UpdateDomainInner; + +/** An immutable client-side representation of UpdateDomain. */ +public interface UpdateDomain { + /** + * Gets the id property: Resource Id. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: Resource Name. + * + * @return the name value. + */ + String name(); + + /** + * Gets the inner com.azure.resourcemanager.compute.generated.fluent.models.UpdateDomainInner object. + * + * @return the inner object. + */ + UpdateDomainInner innerModel(); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UpdateDomainListResult.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UpdateDomainListResult.java new file mode 100644 index 0000000000000..711d7b8969642 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UpdateDomainListResult.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.azure.resourcemanager.compute.generated.fluent.models.UpdateDomainInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list operation result. */ +@Fluent +public final class UpdateDomainListResult { + /* + * The list of resources. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The URI to fetch the next page of resources. Use this to get the next page of resources. Do this till nextLink + * is null to fetch all the resources. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of UpdateDomainListResult class. */ + public UpdateDomainListResult() { + } + + /** + * Get the value property: The list of resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of resources. + * + * @param value the value value to set. + * @return the UpdateDomainListResult object itself. + */ + public UpdateDomainListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URI to fetch the next page of resources. Use this to get the next page of + * resources. Do this till nextLink is null to fetch all the resources. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URI to fetch the next page of resources. Use this to get the next page of + * resources. Do this till nextLink is null to fetch all the resources. + * + * @param nextLink the nextLink value to set. + * @return the UpdateDomainListResult object itself. + */ + public UpdateDomainListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model UpdateDomainListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(UpdateDomainListResult.class); +} 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..05d46aaf8de82 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UpdateResource.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.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The Update Resource model definition. */ +@Fluent +public class UpdateResource { + /* + * Resource tags + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** Creates an instance of UpdateResource class. */ + public UpdateResource() { + } + + /** + * 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..4240b7f097c8a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UpdateResourceDefinition.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.management.ProxyResource; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The Update Resource model definition. */ +@Fluent +public class UpdateResourceDefinition extends ProxyResource { + /* + * Resource tags + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** Creates an instance of UpdateResourceDefinition class. */ + public UpdateResourceDefinition() { + } + + /** + * 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..c2fb51596cf30 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UpgradeMode.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.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * 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. + */ +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) { + if (value == null) { + return null; + } + UpgradeMode[] items = UpgradeMode.values(); + for (UpgradeMode item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @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..722e781c4116e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UpgradeOperationHistoricalStatusInfoProperties.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes each OS upgrade on the Virtual Machine Scale Set. */ +@Immutable +public final class UpgradeOperationHistoricalStatusInfoProperties { + /* + * 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; + + /** Creates an instance of UpgradeOperationHistoricalStatusInfoProperties class. */ + public UpgradeOperationHistoricalStatusInfoProperties() { + } + + /** + * 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..f6bfc9e2295f5 --- /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.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Information about the current running state of the overall upgrade. */ +@Immutable +public final class UpgradeOperationHistoryStatus { + /* + * 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; + + /** Creates an instance of UpgradeOperationHistoryStatus class. */ + public UpgradeOperationHistoryStatus() { + } + + /** + * 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..d63ff7116e862 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UpgradeOperationInvoker.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.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Invoker of the Upgrade Operation. */ +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) { + if (value == null) { + return null; + } + UpgradeOperationInvoker[] items = UpgradeOperationInvoker.values(); + for (UpgradeOperationInvoker item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @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..4bbfd1f4408f0 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UpgradePolicy.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.fasterxml.jackson.annotation.JsonProperty; + +/** Describes an upgrade policy - automatic, manual, or rolling. */ +@Fluent +public final class UpgradePolicy { + /* + * 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; + + /** Creates an instance of UpgradePolicy class. */ + public UpgradePolicy() { + } + + /** + * 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..7a6612ad6e57c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UpgradeState.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.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Code indicating the current status of the upgrade. */ +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) { + if (value == null) { + return null; + } + UpgradeState[] items = UpgradeState.values(); + for (UpgradeState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @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..d91b795e0d531 --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** The Usage Names. */ +@Fluent +public final class UsageName { + /* + * The name of the resource. + */ + @JsonProperty(value = "value") + private String value; + + /* + * The localized name of the resource. + */ + @JsonProperty(value = "localizedValue") + private String localizedValue; + + /** Creates an instance of UsageName class. */ + public UsageName() { + } + + /** + * 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..fa19cbb2fb644 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Usages.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.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.resourcemanager.compute.generated.models.ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + 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.resourcemanager.compute.generated.models.ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + 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..ad8c354ac56d7 --- /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.JsonProperty; + +/** The UserArtifactManage model. */ +@Fluent +public final class UserArtifactManage { + /* + * 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; + + /** Creates an instance of UserArtifactManage class. */ + public UserArtifactManage() { + } + + /** + * 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")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(UserArtifactManage.class); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UserArtifactSettings.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UserArtifactSettings.java new file mode 100644 index 0000000000000..af7cf00a0e884 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UserArtifactSettings.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.fasterxml.jackson.annotation.JsonProperty; + +/** + * Additional settings for the VM app that contains the target package and config file name when it is deployed to + * target VM or VM scale set. + */ +@Fluent +public final class UserArtifactSettings { + /* + * Optional. The name to assign the downloaded package file on the VM. This is limited to 4096 characters. If not + * specified, the package file will be named the same as the Gallery Application name. + */ + @JsonProperty(value = "packageFileName") + private String packageFileName; + + /* + * Optional. The name to assign the downloaded config file on the VM. This is limited to 4096 characters. If not + * specified, the config file will be named the Gallery Application name appended with "_config". + */ + @JsonProperty(value = "configFileName") + private String configFileName; + + /** Creates an instance of UserArtifactSettings class. */ + public UserArtifactSettings() { + } + + /** + * Get the packageFileName property: Optional. The name to assign the downloaded package file on the VM. This is + * limited to 4096 characters. If not specified, the package file will be named the same as the Gallery Application + * name. + * + * @return the packageFileName value. + */ + public String packageFileName() { + return this.packageFileName; + } + + /** + * Set the packageFileName property: Optional. The name to assign the downloaded package file on the VM. This is + * limited to 4096 characters. If not specified, the package file will be named the same as the Gallery Application + * name. + * + * @param packageFileName the packageFileName value to set. + * @return the UserArtifactSettings object itself. + */ + public UserArtifactSettings withPackageFileName(String packageFileName) { + this.packageFileName = packageFileName; + return this; + } + + /** + * Get the configFileName property: Optional. The name to assign the downloaded config file on the VM. This is + * limited to 4096 characters. If not specified, the config file will be named the Gallery Application name appended + * with "_config". + * + * @return the configFileName value. + */ + public String configFileName() { + return this.configFileName; + } + + /** + * Set the configFileName property: Optional. The name to assign the downloaded config file on the VM. This is + * limited to 4096 characters. If not specified, the config file will be named the Gallery Application name appended + * with "_config". + * + * @param configFileName the configFileName value to set. + * @return the UserArtifactSettings object itself. + */ + public UserArtifactSettings withConfigFileName(String configFileName) { + this.configFileName = configFileName; + 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/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..d659d661c3424 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UserArtifactSource.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.JsonProperty; + +/** The source image from which the Image Version is going to be created. */ +@Fluent +public final class UserArtifactSource { + /* + * 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; + + /** Creates an instance of UserArtifactSource class. */ + public UserArtifactSource() { + } + + /** + * 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")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(UserArtifactSource.class); +} 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..79f27c10ce451 --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** The UserAssignedIdentitiesValue model. */ +@Immutable +public final class UserAssignedIdentitiesValue { + /* + * 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; + + /** Creates an instance of UserAssignedIdentitiesValue class. */ + public UserAssignedIdentitiesValue() { + } + + /** + * 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/VMDiskSecurityProfile.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VMDiskSecurityProfile.java new file mode 100644 index 0000000000000..ab83157e6ad29 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VMDiskSecurityProfile.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.fasterxml.jackson.annotation.JsonProperty; + +/** Specifies the security profile settings for the managed disk. **Note:** It can only be set for Confidential VMs. */ +@Fluent +public final class VMDiskSecurityProfile { + /* + * Specifies the EncryptionType of the managed disk. It is set to DiskWithVMGuestState for encryption of the + * managed disk along with VMGuestState blob, and VMGuestStateOnly for encryption of just the VMGuestState blob. + * **Note:** It can be set for only Confidential VMs. + */ + @JsonProperty(value = "securityEncryptionType") + private SecurityEncryptionTypes securityEncryptionType; + + /* + * Specifies the customer managed disk encryption set resource id for the managed disk that is used for Customer + * Managed Key encrypted ConfidentialVM OS Disk and VMGuest blob. + */ + @JsonProperty(value = "diskEncryptionSet") + private DiskEncryptionSetParameters diskEncryptionSet; + + /** Creates an instance of VMDiskSecurityProfile class. */ + public VMDiskSecurityProfile() { + } + + /** + * Get the securityEncryptionType property: Specifies the EncryptionType of the managed disk. It is set to + * DiskWithVMGuestState for encryption of the managed disk along with VMGuestState blob, and VMGuestStateOnly for + * encryption of just the VMGuestState blob. **Note:** It can be set for only Confidential VMs. + * + * @return the securityEncryptionType value. + */ + public SecurityEncryptionTypes securityEncryptionType() { + return this.securityEncryptionType; + } + + /** + * Set the securityEncryptionType property: Specifies the EncryptionType of the managed disk. It is set to + * DiskWithVMGuestState for encryption of the managed disk along with VMGuestState blob, and VMGuestStateOnly for + * encryption of just the VMGuestState blob. **Note:** It can be set for only Confidential VMs. + * + * @param securityEncryptionType the securityEncryptionType value to set. + * @return the VMDiskSecurityProfile object itself. + */ + public VMDiskSecurityProfile withSecurityEncryptionType(SecurityEncryptionTypes securityEncryptionType) { + this.securityEncryptionType = securityEncryptionType; + return this; + } + + /** + * Get the diskEncryptionSet property: Specifies the customer managed disk encryption set resource id for the + * managed disk that is used for Customer Managed Key encrypted ConfidentialVM OS Disk and VMGuest blob. + * + * @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 that is used for Customer Managed Key encrypted ConfidentialVM OS Disk and VMGuest blob. + * + * @param diskEncryptionSet the diskEncryptionSet value to set. + * @return the VMDiskSecurityProfile object itself. + */ + public VMDiskSecurityProfile 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/VMGalleryApplication.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VMGalleryApplication.java new file mode 100644 index 0000000000000..f7b53f7788f20 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VMGalleryApplication.java @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Specifies the required information to reference a compute gallery application version. */ +@Fluent +public final class VMGalleryApplication { + /* + * Optional, Specifies a passthrough value for more generic context. + */ + @JsonProperty(value = "tags") + private String tags; + + /* + * Optional, Specifies the order in which the packages have to be installed + */ + @JsonProperty(value = "order") + private Integer order; + + /* + * Specifies the GalleryApplicationVersion resource id on the form of + * /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{application}/versions/{version} + */ + @JsonProperty(value = "packageReferenceId", required = true) + private String packageReferenceId; + + /* + * Optional, Specifies the uri to an azure blob that will replace the default configuration for the package if + * provided + */ + @JsonProperty(value = "configurationReference") + private String configurationReference; + + /* + * Optional, If true, any failure for any operation in the VmApplication will fail the deployment + */ + @JsonProperty(value = "treatFailureAsDeploymentFailure") + private Boolean treatFailureAsDeploymentFailure; + + /* + * If set to true, when a new Gallery Application version is available in PIR/SIG, it will be automatically updated + * for the VM/VMSS + */ + @JsonProperty(value = "enableAutomaticUpgrade") + private Boolean enableAutomaticUpgrade; + + /** Creates an instance of VMGalleryApplication class. */ + public VMGalleryApplication() { + } + + /** + * Get the tags property: Optional, Specifies a passthrough value for more generic context. + * + * @return the tags value. + */ + public String tags() { + return this.tags; + } + + /** + * Set the tags property: Optional, Specifies a passthrough value for more generic context. + * + * @param tags the tags value to set. + * @return the VMGalleryApplication object itself. + */ + public VMGalleryApplication withTags(String tags) { + this.tags = tags; + return this; + } + + /** + * Get the order property: Optional, Specifies the order in which the packages have to be installed. + * + * @return the order value. + */ + public Integer order() { + return this.order; + } + + /** + * Set the order property: Optional, Specifies the order in which the packages have to be installed. + * + * @param order the order value to set. + * @return the VMGalleryApplication object itself. + */ + public VMGalleryApplication withOrder(Integer order) { + this.order = order; + return this; + } + + /** + * Get the packageReferenceId property: Specifies the GalleryApplicationVersion resource id on the form of + * /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{application}/versions/{version}. + * + * @return the packageReferenceId value. + */ + public String packageReferenceId() { + return this.packageReferenceId; + } + + /** + * Set the packageReferenceId property: Specifies the GalleryApplicationVersion resource id on the form of + * /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{application}/versions/{version}. + * + * @param packageReferenceId the packageReferenceId value to set. + * @return the VMGalleryApplication object itself. + */ + public VMGalleryApplication withPackageReferenceId(String packageReferenceId) { + this.packageReferenceId = packageReferenceId; + return this; + } + + /** + * Get the configurationReference property: Optional, Specifies the uri to an azure blob that will replace the + * default configuration for the package if provided. + * + * @return the configurationReference value. + */ + public String configurationReference() { + return this.configurationReference; + } + + /** + * Set the configurationReference property: Optional, Specifies the uri to an azure blob that will replace the + * default configuration for the package if provided. + * + * @param configurationReference the configurationReference value to set. + * @return the VMGalleryApplication object itself. + */ + public VMGalleryApplication withConfigurationReference(String configurationReference) { + this.configurationReference = configurationReference; + return this; + } + + /** + * Get the treatFailureAsDeploymentFailure property: Optional, If true, any failure for any operation in the + * VmApplication will fail the deployment. + * + * @return the treatFailureAsDeploymentFailure value. + */ + public Boolean treatFailureAsDeploymentFailure() { + return this.treatFailureAsDeploymentFailure; + } + + /** + * Set the treatFailureAsDeploymentFailure property: Optional, If true, any failure for any operation in the + * VmApplication will fail the deployment. + * + * @param treatFailureAsDeploymentFailure the treatFailureAsDeploymentFailure value to set. + * @return the VMGalleryApplication object itself. + */ + public VMGalleryApplication withTreatFailureAsDeploymentFailure(Boolean treatFailureAsDeploymentFailure) { + this.treatFailureAsDeploymentFailure = treatFailureAsDeploymentFailure; + return this; + } + + /** + * Get the enableAutomaticUpgrade property: If set to true, when a new Gallery Application version is available in + * PIR/SIG, it will be automatically updated for the VM/VMSS. + * + * @return the enableAutomaticUpgrade value. + */ + public Boolean enableAutomaticUpgrade() { + return this.enableAutomaticUpgrade; + } + + /** + * Set the enableAutomaticUpgrade property: If set to true, when a new Gallery Application version is available in + * PIR/SIG, it will be automatically updated for the VM/VMSS. + * + * @param enableAutomaticUpgrade the enableAutomaticUpgrade value to set. + * @return the VMGalleryApplication object itself. + */ + public VMGalleryApplication withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade) { + this.enableAutomaticUpgrade = enableAutomaticUpgrade; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (packageReferenceId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property packageReferenceId in model VMGalleryApplication")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VMGalleryApplication.class); +} 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..5aa4e53df1b36 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VMGuestPatchClassificationLinux.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.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 a new instance of VMGuestPatchClassificationLinux value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VMGuestPatchClassificationLinux() { + } + + /** + * 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); + } + + /** + * Gets known VMGuestPatchClassificationLinux values. + * + * @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..fc83bf8801fde --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VMGuestPatchClassificationWindows.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.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 a new instance of VMGuestPatchClassificationWindows value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VMGuestPatchClassificationWindows() { + } + + /** + * 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); + } + + /** + * Gets known VMGuestPatchClassificationWindows values. + * + * @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..1165fbfb13a6c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VMGuestPatchRebootBehavior.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Describes the reboot requirements of the patch. */ +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 a new instance of VMGuestPatchRebootBehavior value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VMGuestPatchRebootBehavior() { + } + + /** + * 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); + } + + /** + * Gets known VMGuestPatchRebootBehavior values. + * + * @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..066652debaa5e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VMGuestPatchRebootSetting.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines when it is acceptable to reboot a VM during a software update operation. */ +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 a new instance of VMGuestPatchRebootSetting value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VMGuestPatchRebootSetting() { + } + + /** + * 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); + } + + /** + * Gets known VMGuestPatchRebootSetting values. + * + * @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..f0c0ce4494bbc --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VMGuestPatchRebootStatus.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The reboot state of the VM following completion of the operation. */ +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 a new instance of VMGuestPatchRebootStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VMGuestPatchRebootStatus() { + } + + /** + * 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); + } + + /** + * Gets known VMGuestPatchRebootStatus values. + * + * @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..222b5070c6cdf --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VMScaleSetConvertToSinglePlacementGroupInput.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.fasterxml.jackson.annotation.JsonProperty; + +/** The VMScaleSetConvertToSinglePlacementGroupInput model. */ +@Fluent +public final class VMScaleSetConvertToSinglePlacementGroupInput { + /* + * 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; + + /** Creates an instance of VMScaleSetConvertToSinglePlacementGroupInput class. */ + public VMScaleSetConvertToSinglePlacementGroupInput() { + } + + /** + * 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/VMSizeProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VMSizeProperties.java new file mode 100644 index 0000000000000..8d8d18c8e05e6 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VMSizeProperties.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.fasterxml.jackson.annotation.JsonProperty; + +/** Specifies VM Size Property settings on the virtual machine. */ +@Fluent +public final class VMSizeProperties { + /* + * Specifies the number of vCPUs available for the VM. When this property is not specified in the request body the + * default behavior is to set it to the value of vCPUs available for that VM size exposed in api response of [List + * all available virtual machine sizes in a + * region](https://docs.microsoft.com/en-us/rest/api/compute/resource-skus/list). + */ + @JsonProperty(value = "vCPUsAvailable") + private Integer vCpusAvailable; + + /* + * Specifies the vCPU to physical core ratio. When this property is not specified in the request body the default + * behavior is set to the value of vCPUsPerCore for the VM Size exposed in api response of [List all available + * virtual machine sizes in a region](https://docs.microsoft.com/en-us/rest/api/compute/resource-skus/list). + * **Setting this property to 1 also means that hyper-threading is disabled.** + */ + @JsonProperty(value = "vCPUsPerCore") + private Integer vCpusPerCore; + + /** Creates an instance of VMSizeProperties class. */ + public VMSizeProperties() { + } + + /** + * Get the vCpusAvailable property: Specifies the number of vCPUs available for the VM. When this property is not + * specified in the request body the default behavior is to set it to the value of vCPUs available for that VM size + * exposed in api response of [List all available virtual machine sizes in a + * region](https://docs.microsoft.com/en-us/rest/api/compute/resource-skus/list). + * + * @return the vCpusAvailable value. + */ + public Integer vCpusAvailable() { + return this.vCpusAvailable; + } + + /** + * Set the vCpusAvailable property: Specifies the number of vCPUs available for the VM. When this property is not + * specified in the request body the default behavior is to set it to the value of vCPUs available for that VM size + * exposed in api response of [List all available virtual machine sizes in a + * region](https://docs.microsoft.com/en-us/rest/api/compute/resource-skus/list). + * + * @param vCpusAvailable the vCpusAvailable value to set. + * @return the VMSizeProperties object itself. + */ + public VMSizeProperties withVCpusAvailable(Integer vCpusAvailable) { + this.vCpusAvailable = vCpusAvailable; + return this; + } + + /** + * Get the vCpusPerCore property: Specifies the vCPU to physical core ratio. When this property is not specified in + * the request body the default behavior is set to the value of vCPUsPerCore for the VM Size exposed in api response + * of [List all available virtual machine sizes in a + * region](https://docs.microsoft.com/en-us/rest/api/compute/resource-skus/list). **Setting this property to 1 also + * means that hyper-threading is disabled.**. + * + * @return the vCpusPerCore value. + */ + public Integer vCpusPerCore() { + return this.vCpusPerCore; + } + + /** + * Set the vCpusPerCore property: Specifies the vCPU to physical core ratio. When this property is not specified in + * the request body the default behavior is set to the value of vCPUsPerCore for the VM Size exposed in api response + * of [List all available virtual machine sizes in a + * region](https://docs.microsoft.com/en-us/rest/api/compute/resource-skus/list). **Setting this property to 1 also + * means that hyper-threading is disabled.**. + * + * @param vCpusPerCore the vCpusPerCore value to set. + * @return the VMSizeProperties object itself. + */ + public VMSizeProperties withVCpusPerCore(Integer vCpusPerCore) { + this.vCpusPerCore = vCpusPerCore; + 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..bab19607765bc --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VaultCertificate.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.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 { + /* + * 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":""
}
To + * install certificates on a virtual machine it is recommended to use the [Azure Key Vault virtual machine + * extension for Linux](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux) or the [Azure + * Key Vault virtual machine extension for + * Windows](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows). + */ + @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; + + /** Creates an instance of VaultCertificate class. */ + public VaultCertificate() { + } + + /** + * 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>} <br> To install certificates + * on a virtual machine it is recommended to use the [Azure Key Vault virtual machine extension for + * Linux](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux) or the [Azure Key Vault + * virtual machine extension for + * Windows](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows). + * + * @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>} <br> To install certificates + * on a virtual machine it is recommended to use the [Azure Key Vault virtual machine extension for + * Linux](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux) or the [Azure Key Vault + * virtual machine extension for + * Windows](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows). + * + * @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. + * 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. + * 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..ea821ec3caf0c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VaultSecretGroup.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.management.SubResource; +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 { + /* + * 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; + + /** Creates an instance of VaultSecretGroup class. */ + public VaultSecretGroup() { + } + + /** + * 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..0aa1f3724a44a --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the uri of a disk. */ +@Fluent +public final class VirtualHardDisk { + /* + * Specifies the virtual hard disk's uri. + */ + @JsonProperty(value = "uri") + private String uri; + + /** Creates an instance of VirtualHardDisk class. */ + public VirtualHardDisk() { + } + + /** + * 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..8127f950d0c10 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachine.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.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineInner; +import java.time.OffsetDateTime; +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. Minimum api-version: + * 2015-06-15. + * + * @return the diagnosticsProfile value. + */ + DiagnosticsProfile diagnosticsProfile(); + + /** + * Gets the availabilitySet property: Specifies information about the availability set that the virtual machine + * should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes + * to maximize availability. For more information about availability sets, see [Availability sets + * overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). For more information on + * Azure planned maintenance, see [Maintenance and updates for Virtual Machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates). Currently, a VM can only be + * added to availability set at creation time. The availability set to which the VM is being added should be under + * the same resource group as the availability set resource. An existing VM cannot be added to an availability set. + * This property cannot exist along with a non-null properties.virtualMachineScaleSet reference. + * + * @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. This property cannot exist + * along with a non-null properties.availabilitySet reference. 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. Minimum api-version: 2018-04-01. + * + * @return the proximityPlacementGroup value. + */ + SubResource proximityPlacementGroup(); + + /** + * Gets the priority property: Specifies the priority for the virtual machine. 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. 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. + * + * @return the evictionPolicy value. + */ + VirtualMachineEvictionPolicyTypes evictionPolicy(); + + /** + * Gets the billingProfile property: Specifies the billing related details of a Azure Spot virtual machine. 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. + * 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. **Note:** User cannot specify both host and hostGroup properties. Minimum api-version: 2020-06-01. + * + * @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). 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. 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' greater than 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. + * + * @return the platformFaultDomain value. + */ + Integer platformFaultDomain(); + + /** + * Gets the scheduledEventsProfile property: Specifies Scheduled Event related configurations. + * + * @return the scheduledEventsProfile value. + */ + ScheduledEventsProfile scheduledEventsProfile(); + + /** + * Gets the userData property: UserData for the VM, which must be base-64 encoded. Customer should not pass any + * secrets in here. Minimum api-version: 2021-03-01. + * + * @return the userData value. + */ + String userData(); + + /** + * Gets the capacityReservation property: Specifies information about the capacity reservation that is used to + * allocate virtual machine. Minimum api-version: 2021-04-01. + * + * @return the capacityReservation value. + */ + CapacityReservationProfile capacityReservation(); + + /** + * Gets the applicationProfile property: Specifies the gallery applications that should be made available to the + * VM/VMSS. + * + * @return the applicationProfile value. + */ + ApplicationProfile applicationProfile(); + + /** + * Gets the timeCreated property: Specifies the time at which the Virtual Machine resource was created. Minimum + * api-version: 2021-11-01. + * + * @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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineInner object. + * + * @return the inner object. + */ + VirtualMachineInner innerModel(); + + /** The entirety of the VirtualMachine definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The VirtualMachine definition stages. */ + interface DefinitionStages { + /** The first stage of the VirtualMachine definition. */ + interface Blank extends WithLocation { + } + /** The stage of the VirtualMachine definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the VirtualMachine definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the VirtualMachine definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithPlan, + DefinitionStages.WithIdentity, + DefinitionStages.WithZones, + DefinitionStages.WithExtendedLocation, + DefinitionStages.WithHardwareProfile, + DefinitionStages.WithStorageProfile, + DefinitionStages.WithAdditionalCapabilities, + DefinitionStages.WithOsProfile, + DefinitionStages.WithNetworkProfile, + DefinitionStages.WithSecurityProfile, + DefinitionStages.WithDiagnosticsProfile, + DefinitionStages.WithAvailabilitySet, + DefinitionStages.WithVirtualMachineScaleSet, + DefinitionStages.WithProximityPlacementGroup, + DefinitionStages.WithPriority, + DefinitionStages.WithEvictionPolicy, + DefinitionStages.WithBillingProfile, + DefinitionStages.WithHost, + DefinitionStages.WithHostGroup, + DefinitionStages.WithLicenseType, + DefinitionStages.WithExtensionsTimeBudget, + DefinitionStages.WithPlatformFaultDomain, + DefinitionStages.WithScheduledEventsProfile, + DefinitionStages.WithUserData, + DefinitionStages.WithCapacityReservation, + DefinitionStages.WithApplicationProfile { + /** + * 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. Minimum + * api-version: 2015-06-15.. + * + * @param diagnosticsProfile Specifies the boot diagnostic settings state. Minimum api-version: 2015-06-15. + * @return the next definition stage. + */ + WithCreate withDiagnosticsProfile(DiagnosticsProfile diagnosticsProfile); + } + /** The stage of the VirtualMachine definition allowing to specify availabilitySet. */ + interface WithAvailabilitySet { + /** + * Specifies the availabilitySet property: Specifies information about the availability set that the virtual + * machine should be assigned to. Virtual machines specified in the same availability set are allocated to + * different nodes to maximize availability. For more information about availability sets, see [Availability + * sets overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). For more + * information on Azure planned maintenance, see [Maintenance and updates for Virtual Machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates). Currently, a VM can + * only be added to availability set at creation time. The availability set to which the VM is being added + * should be under the same resource group as the availability set resource. An existing VM cannot be added + * to an availability set. This property cannot exist along with a non-null + * properties.virtualMachineScaleSet reference.. + * + * @param availabilitySet Specifies information about the availability set that the virtual machine should + * be assigned to. Virtual machines specified in the same availability set are allocated to different + * nodes to maximize availability. For more information about availability sets, see [Availability sets + * overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). For more + * information on Azure planned maintenance, see [Maintenance and updates for Virtual Machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates). Currently, a VM + * can only be added to availability set at creation time. The availability set to which the VM is being + * added should be under the same resource group as the availability set resource. An existing VM cannot + * be added to an availability set. This property cannot exist along with a non-null + * properties.virtualMachineScaleSet reference. + * @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. This property cannot exist along with a non-null properties.availabilitySet reference. 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. + * This property cannot exist along with a non-null properties.availabilitySet reference. 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. Minimum api-version: 2018-04-01.. + * + * @param proximityPlacementGroup Specifies information about the proximity placement group that the virtual + * machine should be assigned to. 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. Minimum api-version: + * 2019-03-01. + * + * @param priority Specifies the priority for the virtual machine. 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. 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.. + * + * @param evictionPolicy 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. + * @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. Minimum api-version: 2019-03-01.. + * + * @param billingProfile Specifies the billing related details of a Azure Spot virtual machine. 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. Minimum api-version: 2018-10-01.. + * + * @param host Specifies information about the dedicated host that the virtual machine resides in. 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. **Note:** User cannot specify both host and hostGroup properties. Minimum + * api-version: 2020-06-01.. + * + * @param hostGroup Specifies information about the dedicated host group that the virtual machine resides + * in. **Note:** User cannot specify both host and hostGroup properties. Minimum api-version: + * 2020-06-01. + * @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). 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). 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. 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' greater than 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.. + * + * @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. 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' greater than 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. + * @return the next definition stage. + */ + WithCreate withPlatformFaultDomain(Integer platformFaultDomain); + } + /** The stage of the VirtualMachine definition allowing to specify scheduledEventsProfile. */ + interface WithScheduledEventsProfile { + /** + * Specifies the scheduledEventsProfile property: Specifies Scheduled Event related configurations.. + * + * @param scheduledEventsProfile Specifies Scheduled Event related configurations. + * @return the next definition stage. + */ + WithCreate withScheduledEventsProfile(ScheduledEventsProfile scheduledEventsProfile); + } + /** The stage of the VirtualMachine definition allowing to specify userData. */ + interface WithUserData { + /** + * Specifies the userData property: UserData for the VM, which must be base-64 encoded. Customer should not + * pass any secrets in here. Minimum api-version: 2021-03-01.. + * + * @param userData UserData for the VM, which must be base-64 encoded. Customer should not pass any secrets + * in here. Minimum api-version: 2021-03-01. + * @return the next definition stage. + */ + WithCreate withUserData(String userData); + } + /** The stage of the VirtualMachine definition allowing to specify capacityReservation. */ + interface WithCapacityReservation { + /** + * Specifies the capacityReservation property: Specifies information about the capacity reservation that is + * used to allocate virtual machine. Minimum api-version: 2021-04-01.. + * + * @param capacityReservation Specifies information about the capacity reservation that is used to allocate + * virtual machine. Minimum api-version: 2021-04-01. + * @return the next definition stage. + */ + WithCreate withCapacityReservation(CapacityReservationProfile capacityReservation); + } + /** The stage of the VirtualMachine definition allowing to specify applicationProfile. */ + interface WithApplicationProfile { + /** + * Specifies the applicationProfile property: Specifies the gallery applications that should be made + * available to the VM/VMSS.. + * + * @param applicationProfile Specifies the gallery applications that should be made available to the + * VM/VMSS. + * @return the next definition stage. + */ + WithCreate withApplicationProfile(ApplicationProfile applicationProfile); + } + } + /** + * Begins update for the VirtualMachine resource. + * + * @return the stage of resource update. + */ + VirtualMachine.Update update(); + + /** The template for VirtualMachine update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithPlan, + UpdateStages.WithIdentity, + UpdateStages.WithZones, + UpdateStages.WithHardwareProfile, + UpdateStages.WithStorageProfile, + UpdateStages.WithAdditionalCapabilities, + UpdateStages.WithOsProfile, + UpdateStages.WithNetworkProfile, + UpdateStages.WithSecurityProfile, + UpdateStages.WithDiagnosticsProfile, + UpdateStages.WithAvailabilitySet, + UpdateStages.WithVirtualMachineScaleSet, + UpdateStages.WithProximityPlacementGroup, + UpdateStages.WithPriority, + UpdateStages.WithEvictionPolicy, + UpdateStages.WithBillingProfile, + UpdateStages.WithHost, + UpdateStages.WithHostGroup, + UpdateStages.WithLicenseType, + UpdateStages.WithExtensionsTimeBudget, + UpdateStages.WithPlatformFaultDomain, + UpdateStages.WithScheduledEventsProfile, + UpdateStages.WithUserData, + UpdateStages.WithCapacityReservation, + UpdateStages.WithApplicationProfile { + /** + * 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. Minimum + * api-version: 2015-06-15.. + * + * @param diagnosticsProfile Specifies the boot diagnostic settings state. Minimum api-version: 2015-06-15. + * @return the next definition stage. + */ + Update withDiagnosticsProfile(DiagnosticsProfile diagnosticsProfile); + } + /** The stage of the VirtualMachine update allowing to specify availabilitySet. */ + interface WithAvailabilitySet { + /** + * Specifies the availabilitySet property: Specifies information about the availability set that the virtual + * machine should be assigned to. Virtual machines specified in the same availability set are allocated to + * different nodes to maximize availability. For more information about availability sets, see [Availability + * sets overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). For more + * information on Azure planned maintenance, see [Maintenance and updates for Virtual Machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates). Currently, a VM can + * only be added to availability set at creation time. The availability set to which the VM is being added + * should be under the same resource group as the availability set resource. An existing VM cannot be added + * to an availability set. This property cannot exist along with a non-null + * properties.virtualMachineScaleSet reference.. + * + * @param availabilitySet Specifies information about the availability set that the virtual machine should + * be assigned to. Virtual machines specified in the same availability set are allocated to different + * nodes to maximize availability. For more information about availability sets, see [Availability sets + * overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). For more + * information on Azure planned maintenance, see [Maintenance and updates for Virtual Machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates). Currently, a VM + * can only be added to availability set at creation time. The availability set to which the VM is being + * added should be under the same resource group as the availability set resource. An existing VM cannot + * be added to an availability set. This property cannot exist along with a non-null + * properties.virtualMachineScaleSet reference. + * @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. This property cannot exist along with a non-null properties.availabilitySet reference. 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. + * This property cannot exist along with a non-null properties.availabilitySet reference. 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. Minimum api-version: 2018-04-01.. + * + * @param proximityPlacementGroup Specifies information about the proximity placement group that the virtual + * machine should be assigned to. 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. Minimum api-version: + * 2019-03-01. + * + * @param priority Specifies the priority for the virtual machine. 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. 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.. + * + * @param evictionPolicy 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. + * @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. Minimum api-version: 2019-03-01.. + * + * @param billingProfile Specifies the billing related details of a Azure Spot virtual machine. 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. Minimum api-version: 2018-10-01.. + * + * @param host Specifies information about the dedicated host that the virtual machine resides in. 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. **Note:** User cannot specify both host and hostGroup properties. Minimum + * api-version: 2020-06-01.. + * + * @param hostGroup Specifies information about the dedicated host group that the virtual machine resides + * in. **Note:** User cannot specify both host and hostGroup properties. Minimum api-version: + * 2020-06-01. + * @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). 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). 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. 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' greater than 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.. + * + * @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. 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' greater than 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. + * @return the next definition stage. + */ + Update withPlatformFaultDomain(Integer platformFaultDomain); + } + /** The stage of the VirtualMachine update allowing to specify scheduledEventsProfile. */ + interface WithScheduledEventsProfile { + /** + * Specifies the scheduledEventsProfile property: Specifies Scheduled Event related configurations.. + * + * @param scheduledEventsProfile Specifies Scheduled Event related configurations. + * @return the next definition stage. + */ + Update withScheduledEventsProfile(ScheduledEventsProfile scheduledEventsProfile); + } + /** The stage of the VirtualMachine update allowing to specify userData. */ + interface WithUserData { + /** + * Specifies the userData property: UserData for the VM, which must be base-64 encoded. Customer should not + * pass any secrets in here. Minimum api-version: 2021-03-01.. + * + * @param userData UserData for the VM, which must be base-64 encoded. Customer should not pass any secrets + * in here. Minimum api-version: 2021-03-01. + * @return the next definition stage. + */ + Update withUserData(String userData); + } + /** The stage of the VirtualMachine update allowing to specify capacityReservation. */ + interface WithCapacityReservation { + /** + * Specifies the capacityReservation property: Specifies information about the capacity reservation that is + * used to allocate virtual machine. Minimum api-version: 2021-04-01.. + * + * @param capacityReservation Specifies information about the capacity reservation that is used to allocate + * virtual machine. Minimum api-version: 2021-04-01. + * @return the next definition stage. + */ + Update withCapacityReservation(CapacityReservationProfile capacityReservation); + } + /** The stage of the VirtualMachine update allowing to specify applicationProfile. */ + interface WithApplicationProfile { + /** + * Specifies the applicationProfile property: Specifies the gallery applications that should be made + * available to the VM/VMSS.. + * + * @param applicationProfile Specifies the gallery applications that should be made available to the + * VM/VMSS. + * @return the next definition stage. + */ + Update withApplicationProfile(ApplicationProfile applicationProfile); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + VirtualMachine refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + VirtualMachine refresh(Context context); + + /** + * Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar + * VMs. + * + * @param parameters Parameters supplied to the Capture Virtual Machine operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of virtual machine capture operation. + */ + VirtualMachineCaptureResult capture(VirtualMachineCaptureParameters parameters); + + /** + * Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar + * VMs. + * + * @param parameters Parameters supplied to the Capture Virtual Machine operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of virtual machine capture operation. + */ + VirtualMachineCaptureResult capture(VirtualMachineCaptureParameters parameters, Context context); + + /** + * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before + * invoking this operation. + * + * @throws com.azure.resourcemanager.compute.generated.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 convertToManagedDisks(); + + /** + * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before + * invoking this operation. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.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 convertToManagedDisks(Context context); + + /** + * Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources + * that this virtual machine uses. + * + * @throws com.azure.resourcemanager.compute.generated.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 deallocate(); + + /** + * Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources + * that this virtual machine uses. + * + * @param hibernate Optional parameter to hibernate a virtual machine. (Feature in Preview). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.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 deallocate(Boolean hibernate, Context context); + + /** + * Sets the OS state of the virtual machine to generalized. It is recommended to sysprep the virtual machine before + * performing this operation. For Windows, please refer to [Create a managed image of a generalized VM in + * Azure](https://docs.microsoft.com/azure/virtual-machines/windows/capture-image-resource). For Linux, please refer + * to [How to create an image of a virtual machine or + * VHD](https://docs.microsoft.com/azure/virtual-machines/linux/capture-image). + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response generalizeWithResponse(Context context); + + /** + * Sets the OS state of the virtual machine to generalized. It is recommended to sysprep the virtual machine before + * performing this operation. For Windows, please refer to [Create a managed image of a generalized VM in + * Azure](https://docs.microsoft.com/azure/virtual-machines/windows/capture-image-resource). For Linux, please refer + * to [How to create an image of a virtual machine or + * VHD](https://docs.microsoft.com/azure/virtual-machines/linux/capture-image). + * + * @throws com.azure.resourcemanager.compute.generated.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 generalize(); + + /** + * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same + * provisioned resources. You are still charged for this virtual machine. + * + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void powerOff(); + + /** + * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same + * provisioned resources. You are still charged for this virtual machine. + * + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * specified. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void powerOff(Boolean skipShutdown, Context context); + + /** + * The operation to reapply a virtual machine's state. + * + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void reapply(); + + /** + * The operation to reapply a virtual machine's state. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void reapply(Context context); + + /** + * The operation to restart a virtual machine. + * + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void restart(); + + /** + * The operation to restart a virtual machine. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void restart(Context context); + + /** + * The operation to start a virtual machine. + * + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(); + + /** + * The operation to start a virtual machine. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(Context context); + + /** + * Shuts down the virtual machine, moves it to a new node, and powers it back on. + * + * @throws com.azure.resourcemanager.compute.generated.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 redeploy(); + + /** + * Shuts down the virtual machine, moves it to a new node, and powers it back on. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.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 redeploy(Context context); + + /** + * Reimages (upgrade the operating system) a virtual machine 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. NOTE: The retaining of old + * OS disk depends on the value of deleteOption of OS disk. If deleteOption is detach, the old OS disk will be + * preserved after reimage. If deleteOption is delete, the old OS disk will be deleted after reimage. The + * deleteOption of the OS disk should be updated accordingly before performing the reimage. + * + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void reimage(); + + /** + * Reimages (upgrade the operating system) a virtual machine 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. NOTE: The retaining of old + * OS disk depends on the value of deleteOption of OS disk. If deleteOption is detach, the old OS disk will be + * preserved after reimage. If deleteOption is delete, the old OS disk will be deleted after reimage. The + * deleteOption of the OS disk should be updated accordingly before performing the reimage. + * + * @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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void reimage(VirtualMachineReimageParameters parameters, Context context); + + /** + * The operation to retrieve SAS URIs for a virtual machine's boot diagnostic logs. + * + * @param sasUriExpirationTimeInMinutes Expiration duration in minutes for the SAS URIs with a value between 1 to + * 1440 minutes. **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 along with {@link Response}. + */ + Response retrieveBootDiagnosticsDataWithResponse( + Integer sasUriExpirationTimeInMinutes, Context context); + + /** + * The operation to retrieve SAS URIs for a virtual machine's boot diagnostic logs. + * + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAS URIs of the console screenshot and serial log blobs. + */ + RetrieveBootDiagnosticsDataResult retrieveBootDiagnosticsData(); + + /** + * The operation to perform maintenance on a virtual machine. + * + * @throws com.azure.resourcemanager.compute.generated.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 performMaintenance(); + + /** + * The operation to perform maintenance on a virtual machine. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.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 performMaintenance(Context context); + + /** + * The operation to simulate the eviction of spot virtual machine. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response simulateEvictionWithResponse(Context context); + + /** + * The operation to simulate the eviction of spot virtual machine. + * + * @throws com.azure.resourcemanager.compute.generated.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 simulateEviction(); + + /** + * Assess patches on the VM. + * + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the properties of an AssessPatches result. + */ + VirtualMachineAssessPatchesResult assessPatches(); + + /** + * Assess patches on the VM. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the properties of an AssessPatches result. + */ + VirtualMachineAssessPatchesResult assessPatches(Context context); + + /** + * Installs patches on the VM. + * + * @param installPatchesInput Input for InstallPatches as directly received by the API. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result summary of an installation operation. + */ + VirtualMachineInstallPatchesResult installPatches(VirtualMachineInstallPatchesParameters installPatchesInput); + + /** + * Installs patches on the VM. + * + * @param installPatchesInput Input for InstallPatches as directly received by the API. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result summary of an installation operation. + */ + VirtualMachineInstallPatchesResult installPatches( + VirtualMachineInstallPatchesParameters installPatchesInput, Context context); + + /** + * Run command on the VM. + * + * @param parameters Parameters supplied to the Run command operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + RunCommandResult runCommand(RunCommandInput parameters); + + /** + * Run command on the VM. + * + * @param parameters Parameters supplied to the Run command operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + RunCommandResult runCommand(RunCommandInput parameters, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineAgentInstanceView.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineAgentInstanceView.java new file mode 100644 index 0000000000000..2a716badc99b3 --- /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.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 { + /* + * 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; + + /** Creates an instance of VirtualMachineAgentInstanceView class. */ + public VirtualMachineAgentInstanceView() { + } + + /** + * 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..f0e321c7d5a77 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineCaptureParameters.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.JsonProperty; + +/** Capture Virtual Machine parameters. */ +@Fluent +public final class VirtualMachineCaptureParameters { + /* + * 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; + + /** Creates an instance of VirtualMachineCaptureParameters class. */ + public VirtualMachineCaptureParameters() { + } + + /** + * 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")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VirtualMachineCaptureParameters.class); +} 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..9f7f385e128f5 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineEvictionPolicyTypes.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; + +/** Specifies the eviction policy for the Azure Spot VM/VMSS. */ +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 a new instance of VirtualMachineEvictionPolicyTypes value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VirtualMachineEvictionPolicyTypes() { + } + + /** + * 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); + } + + /** + * Gets known VirtualMachineEvictionPolicyTypes values. + * + * @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..83106376343d3 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineExtension.java @@ -0,0 +1,580 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.List; +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 suppressFailures property: Indicates whether failures stemming from the extension will be suppressed + * (Operational failures such as not connecting to the VM will not be suppressed regardless of this value). The + * default is false. + * + * @return the suppressFailures value. + */ + Boolean suppressFailures(); + + /** + * Gets the protectedSettingsFromKeyVault property: The extensions protected settings that are passed by reference, + * and consumed from key vault. + * + * @return the protectedSettingsFromKeyVault value. + */ + KeyVaultSecretReference protectedSettingsFromKeyVault(); + + /** + * Gets the provisionAfterExtensions property: Collection of extension names after which this extension needs to be + * provisioned. + * + * @return the provisionAfterExtensions value. + */ + List provisionAfterExtensions(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.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, + DefinitionStages.WithSuppressFailures, + DefinitionStages.WithProtectedSettingsFromKeyVault, + DefinitionStages.WithProvisionAfterExtensions { + /** + * 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); + } + /** The stage of the VirtualMachineExtension definition allowing to specify suppressFailures. */ + interface WithSuppressFailures { + /** + * Specifies the suppressFailures property: Indicates whether failures stemming from the extension will be + * suppressed (Operational failures such as not connecting to the VM will not be suppressed regardless of + * this value). The default is false.. + * + * @param suppressFailures Indicates whether failures stemming from the extension will be suppressed + * (Operational failures such as not connecting to the VM will not be suppressed regardless of this + * value). The default is false. + * @return the next definition stage. + */ + WithCreate withSuppressFailures(Boolean suppressFailures); + } + /** The stage of the VirtualMachineExtension definition allowing to specify protectedSettingsFromKeyVault. */ + interface WithProtectedSettingsFromKeyVault { + /** + * Specifies the protectedSettingsFromKeyVault property: The extensions protected settings that are passed + * by reference, and consumed from key vault. + * + * @param protectedSettingsFromKeyVault The extensions protected settings that are passed by reference, and + * consumed from key vault. + * @return the next definition stage. + */ + WithCreate withProtectedSettingsFromKeyVault(KeyVaultSecretReference protectedSettingsFromKeyVault); + } + /** The stage of the VirtualMachineExtension 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 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, + UpdateStages.WithSuppressFailures, + UpdateStages.WithProtectedSettingsFromKeyVault { + /** + * 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); + } + /** The stage of the VirtualMachineExtension update allowing to specify suppressFailures. */ + interface WithSuppressFailures { + /** + * Specifies the suppressFailures property: Indicates whether failures stemming from the extension will be + * suppressed (Operational failures such as not connecting to the VM will not be suppressed regardless of + * this value). The default is false.. + * + * @param suppressFailures Indicates whether failures stemming from the extension will be suppressed + * (Operational failures such as not connecting to the VM will not be suppressed regardless of this + * value). The default is false. + * @return the next definition stage. + */ + Update withSuppressFailures(Boolean suppressFailures); + } + /** The stage of the VirtualMachineExtension update allowing to specify protectedSettingsFromKeyVault. */ + interface WithProtectedSettingsFromKeyVault { + /** + * Specifies the protectedSettingsFromKeyVault property: The extensions protected settings that are passed + * by reference, and consumed from key vault. + * + * @param protectedSettingsFromKeyVault The extensions protected settings that are passed by reference, and + * consumed from key vault. + * @return the next definition stage. + */ + Update withProtectedSettingsFromKeyVault(KeyVaultSecretReference protectedSettingsFromKeyVault); + } + } + /** + * 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..ac4789512719c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineExtensionHandlerInstanceView.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.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The instance view of a virtual machine extension handler. */ +@Fluent +public final class VirtualMachineExtensionHandlerInstanceView { + /* + * 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; + + /** Creates an instance of VirtualMachineExtensionHandlerInstanceView class. */ + public VirtualMachineExtensionHandlerInstanceView() { + } + + /** + * 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..82780a6329954 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineExtensionImages.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.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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 along with {@link Response}. + */ + Response getWithResponse( + String location, String publisherName, String type, String version, 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 com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 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.resourcemanager.compute.generated.models.ApiErrorException thrown if 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 along with {@link Response}. + */ + Response> listTypesWithResponse( + String location, String publisherName, 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.resourcemanager.compute.generated.models.ApiErrorException thrown if 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 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.resourcemanager.compute.generated.models.ApiErrorException thrown if 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 along with {@link Response}. + */ + Response> listVersionsWithResponse( + String location, + String publisherName, + String type, + String filter, + Integer top, + String orderby, + 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.resourcemanager.compute.generated.models.ApiErrorException thrown if 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); +} 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..efce5b1e92c4c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineExtensionInstanceView.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.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The instance view of a virtual machine extension. */ +@Fluent +public final class VirtualMachineExtensionInstanceView { + /* + * 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; + + /** Creates an instance of VirtualMachineExtensionInstanceView class. */ + public VirtualMachineExtensionInstanceView() { + } + + /** + * 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..df4ef52db4178 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineExtensionUpdate.java @@ -0,0 +1,300 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineExtensionUpdateProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Describes a Virtual Machine Extension. */ +@Fluent +public final class VirtualMachineExtensionUpdate extends UpdateResource { + /* + * Describes the properties of a Virtual Machine Extension. + */ + @JsonProperty(value = "properties") + private VirtualMachineExtensionUpdateProperties innerProperties; + + /** Creates an instance of VirtualMachineExtensionUpdate class. */ + public VirtualMachineExtensionUpdate() { + } + + /** + * Get the innerProperties property: Describes the properties of a Virtual Machine Extension. + * + * @return the innerProperties value. + */ + private VirtualMachineExtensionUpdateProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public VirtualMachineExtensionUpdate withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineExtensionUpdateProperties(); + } + this.innerProperties().withForceUpdateTag(forceUpdateTag); + return this; + } + + /** + * Get the publisher property: The name of the extension handler publisher. + * + * @return the publisher value. + */ + public String publisher() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineExtensionUpdateProperties(); + } + this.innerProperties().withPublisher(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineExtensionUpdateProperties(); + } + this.innerProperties().withType(type); + return this; + } + + /** + * Get the typeHandlerVersion property: Specifies the version of the script handler. + * + * @return the typeHandlerVersion value. + */ + public String typeHandlerVersion() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineExtensionUpdateProperties(); + } + this.innerProperties().withTypeHandlerVersion(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineExtensionUpdateProperties(); + } + this.innerProperties().withAutoUpgradeMinorVersion(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineExtensionUpdateProperties(); + } + this.innerProperties().withEnableAutomaticUpgrade(enableAutomaticUpgrade); + return this; + } + + /** + * Get the settings property: Json formatted public settings for the extension. + * + * @return the settings value. + */ + public Object settings() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineExtensionUpdateProperties(); + } + this.innerProperties().withSettings(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineExtensionUpdateProperties(); + } + this.innerProperties().withProtectedSettings(protectedSettings); + return this; + } + + /** + * Get the suppressFailures property: Indicates whether failures stemming from the extension will be suppressed + * (Operational failures such as not connecting to the VM will not be suppressed regardless of this value). The + * default is false. + * + * @return the suppressFailures value. + */ + public Boolean suppressFailures() { + return this.innerProperties() == null ? null : this.innerProperties().suppressFailures(); + } + + /** + * Set the suppressFailures property: Indicates whether failures stemming from the extension will be suppressed + * (Operational failures such as not connecting to the VM will not be suppressed regardless of this value). The + * default is false. + * + * @param suppressFailures the suppressFailures value to set. + * @return the VirtualMachineExtensionUpdate object itself. + */ + public VirtualMachineExtensionUpdate withSuppressFailures(Boolean suppressFailures) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineExtensionUpdateProperties(); + } + this.innerProperties().withSuppressFailures(suppressFailures); + return this; + } + + /** + * Get the protectedSettingsFromKeyVault property: The extensions protected settings that are passed by reference, + * and consumed from key vault. + * + * @return the protectedSettingsFromKeyVault value. + */ + public KeyVaultSecretReference protectedSettingsFromKeyVault() { + return this.innerProperties() == null ? null : this.innerProperties().protectedSettingsFromKeyVault(); + } + + /** + * Set the protectedSettingsFromKeyVault property: The extensions protected settings that are passed by reference, + * and consumed from key vault. + * + * @param protectedSettingsFromKeyVault the protectedSettingsFromKeyVault value to set. + * @return the VirtualMachineExtensionUpdate object itself. + */ + public VirtualMachineExtensionUpdate withProtectedSettingsFromKeyVault( + KeyVaultSecretReference protectedSettingsFromKeyVault) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineExtensionUpdateProperties(); + } + this.innerProperties().withProtectedSettingsFromKeyVault(protectedSettingsFromKeyVault); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().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..51f78205c713e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineExtensions.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.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.resourcemanager.compute.generated.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 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.resourcemanager.compute.generated.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 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. + * @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 Extension along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String vmName, String vmExtensionName, String expand, 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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 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.resourcemanager.compute.generated.models.ApiErrorException thrown 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 along with {@link Response}. + */ + Response listWithResponse( + String resourceGroupName, String vmName, 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.resourcemanager.compute.generated.models.ApiErrorException thrown 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 the 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 Virtual Machine Extension along with {@link Response}. + */ + 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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 along with {@link Response}. + */ + 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.resourcemanager.compute.generated.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 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 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..2e93697ff2f2b --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** The health status of the VM. */ +@Immutable +public final class VirtualMachineHealthStatus { + /* + * The health status information for the VM. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private InstanceViewStatus status; + + /** Creates an instance of VirtualMachineHealthStatus class. */ + public VirtualMachineHealthStatus() { + } + + /** + * 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..ca71952195baa --- /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.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Identity for the virtual machine. */ +@Fluent +public final class VirtualMachineIdentity { + /* + * 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") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map userAssignedIdentities; + + /** Creates an instance of VirtualMachineIdentity class. */ + public VirtualMachineIdentity() { + } + + /** + * 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..c3aa2fec38c0f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineImage.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.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 architecture property: Specifies the Architecture Type. + * + * @return the architecture value. + */ + ArchitectureTypes architecture(); + + /** + * Gets the imageDeprecationStatus property: Describes image deprecation status properties on the image. + * + * @return the imageDeprecationStatus value. + */ + ImageDeprecationStatus imageDeprecationStatus(); + + /** + * 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..3b7410b1e0cd1 --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** Specifies additional capabilities supported by the image. */ +@Fluent +public final class VirtualMachineImageFeature { + /* + * The name of the feature. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The corresponding value for the feature. + */ + @JsonProperty(value = "value") + private String value; + + /** Creates an instance of VirtualMachineImageFeature class. */ + public VirtualMachineImageFeature() { + } + + /** + * 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..4862877bfc24d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineImages.java @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 along with {@link Response}. + */ + Response getWithResponse( + String location, String publisherName, String offer, String skus, String version, 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 com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 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.resourcemanager.compute.generated.models.ApiErrorException thrown if 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 along + * with {@link Response}. + */ + Response> listWithResponse( + String location, + String publisherName, + String offer, + String skus, + String expand, + Integer top, + String orderby, + 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.resourcemanager.compute.generated.models.ApiErrorException thrown if 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 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.resourcemanager.compute.generated.models.ApiErrorException thrown if 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 along with {@link + * Response}. + */ + Response> listOffersWithResponse( + String location, String publisherName, 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.resourcemanager.compute.generated.models.ApiErrorException thrown if 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 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.resourcemanager.compute.generated.models.ApiErrorException thrown if 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 along with {@link Response}. + */ + Response> listPublishersWithResponse(String location, 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.resourcemanager.compute.generated.models.ApiErrorException thrown if 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 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.resourcemanager.compute.generated.models.ApiErrorException thrown if 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 along with {@link + * Response}. + */ + Response> listSkusWithResponse( + String location, String publisherName, String offer, 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.resourcemanager.compute.generated.models.ApiErrorException thrown if 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 all virtual machine image versions for the specified 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 all virtual machine image versions for the specified edge zone along with {@link Response}. + */ + Response listByEdgeZoneWithResponse( + String location, String edgeZone, Context context); + + /** + * Gets a list of all virtual machine image versions for the specified 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 all virtual machine image versions for the specified edge zone. + */ + VmImagesInEdgeZoneListResult listByEdgeZone(String location, String edgeZone); +} 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..433f8ca85b69b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineImagesEdgeZones.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.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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 along with {@link Response}. + */ + Response getWithResponse( + String location, + String edgeZone, + String publisherName, + String offer, + String skus, + String version, + 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 com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 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 along with {@link Response}. + */ + Response> listWithResponse( + String location, + String edgeZone, + String publisherName, + String offer, + String skus, + String expand, + Integer top, + String orderby, + 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 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 along with + * {@link Response}. + */ + Response> listOffersWithResponse( + String location, String edgeZone, String publisherName, 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 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 along with + * {@link Response}. + */ + Response> listPublishersWithResponse( + String location, String edgeZone, 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 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 along + * with {@link Response}. + */ + Response> listSkusWithResponse( + String location, String edgeZone, String publisherName, String offer, 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); +} 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..f223672cf11c1 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineInstallPatchesParameters.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.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Input for InstallPatches as directly received by the API. */ +@Fluent +public final class VirtualMachineInstallPatchesParameters { + /* + * 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") + 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; + + /** Creates an instance of VirtualMachineInstallPatchesParameters class. */ + public VirtualMachineInstallPatchesParameters() { + } + + /** + * 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 (rebootSetting() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property rebootSetting in model VirtualMachineInstallPatchesParameters")); + } + if (windowsParameters() != null) { + windowsParameters().validate(); + } + if (linuxParameters() != null) { + linuxParameters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VirtualMachineInstallPatchesParameters.class); +} 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..26ff5e437408d --- /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. You can easily view the output of your console log. 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. Minimum api-version: 2020-06-01. + * + * @return the assignedHost value. + */ + String assignedHost(); + + /** + * Gets the statuses property: The resource status information. + * + * @return the statuses value. + */ + List statuses(); + + /** + * Gets the patchStatus property: [Preview Feature] The status of virtual machine patch operations. + * + * @return the patchStatus value. + */ + VirtualMachinePatchStatus patchStatus(); + + /** + * Gets the inner com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineInstanceViewInner object. + * + * @return the inner object. + */ + VirtualMachineInstanceViewInner innerModel(); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineIpTag.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineIpTag.java new file mode 100644 index 0000000000000..60c3adf116b2f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineIpTag.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Contains the IP tag associated with the public IP address. */ +@Fluent +public final class VirtualMachineIpTag { + /* + * 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; + + /** Creates an instance of VirtualMachineIpTag class. */ + public VirtualMachineIpTag() { + } + + /** + * Get the ipTagType property: IP tag type. Example: FirstPartyUsage. + * + * @return the ipTagType value. + */ + public String ipTagType() { + return this.ipTagType; + } + + /** + * Set the ipTagType property: IP tag type. Example: FirstPartyUsage. + * + * @param ipTagType the ipTagType value to set. + * @return the VirtualMachineIpTag object itself. + */ + public VirtualMachineIpTag withIpTagType(String ipTagType) { + this.ipTagType = ipTagType; + return this; + } + + /** + * Get the tag property: IP tag associated with the public IP. Example: SQL, Storage etc. + * + * @return the tag value. + */ + public String tag() { + return this.tag; + } + + /** + * Set the tag property: IP tag associated with the public IP. Example: SQL, Storage etc. + * + * @param tag the tag value to set. + * @return the VirtualMachineIpTag object itself. + */ + public VirtualMachineIpTag withTag(String tag) { + this.tag = tag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineListResult.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineListResult.java new file mode 100644 index 0000000000000..0ef7011c6ac2c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineListResult.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.VirtualMachineInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List Virtual Machine operation response. */ +@Fluent +public final class VirtualMachineListResult { + /* + * 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; + + /** Creates an instance of VirtualMachineListResult class. */ + public VirtualMachineListResult() { + } + + /** + * 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()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VirtualMachineListResult.class); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineNetworkInterfaceConfiguration.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineNetworkInterfaceConfiguration.java new file mode 100644 index 0000000000000..46133dfb0ad18 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineNetworkInterfaceConfiguration.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.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineNetworkInterfaceConfigurationProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a virtual machine network interface configurations. */ +@Fluent +public final class VirtualMachineNetworkInterfaceConfiguration { + /* + * The network interface configuration name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Describes a virtual machine network profile's IP configuration. + */ + @JsonProperty(value = "properties") + private VirtualMachineNetworkInterfaceConfigurationProperties innerProperties; + + /** Creates an instance of VirtualMachineNetworkInterfaceConfiguration class. */ + public VirtualMachineNetworkInterfaceConfiguration() { + } + + /** + * Get the name property: The network interface configuration name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The network interface configuration name. + * + * @param name the name value to set. + * @return the VirtualMachineNetworkInterfaceConfiguration object itself. + */ + public VirtualMachineNetworkInterfaceConfiguration withName(String name) { + this.name = name; + return this; + } + + /** + * Get the innerProperties property: Describes a virtual machine network profile's IP configuration. + * + * @return the innerProperties value. + */ + private VirtualMachineNetworkInterfaceConfigurationProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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.innerProperties() == null ? null : this.innerProperties().primary(); + } + + /** + * Set the primary property: Specifies the primary network interface in case the virtual machine has more than 1 + * network interface. + * + * @param primary the primary value to set. + * @return the VirtualMachineNetworkInterfaceConfiguration object itself. + */ + public VirtualMachineNetworkInterfaceConfiguration withPrimary(Boolean primary) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineNetworkInterfaceConfigurationProperties(); + } + this.innerProperties().withPrimary(primary); + return this; + } + + /** + * Get the deleteOption property: Specify what happens to the network interface when the VM is deleted. + * + * @return the deleteOption value. + */ + public DeleteOptions deleteOption() { + return this.innerProperties() == null ? null : this.innerProperties().deleteOption(); + } + + /** + * Set the deleteOption property: Specify what happens to the network interface when the VM is deleted. + * + * @param deleteOption the deleteOption value to set. + * @return the VirtualMachineNetworkInterfaceConfiguration object itself. + */ + public VirtualMachineNetworkInterfaceConfiguration withDeleteOption(DeleteOptions deleteOption) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineNetworkInterfaceConfigurationProperties(); + } + this.innerProperties().withDeleteOption(deleteOption); + return this; + } + + /** + * Get the enableAcceleratedNetworking property: Specifies whether the network interface is accelerated + * networking-enabled. + * + * @return the enableAcceleratedNetworking value. + */ + public Boolean enableAcceleratedNetworking() { + return this.innerProperties() == null ? null : this.innerProperties().enableAcceleratedNetworking(); + } + + /** + * Set the enableAcceleratedNetworking property: Specifies whether the network interface is accelerated + * networking-enabled. + * + * @param enableAcceleratedNetworking the enableAcceleratedNetworking value to set. + * @return the VirtualMachineNetworkInterfaceConfiguration object itself. + */ + public VirtualMachineNetworkInterfaceConfiguration withEnableAcceleratedNetworking( + Boolean enableAcceleratedNetworking) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineNetworkInterfaceConfigurationProperties(); + } + this.innerProperties().withEnableAcceleratedNetworking(enableAcceleratedNetworking); + return this; + } + + /** + * Get the disableTcpStateTracking property: Specifies whether the network interface is disabled for tcp state + * tracking. + * + * @return the disableTcpStateTracking value. + */ + public Boolean disableTcpStateTracking() { + return this.innerProperties() == null ? null : this.innerProperties().disableTcpStateTracking(); + } + + /** + * Set the disableTcpStateTracking property: Specifies whether the network interface is disabled for tcp state + * tracking. + * + * @param disableTcpStateTracking the disableTcpStateTracking value to set. + * @return the VirtualMachineNetworkInterfaceConfiguration object itself. + */ + public VirtualMachineNetworkInterfaceConfiguration withDisableTcpStateTracking(Boolean disableTcpStateTracking) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineNetworkInterfaceConfigurationProperties(); + } + this.innerProperties().withDisableTcpStateTracking(disableTcpStateTracking); + return this; + } + + /** + * Get the enableFpga property: Specifies whether the network interface is FPGA networking-enabled. + * + * @return the enableFpga value. + */ + public Boolean enableFpga() { + return this.innerProperties() == null ? null : this.innerProperties().enableFpga(); + } + + /** + * Set the enableFpga property: Specifies whether the network interface is FPGA networking-enabled. + * + * @param enableFpga the enableFpga value to set. + * @return the VirtualMachineNetworkInterfaceConfiguration object itself. + */ + public VirtualMachineNetworkInterfaceConfiguration withEnableFpga(Boolean enableFpga) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineNetworkInterfaceConfigurationProperties(); + } + this.innerProperties().withEnableFpga(enableFpga); + return this; + } + + /** + * Get the enableIpForwarding property: Whether IP forwarding enabled on this NIC. + * + * @return the enableIpForwarding value. + */ + public Boolean enableIpForwarding() { + return this.innerProperties() == null ? null : this.innerProperties().enableIpForwarding(); + } + + /** + * Set the enableIpForwarding property: Whether IP forwarding enabled on this NIC. + * + * @param enableIpForwarding the enableIpForwarding value to set. + * @return the VirtualMachineNetworkInterfaceConfiguration object itself. + */ + public VirtualMachineNetworkInterfaceConfiguration withEnableIpForwarding(Boolean enableIpForwarding) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineNetworkInterfaceConfigurationProperties(); + } + this.innerProperties().withEnableIpForwarding(enableIpForwarding); + return this; + } + + /** + * Get the networkSecurityGroup property: The network security group. + * + * @return the networkSecurityGroup value. + */ + public SubResource networkSecurityGroup() { + return this.innerProperties() == null ? null : this.innerProperties().networkSecurityGroup(); + } + + /** + * Set the networkSecurityGroup property: The network security group. + * + * @param networkSecurityGroup the networkSecurityGroup value to set. + * @return the VirtualMachineNetworkInterfaceConfiguration object itself. + */ + public VirtualMachineNetworkInterfaceConfiguration withNetworkSecurityGroup(SubResource networkSecurityGroup) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineNetworkInterfaceConfigurationProperties(); + } + this.innerProperties().withNetworkSecurityGroup(networkSecurityGroup); + return this; + } + + /** + * Get the dnsSettings property: The dns settings to be applied on the network interfaces. + * + * @return the dnsSettings value. + */ + public VirtualMachineNetworkInterfaceDnsSettingsConfiguration dnsSettings() { + return this.innerProperties() == null ? null : this.innerProperties().dnsSettings(); + } + + /** + * Set the dnsSettings property: The dns settings to be applied on the network interfaces. + * + * @param dnsSettings the dnsSettings value to set. + * @return the VirtualMachineNetworkInterfaceConfiguration object itself. + */ + public VirtualMachineNetworkInterfaceConfiguration withDnsSettings( + VirtualMachineNetworkInterfaceDnsSettingsConfiguration dnsSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineNetworkInterfaceConfigurationProperties(); + } + this.innerProperties().withDnsSettings(dnsSettings); + return this; + } + + /** + * Get the ipConfigurations property: Specifies the IP configurations of the network interface. + * + * @return the ipConfigurations value. + */ + public List ipConfigurations() { + return this.innerProperties() == null ? null : this.innerProperties().ipConfigurations(); + } + + /** + * Set the ipConfigurations property: Specifies the IP configurations of the network interface. + * + * @param ipConfigurations the ipConfigurations value to set. + * @return the VirtualMachineNetworkInterfaceConfiguration object itself. + */ + public VirtualMachineNetworkInterfaceConfiguration withIpConfigurations( + List ipConfigurations) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineNetworkInterfaceConfigurationProperties(); + } + this.innerProperties().withIpConfigurations(ipConfigurations); + return this; + } + + /** + * Get the dscpConfiguration property: The dscpConfiguration property. + * + * @return the dscpConfiguration value. + */ + public SubResource dscpConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().dscpConfiguration(); + } + + /** + * Set the dscpConfiguration property: The dscpConfiguration property. + * + * @param dscpConfiguration the dscpConfiguration value to set. + * @return the VirtualMachineNetworkInterfaceConfiguration object itself. + */ + public VirtualMachineNetworkInterfaceConfiguration withDscpConfiguration(SubResource dscpConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineNetworkInterfaceConfigurationProperties(); + } + this.innerProperties().withDscpConfiguration(dscpConfiguration); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property name in model VirtualMachineNetworkInterfaceConfiguration")); + } + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VirtualMachineNetworkInterfaceConfiguration.class); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineNetworkInterfaceDnsSettingsConfiguration.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineNetworkInterfaceDnsSettingsConfiguration.java new file mode 100644 index 0000000000000..fb12aa4b07b7a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineNetworkInterfaceDnsSettingsConfiguration.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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a virtual machines network configuration's DNS settings. */ +@Fluent +public final class VirtualMachineNetworkInterfaceDnsSettingsConfiguration { + /* + * List of DNS servers IP addresses + */ + @JsonProperty(value = "dnsServers") + private List dnsServers; + + /** Creates an instance of VirtualMachineNetworkInterfaceDnsSettingsConfiguration class. */ + public VirtualMachineNetworkInterfaceDnsSettingsConfiguration() { + } + + /** + * Get the dnsServers property: List of DNS servers IP addresses. + * + * @return the dnsServers value. + */ + public List dnsServers() { + return this.dnsServers; + } + + /** + * Set the dnsServers property: List of DNS servers IP addresses. + * + * @param dnsServers the dnsServers value to set. + * @return the VirtualMachineNetworkInterfaceDnsSettingsConfiguration object itself. + */ + public VirtualMachineNetworkInterfaceDnsSettingsConfiguration withDnsServers(List dnsServers) { + this.dnsServers = dnsServers; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineNetworkInterfaceIpConfiguration.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineNetworkInterfaceIpConfiguration.java new file mode 100644 index 0000000000000..769c5b39545a7 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineNetworkInterfaceIpConfiguration.java @@ -0,0 +1,258 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineNetworkInterfaceIpConfigurationProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a virtual machine network profile's IP configuration. */ +@Fluent +public final class VirtualMachineNetworkInterfaceIpConfiguration { + /* + * The IP configuration name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Describes a virtual machine network interface IP configuration properties. + */ + @JsonProperty(value = "properties") + private VirtualMachineNetworkInterfaceIpConfigurationProperties innerProperties; + + /** Creates an instance of VirtualMachineNetworkInterfaceIpConfiguration class. */ + public VirtualMachineNetworkInterfaceIpConfiguration() { + } + + /** + * Get the name property: The IP configuration name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The IP configuration name. + * + * @param name the name value to set. + * @return the VirtualMachineNetworkInterfaceIpConfiguration object itself. + */ + public VirtualMachineNetworkInterfaceIpConfiguration withName(String name) { + this.name = name; + return this; + } + + /** + * Get the innerProperties property: Describes a virtual machine network interface IP configuration properties. + * + * @return the innerProperties value. + */ + private VirtualMachineNetworkInterfaceIpConfigurationProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the subnet property: Specifies the identifier of the subnet. + * + * @return the subnet value. + */ + public SubResource subnet() { + return this.innerProperties() == null ? null : this.innerProperties().subnet(); + } + + /** + * Set the subnet property: Specifies the identifier of the subnet. + * + * @param subnet the subnet value to set. + * @return the VirtualMachineNetworkInterfaceIpConfiguration object itself. + */ + public VirtualMachineNetworkInterfaceIpConfiguration withSubnet(SubResource subnet) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineNetworkInterfaceIpConfigurationProperties(); + } + this.innerProperties().withSubnet(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.innerProperties() == null ? null : this.innerProperties().primary(); + } + + /** + * Set the primary property: Specifies the primary network interface in case the virtual machine has more than 1 + * network interface. + * + * @param primary the primary value to set. + * @return the VirtualMachineNetworkInterfaceIpConfiguration object itself. + */ + public VirtualMachineNetworkInterfaceIpConfiguration withPrimary(Boolean primary) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineNetworkInterfaceIpConfigurationProperties(); + } + this.innerProperties().withPrimary(primary); + return this; + } + + /** + * Get the publicIpAddressConfiguration property: The publicIPAddressConfiguration. + * + * @return the publicIpAddressConfiguration value. + */ + public VirtualMachinePublicIpAddressConfiguration publicIpAddressConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().publicIpAddressConfiguration(); + } + + /** + * Set the publicIpAddressConfiguration property: The publicIPAddressConfiguration. + * + * @param publicIpAddressConfiguration the publicIpAddressConfiguration value to set. + * @return the VirtualMachineNetworkInterfaceIpConfiguration object itself. + */ + public VirtualMachineNetworkInterfaceIpConfiguration withPublicIpAddressConfiguration( + VirtualMachinePublicIpAddressConfiguration publicIpAddressConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineNetworkInterfaceIpConfigurationProperties(); + } + this.innerProperties().withPublicIpAddressConfiguration(publicIpAddressConfiguration); + return this; + } + + /** + * Get the privateIpAddressVersion property: Available from Api-Version 2017-03-30 onwards, it represents whether + * the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. + * + * @return the privateIpAddressVersion value. + */ + public IpVersions privateIpAddressVersion() { + return this.innerProperties() == null ? null : this.innerProperties().privateIpAddressVersion(); + } + + /** + * Set the privateIpAddressVersion property: Available from Api-Version 2017-03-30 onwards, it represents whether + * the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. + * + * @param privateIpAddressVersion the privateIpAddressVersion value to set. + * @return the VirtualMachineNetworkInterfaceIpConfiguration object itself. + */ + public VirtualMachineNetworkInterfaceIpConfiguration withPrivateIpAddressVersion( + IpVersions privateIpAddressVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineNetworkInterfaceIpConfigurationProperties(); + } + this.innerProperties().withPrivateIpAddressVersion(privateIpAddressVersion); + return this; + } + + /** + * Get the applicationSecurityGroups property: Specifies an array of references to application security group. + * + * @return the applicationSecurityGroups value. + */ + public List applicationSecurityGroups() { + return this.innerProperties() == null ? null : this.innerProperties().applicationSecurityGroups(); + } + + /** + * Set the applicationSecurityGroups property: Specifies an array of references to application security group. + * + * @param applicationSecurityGroups the applicationSecurityGroups value to set. + * @return the VirtualMachineNetworkInterfaceIpConfiguration object itself. + */ + public VirtualMachineNetworkInterfaceIpConfiguration withApplicationSecurityGroups( + List applicationSecurityGroups) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineNetworkInterfaceIpConfigurationProperties(); + } + this.innerProperties().withApplicationSecurityGroups(applicationSecurityGroups); + return this; + } + + /** + * Get the applicationGatewayBackendAddressPools property: Specifies an array of references to backend address pools + * of application gateways. A virtual machine can reference backend address pools of multiple application gateways. + * Multiple virtual machines cannot use the same application gateway. + * + * @return the applicationGatewayBackendAddressPools value. + */ + public List applicationGatewayBackendAddressPools() { + return this.innerProperties() == null ? null : this.innerProperties().applicationGatewayBackendAddressPools(); + } + + /** + * Set the applicationGatewayBackendAddressPools property: Specifies an array of references to backend address pools + * of application gateways. A virtual machine can reference backend address pools of multiple application gateways. + * Multiple virtual machines cannot use the same application gateway. + * + * @param applicationGatewayBackendAddressPools the applicationGatewayBackendAddressPools value to set. + * @return the VirtualMachineNetworkInterfaceIpConfiguration object itself. + */ + public VirtualMachineNetworkInterfaceIpConfiguration withApplicationGatewayBackendAddressPools( + List applicationGatewayBackendAddressPools) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineNetworkInterfaceIpConfigurationProperties(); + } + this.innerProperties().withApplicationGatewayBackendAddressPools(applicationGatewayBackendAddressPools); + return this; + } + + /** + * Get the loadBalancerBackendAddressPools property: Specifies an array of references to backend address pools of + * load balancers. A virtual machine can reference backend address pools of one public and one internal load + * balancer. [Multiple virtual machines cannot use the same basic sku load balancer]. + * + * @return the loadBalancerBackendAddressPools value. + */ + public List loadBalancerBackendAddressPools() { + return this.innerProperties() == null ? null : this.innerProperties().loadBalancerBackendAddressPools(); + } + + /** + * Set the loadBalancerBackendAddressPools property: Specifies an array of references to backend address pools of + * load balancers. A virtual machine can reference backend address pools of one public and one internal load + * balancer. [Multiple virtual machines cannot use the same basic sku load balancer]. + * + * @param loadBalancerBackendAddressPools the loadBalancerBackendAddressPools value to set. + * @return the VirtualMachineNetworkInterfaceIpConfiguration object itself. + */ + public VirtualMachineNetworkInterfaceIpConfiguration withLoadBalancerBackendAddressPools( + List loadBalancerBackendAddressPools) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineNetworkInterfaceIpConfigurationProperties(); + } + this.innerProperties().withLoadBalancerBackendAddressPools(loadBalancerBackendAddressPools); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property name in model VirtualMachineNetworkInterfaceIpConfiguration")); + } + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VirtualMachineNetworkInterfaceIpConfiguration.class); +} 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..07bfb1aaaae16 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachinePatchStatus.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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The status of virtual machine patch operations. */ +@Fluent +public final class VirtualMachinePatchStatus { + /* + * 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; + + /** Creates an instance of VirtualMachinePatchStatus class. */ + public VirtualMachinePatchStatus() { + } + + /** + * 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..24e18e94d31eb --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachinePriorityTypes.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Specifies the priority for a standalone virtual machine or the virtual machines in the scale set. 'Low' enum will be + * deprecated in the future, please use 'Spot' as the enum to deploy Azure Spot VM/VMSS. + */ +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 a new instance of VirtualMachinePriorityTypes value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VirtualMachinePriorityTypes() { + } + + /** + * 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); + } + + /** + * Gets known VirtualMachinePriorityTypes values. + * + * @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/VirtualMachineProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineProperties.java new file mode 100644 index 0000000000000..72d114e75bb34 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineProperties.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.VirtualMachinePropertiesInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of VirtualMachineProperties. */ +public interface VirtualMachineProperties { + /** + * 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. Minimum api-version: + * 2015-06-15. + * + * @return the diagnosticsProfile value. + */ + DiagnosticsProfile diagnosticsProfile(); + + /** + * Gets the availabilitySet property: Specifies information about the availability set that the virtual machine + * should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes + * to maximize availability. For more information about availability sets, see [Availability sets + * overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). For more information on + * Azure planned maintenance, see [Maintenance and updates for Virtual Machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates). Currently, a VM can only be + * added to availability set at creation time. The availability set to which the VM is being added should be under + * the same resource group as the availability set resource. An existing VM cannot be added to an availability set. + * This property cannot exist along with a non-null properties.virtualMachineScaleSet reference. + * + * @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. This property cannot exist + * along with a non-null properties.availabilitySet reference. 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. Minimum api-version: 2018-04-01. + * + * @return the proximityPlacementGroup value. + */ + SubResource proximityPlacementGroup(); + + /** + * Gets the priority property: Specifies the priority for the virtual machine. 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. 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. + * + * @return the evictionPolicy value. + */ + VirtualMachineEvictionPolicyTypes evictionPolicy(); + + /** + * Gets the billingProfile property: Specifies the billing related details of a Azure Spot virtual machine. 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. + * 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. **Note:** User cannot specify both host and hostGroup properties. Minimum api-version: 2020-06-01. + * + * @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). 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. 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' greater than 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. + * + * @return the platformFaultDomain value. + */ + Integer platformFaultDomain(); + + /** + * Gets the scheduledEventsProfile property: Specifies Scheduled Event related configurations. + * + * @return the scheduledEventsProfile value. + */ + ScheduledEventsProfile scheduledEventsProfile(); + + /** + * Gets the userData property: UserData for the VM, which must be base-64 encoded. Customer should not pass any + * secrets in here. Minimum api-version: 2021-03-01. + * + * @return the userData value. + */ + String userData(); + + /** + * Gets the capacityReservation property: Specifies information about the capacity reservation that is used to + * allocate virtual machine. Minimum api-version: 2021-04-01. + * + * @return the capacityReservation value. + */ + CapacityReservationProfile capacityReservation(); + + /** + * Gets the applicationProfile property: Specifies the gallery applications that should be made available to the + * VM/VMSS. + * + * @return the applicationProfile value. + */ + ApplicationProfile applicationProfile(); + + /** + * Gets the timeCreated property: Specifies the time at which the Virtual Machine resource was created. Minimum + * api-version: 2021-11-01. + * + * @return the timeCreated value. + */ + OffsetDateTime timeCreated(); + + /** + * Gets the inner com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachinePropertiesInner object. + * + * @return the inner object. + */ + VirtualMachinePropertiesInner innerModel(); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachinePublicIpAddressConfiguration.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachinePublicIpAddressConfiguration.java new file mode 100644 index 0000000000000..31e3250c34d41 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachinePublicIpAddressConfiguration.java @@ -0,0 +1,274 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.fluent.models.VirtualMachinePublicIpAddressConfigurationProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a virtual machines IP Configuration's PublicIPAddress configuration. */ +@Fluent +public final class VirtualMachinePublicIpAddressConfiguration { + /* + * The publicIP address configuration name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Describes a virtual machines IP Configuration's PublicIPAddress configuration + */ + @JsonProperty(value = "properties") + private VirtualMachinePublicIpAddressConfigurationProperties innerProperties; + + /* + * Describes the public IP Sku. It can only be set with OrchestrationMode as Flexible. + */ + @JsonProperty(value = "sku") + private PublicIpAddressSku sku; + + /** Creates an instance of VirtualMachinePublicIpAddressConfiguration class. */ + public VirtualMachinePublicIpAddressConfiguration() { + } + + /** + * Get the name property: The publicIP address configuration name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The publicIP address configuration name. + * + * @param name the name value to set. + * @return the VirtualMachinePublicIpAddressConfiguration object itself. + */ + public VirtualMachinePublicIpAddressConfiguration withName(String name) { + this.name = name; + return this; + } + + /** + * Get the innerProperties property: Describes a virtual machines IP Configuration's PublicIPAddress configuration. + * + * @return the innerProperties value. + */ + private VirtualMachinePublicIpAddressConfigurationProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the sku property: Describes the public IP Sku. It can only be set with OrchestrationMode as Flexible. + * + * @return the sku value. + */ + public PublicIpAddressSku sku() { + return this.sku; + } + + /** + * Set the sku property: Describes the public IP Sku. It can only be set with OrchestrationMode as Flexible. + * + * @param sku the sku value to set. + * @return the VirtualMachinePublicIpAddressConfiguration object itself. + */ + public VirtualMachinePublicIpAddressConfiguration withSku(PublicIpAddressSku sku) { + this.sku = sku; + return this; + } + + /** + * Get the idleTimeoutInMinutes property: The idle timeout of the public IP address. + * + * @return the idleTimeoutInMinutes value. + */ + public Integer idleTimeoutInMinutes() { + return this.innerProperties() == null ? null : this.innerProperties().idleTimeoutInMinutes(); + } + + /** + * Set the idleTimeoutInMinutes property: The idle timeout of the public IP address. + * + * @param idleTimeoutInMinutes the idleTimeoutInMinutes value to set. + * @return the VirtualMachinePublicIpAddressConfiguration object itself. + */ + public VirtualMachinePublicIpAddressConfiguration withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachinePublicIpAddressConfigurationProperties(); + } + this.innerProperties().withIdleTimeoutInMinutes(idleTimeoutInMinutes); + return this; + } + + /** + * Get the deleteOption property: Specify what happens to the public IP address when the VM is deleted. + * + * @return the deleteOption value. + */ + public DeleteOptions deleteOption() { + return this.innerProperties() == null ? null : this.innerProperties().deleteOption(); + } + + /** + * Set the deleteOption property: Specify what happens to the public IP address when the VM is deleted. + * + * @param deleteOption the deleteOption value to set. + * @return the VirtualMachinePublicIpAddressConfiguration object itself. + */ + public VirtualMachinePublicIpAddressConfiguration withDeleteOption(DeleteOptions deleteOption) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachinePublicIpAddressConfigurationProperties(); + } + this.innerProperties().withDeleteOption(deleteOption); + return this; + } + + /** + * Get the dnsSettings property: The dns settings to be applied on the publicIP addresses . + * + * @return the dnsSettings value. + */ + public VirtualMachinePublicIpAddressDnsSettingsConfiguration dnsSettings() { + return this.innerProperties() == null ? null : this.innerProperties().dnsSettings(); + } + + /** + * Set the dnsSettings property: The dns settings to be applied on the publicIP addresses . + * + * @param dnsSettings the dnsSettings value to set. + * @return the VirtualMachinePublicIpAddressConfiguration object itself. + */ + public VirtualMachinePublicIpAddressConfiguration withDnsSettings( + VirtualMachinePublicIpAddressDnsSettingsConfiguration dnsSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachinePublicIpAddressConfigurationProperties(); + } + this.innerProperties().withDnsSettings(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.innerProperties() == null ? null : this.innerProperties().ipTags(); + } + + /** + * Set the ipTags property: The list of IP tags associated with the public IP address. + * + * @param ipTags the ipTags value to set. + * @return the VirtualMachinePublicIpAddressConfiguration object itself. + */ + public VirtualMachinePublicIpAddressConfiguration withIpTags(List ipTags) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachinePublicIpAddressConfigurationProperties(); + } + this.innerProperties().withIpTags(ipTags); + return this; + } + + /** + * Get the publicIpPrefix property: The PublicIPPrefix from which to allocate publicIP addresses. + * + * @return the publicIpPrefix value. + */ + public SubResource publicIpPrefix() { + return this.innerProperties() == null ? null : this.innerProperties().publicIpPrefix(); + } + + /** + * Set the publicIpPrefix property: The PublicIPPrefix from which to allocate publicIP addresses. + * + * @param publicIpPrefix the publicIpPrefix value to set. + * @return the VirtualMachinePublicIpAddressConfiguration object itself. + */ + public VirtualMachinePublicIpAddressConfiguration withPublicIpPrefix(SubResource publicIpPrefix) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachinePublicIpAddressConfigurationProperties(); + } + this.innerProperties().withPublicIpPrefix(publicIpPrefix); + return this; + } + + /** + * Get the publicIpAddressVersion property: Available from Api-Version 2019-07-01 onwards, it represents whether the + * specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. + * + * @return the publicIpAddressVersion value. + */ + public IpVersions publicIpAddressVersion() { + return this.innerProperties() == null ? null : this.innerProperties().publicIpAddressVersion(); + } + + /** + * Set the publicIpAddressVersion property: Available from Api-Version 2019-07-01 onwards, it represents whether the + * specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. + * + * @param publicIpAddressVersion the publicIpAddressVersion value to set. + * @return the VirtualMachinePublicIpAddressConfiguration object itself. + */ + public VirtualMachinePublicIpAddressConfiguration withPublicIpAddressVersion(IpVersions publicIpAddressVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachinePublicIpAddressConfigurationProperties(); + } + this.innerProperties().withPublicIpAddressVersion(publicIpAddressVersion); + return this; + } + + /** + * Get the publicIpAllocationMethod property: Specify the public IP allocation type. + * + * @return the publicIpAllocationMethod value. + */ + public PublicIpAllocationMethod publicIpAllocationMethod() { + return this.innerProperties() == null ? null : this.innerProperties().publicIpAllocationMethod(); + } + + /** + * Set the publicIpAllocationMethod property: Specify the public IP allocation type. + * + * @param publicIpAllocationMethod the publicIpAllocationMethod value to set. + * @return the VirtualMachinePublicIpAddressConfiguration object itself. + */ + public VirtualMachinePublicIpAddressConfiguration withPublicIpAllocationMethod( + PublicIpAllocationMethod publicIpAllocationMethod) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachinePublicIpAddressConfigurationProperties(); + } + this.innerProperties().withPublicIpAllocationMethod(publicIpAllocationMethod); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property name in model VirtualMachinePublicIpAddressConfiguration")); + } + if (innerProperties() != null) { + innerProperties().validate(); + } + if (sku() != null) { + sku().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VirtualMachinePublicIpAddressConfiguration.class); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachinePublicIpAddressDnsSettingsConfiguration.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachinePublicIpAddressDnsSettingsConfiguration.java new file mode 100644 index 0000000000000..741dc22a3ae0a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachinePublicIpAddressDnsSettingsConfiguration.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.JsonProperty; + +/** Describes a virtual machines network configuration's DNS settings. */ +@Fluent +public final class VirtualMachinePublicIpAddressDnsSettingsConfiguration { + /* + * The Domain name label prefix of the PublicIPAddress resources that will be created. The generated name label is + * the concatenation of the domain name label and vm network profile unique ID. + */ + @JsonProperty(value = "domainNameLabel", required = true) + private String domainNameLabel; + + /** Creates an instance of VirtualMachinePublicIpAddressDnsSettingsConfiguration class. */ + public VirtualMachinePublicIpAddressDnsSettingsConfiguration() { + } + + /** + * Get the domainNameLabel property: The Domain name label prefix of the PublicIPAddress resources that will be + * created. The generated name label is the concatenation of the domain name label and vm network profile unique ID. + * + * @return the domainNameLabel value. + */ + public String domainNameLabel() { + return this.domainNameLabel; + } + + /** + * Set the domainNameLabel property: The Domain name label prefix of the PublicIPAddress resources that will be + * created. The generated name label is the concatenation of the domain name label and vm network profile unique ID. + * + * @param domainNameLabel the domainNameLabel value to set. + * @return the VirtualMachinePublicIpAddressDnsSettingsConfiguration object itself. + */ + public VirtualMachinePublicIpAddressDnsSettingsConfiguration withDomainNameLabel(String domainNameLabel) { + this.domainNameLabel = domainNameLabel; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (domainNameLabel() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property domainNameLabel in model" + + " VirtualMachinePublicIpAddressDnsSettingsConfiguration")); + } + } + + private static final ClientLogger LOGGER = + new ClientLogger(VirtualMachinePublicIpAddressDnsSettingsConfiguration.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..d69713561b094 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineReimageParameters.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.fasterxml.jackson.annotation.JsonProperty; + +/** Parameters for Reimaging Virtual Machine. NOTE: Virtual Machine OS disk will always be reimaged. */ +@Fluent +public class VirtualMachineReimageParameters { + /* + * 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; + + /* + * Specifies in decimal number, the version the OS disk should be reimaged to. If exact version is not provided, + * the OS disk is reimaged to the existing version of OS Disk. + */ + @JsonProperty(value = "exactVersion") + private String exactVersion; + + /* + * Specifies information required for reimaging the non-ephemeral OS disk. + */ + @JsonProperty(value = "osProfile") + private OSProfileProvisioningData osProfile; + + /** Creates an instance of VirtualMachineReimageParameters class. */ + public VirtualMachineReimageParameters() { + } + + /** + * 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; + } + + /** + * Get the exactVersion property: Specifies in decimal number, the version the OS disk should be reimaged to. If + * exact version is not provided, the OS disk is reimaged to the existing version of OS Disk. + * + * @return the exactVersion value. + */ + public String exactVersion() { + return this.exactVersion; + } + + /** + * Set the exactVersion property: Specifies in decimal number, the version the OS disk should be reimaged to. If + * exact version is not provided, the OS disk is reimaged to the existing version of OS Disk. + * + * @param exactVersion the exactVersion value to set. + * @return the VirtualMachineReimageParameters object itself. + */ + public VirtualMachineReimageParameters withExactVersion(String exactVersion) { + this.exactVersion = exactVersion; + return this; + } + + /** + * Get the osProfile property: Specifies information required for reimaging the non-ephemeral OS disk. + * + * @return the osProfile value. + */ + public OSProfileProvisioningData osProfile() { + return this.osProfile; + } + + /** + * Set the osProfile property: Specifies information required for reimaging the non-ephemeral OS disk. + * + * @param osProfile the osProfile value to set. + * @return the VirtualMachineReimageParameters object itself. + */ + public VirtualMachineReimageParameters withOsProfile(OSProfileProvisioningData osProfile) { + this.osProfile = osProfile; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (osProfile() != null) { + osProfile().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..1a7e1645af4ad --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineRunCommand.java @@ -0,0 +1,661 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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. + * Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the + * blob. Refer outputBlobManagedIdentity parameter. + * + * @return the outputBlobUri value. + */ + String outputBlobUri(); + + /** + * Gets the errorBlobUri property: Specifies the Azure storage blob where script error stream will be uploaded. Use + * a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. + * Refer errorBlobManagedIdentity parameter. + * + * @return the errorBlobUri value. + */ + String errorBlobUri(); + + /** + * Gets the outputBlobManagedIdentity property: User-assigned managed identity that has access to outputBlobUri + * storage blob. Use an empty object in case of system-assigned identity. Make sure managed identity has been given + * access to blob's container with 'Storage Blob Data Contributor' role assignment. In case of user-assigned + * identity, make sure you add it under VM's identity. For more info on managed identity and Run Command, refer + * https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. + * + * @return the outputBlobManagedIdentity value. + */ + RunCommandManagedIdentity outputBlobManagedIdentity(); + + /** + * Gets the errorBlobManagedIdentity property: User-assigned managed identity that has access to errorBlobUri + * storage blob. Use an empty object in case of system-assigned identity. Make sure managed identity has been given + * access to blob's container with 'Storage Blob Data Contributor' role assignment. In case of user-assigned + * identity, make sure you add it under VM's identity. For more info on managed identity and Run Command, refer + * https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. + * + * @return the errorBlobManagedIdentity value. + */ + RunCommandManagedIdentity errorBlobManagedIdentity(); + + /** + * Gets the provisioningState property: The provisioning state, which only appears in the response. If + * treatFailureAsDeploymentFailure set to true, any failure in the script will fail the deployment and + * ProvisioningState will be marked as Failed. If treatFailureAsDeploymentFailure set to false, ProvisioningState + * would only reflect whether the run command was run or not by the extensions platform, it would not indicate + * whether script failed in case of script failures. See instance view of run command in case of script failures to + * see executionMessage, output, error: https://aka.ms/runcommandmanaged#get-execution-status-and-results. + * + * @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 treatFailureAsDeploymentFailure property: Optional. If set to true, any failure in the script will fail + * the deployment and ProvisioningState will be marked as Failed. If set to false, ProvisioningState would only + * reflect whether the run command was run or not by the extensions platform, it would not indicate whether script + * failed in case of script failures. See instance view of run command in case of script failures to see + * executionMessage, output, error: https://aka.ms/runcommandmanaged#get-execution-status-and-results. + * + * @return the treatFailureAsDeploymentFailure value. + */ + Boolean treatFailureAsDeploymentFailure(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.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, + DefinitionStages.WithOutputBlobManagedIdentity, + DefinitionStages.WithErrorBlobManagedIdentity, + DefinitionStages.WithTreatFailureAsDeploymentFailure { + /** + * 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. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM + * access to the blob. Refer outputBlobManagedIdentity parameter. . + * + * @param outputBlobUri Specifies the Azure storage blob where script output stream will be uploaded. Use a + * SAS URI with read, append, create, write access OR use managed identity to provide the VM access to + * the blob. Refer outputBlobManagedIdentity parameter. + * @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. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM + * access to the blob. Refer errorBlobManagedIdentity parameter.. + * + * @param errorBlobUri Specifies the Azure storage blob where script error stream will be uploaded. Use a + * SAS URI with read, append, create, write access OR use managed identity to provide the VM access to + * the blob. Refer errorBlobManagedIdentity parameter. + * @return the next definition stage. + */ + WithCreate withErrorBlobUri(String errorBlobUri); + } + /** The stage of the VirtualMachineRunCommand definition allowing to specify outputBlobManagedIdentity. */ + interface WithOutputBlobManagedIdentity { + /** + * Specifies the outputBlobManagedIdentity property: User-assigned managed identity that has access to + * outputBlobUri storage blob. Use an empty object in case of system-assigned identity. Make sure managed + * identity has been given access to blob's container with 'Storage Blob Data Contributor' role assignment. + * In case of user-assigned identity, make sure you add it under VM's identity. For more info on managed + * identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged . + * + * @param outputBlobManagedIdentity User-assigned managed identity that has access to outputBlobUri storage + * blob. Use an empty object in case of system-assigned identity. Make sure managed identity has been + * given access to blob's container with 'Storage Blob Data Contributor' role assignment. In case of + * user-assigned identity, make sure you add it under VM's identity. For more info on managed identity + * and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. + * @return the next definition stage. + */ + WithCreate withOutputBlobManagedIdentity(RunCommandManagedIdentity outputBlobManagedIdentity); + } + /** The stage of the VirtualMachineRunCommand definition allowing to specify errorBlobManagedIdentity. */ + interface WithErrorBlobManagedIdentity { + /** + * Specifies the errorBlobManagedIdentity property: User-assigned managed identity that has access to + * errorBlobUri storage blob. Use an empty object in case of system-assigned identity. Make sure managed + * identity has been given access to blob's container with 'Storage Blob Data Contributor' role assignment. + * In case of user-assigned identity, make sure you add it under VM's identity. For more info on managed + * identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged . + * + * @param errorBlobManagedIdentity User-assigned managed identity that has access to errorBlobUri storage + * blob. Use an empty object in case of system-assigned identity. Make sure managed identity has been + * given access to blob's container with 'Storage Blob Data Contributor' role assignment. In case of + * user-assigned identity, make sure you add it under VM's identity. For more info on managed identity + * and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. + * @return the next definition stage. + */ + WithCreate withErrorBlobManagedIdentity(RunCommandManagedIdentity errorBlobManagedIdentity); + } + /** The stage of the VirtualMachineRunCommand definition allowing to specify treatFailureAsDeploymentFailure. */ + interface WithTreatFailureAsDeploymentFailure { + /** + * Specifies the treatFailureAsDeploymentFailure property: Optional. If set to true, any failure in the + * script will fail the deployment and ProvisioningState will be marked as Failed. If set to false, + * ProvisioningState would only reflect whether the run command was run or not by the extensions platform, + * it would not indicate whether script failed in case of script failures. See instance view of run command + * in case of script failures to see executionMessage, output, error: + * https://aka.ms/runcommandmanaged#get-execution-status-and-results . + * + * @param treatFailureAsDeploymentFailure Optional. If set to true, any failure in the script will fail the + * deployment and ProvisioningState will be marked as Failed. If set to false, ProvisioningState would + * only reflect whether the run command was run or not by the extensions platform, it would not indicate + * whether script failed in case of script failures. See instance view of run command in case of script + * failures to see executionMessage, output, error: + * https://aka.ms/runcommandmanaged#get-execution-status-and-results. + * @return the next definition stage. + */ + WithCreate withTreatFailureAsDeploymentFailure(Boolean treatFailureAsDeploymentFailure); + } + } + /** + * 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, + UpdateStages.WithOutputBlobManagedIdentity, + UpdateStages.WithErrorBlobManagedIdentity, + UpdateStages.WithTreatFailureAsDeploymentFailure { + /** + * 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. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM + * access to the blob. Refer outputBlobManagedIdentity parameter. . + * + * @param outputBlobUri Specifies the Azure storage blob where script output stream will be uploaded. Use a + * SAS URI with read, append, create, write access OR use managed identity to provide the VM access to + * the blob. Refer outputBlobManagedIdentity parameter. + * @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. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM + * access to the blob. Refer errorBlobManagedIdentity parameter.. + * + * @param errorBlobUri Specifies the Azure storage blob where script error stream will be uploaded. Use a + * SAS URI with read, append, create, write access OR use managed identity to provide the VM access to + * the blob. Refer errorBlobManagedIdentity parameter. + * @return the next definition stage. + */ + Update withErrorBlobUri(String errorBlobUri); + } + /** The stage of the VirtualMachineRunCommand update allowing to specify outputBlobManagedIdentity. */ + interface WithOutputBlobManagedIdentity { + /** + * Specifies the outputBlobManagedIdentity property: User-assigned managed identity that has access to + * outputBlobUri storage blob. Use an empty object in case of system-assigned identity. Make sure managed + * identity has been given access to blob's container with 'Storage Blob Data Contributor' role assignment. + * In case of user-assigned identity, make sure you add it under VM's identity. For more info on managed + * identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged . + * + * @param outputBlobManagedIdentity User-assigned managed identity that has access to outputBlobUri storage + * blob. Use an empty object in case of system-assigned identity. Make sure managed identity has been + * given access to blob's container with 'Storage Blob Data Contributor' role assignment. In case of + * user-assigned identity, make sure you add it under VM's identity. For more info on managed identity + * and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. + * @return the next definition stage. + */ + Update withOutputBlobManagedIdentity(RunCommandManagedIdentity outputBlobManagedIdentity); + } + /** The stage of the VirtualMachineRunCommand update allowing to specify errorBlobManagedIdentity. */ + interface WithErrorBlobManagedIdentity { + /** + * Specifies the errorBlobManagedIdentity property: User-assigned managed identity that has access to + * errorBlobUri storage blob. Use an empty object in case of system-assigned identity. Make sure managed + * identity has been given access to blob's container with 'Storage Blob Data Contributor' role assignment. + * In case of user-assigned identity, make sure you add it under VM's identity. For more info on managed + * identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged . + * + * @param errorBlobManagedIdentity User-assigned managed identity that has access to errorBlobUri storage + * blob. Use an empty object in case of system-assigned identity. Make sure managed identity has been + * given access to blob's container with 'Storage Blob Data Contributor' role assignment. In case of + * user-assigned identity, make sure you add it under VM's identity. For more info on managed identity + * and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. + * @return the next definition stage. + */ + Update withErrorBlobManagedIdentity(RunCommandManagedIdentity errorBlobManagedIdentity); + } + /** The stage of the VirtualMachineRunCommand update allowing to specify treatFailureAsDeploymentFailure. */ + interface WithTreatFailureAsDeploymentFailure { + /** + * Specifies the treatFailureAsDeploymentFailure property: Optional. If set to true, any failure in the + * script will fail the deployment and ProvisioningState will be marked as Failed. If set to false, + * ProvisioningState would only reflect whether the run command was run or not by the extensions platform, + * it would not indicate whether script failed in case of script failures. See instance view of run command + * in case of script failures to see executionMessage, output, error: + * https://aka.ms/runcommandmanaged#get-execution-status-and-results . + * + * @param treatFailureAsDeploymentFailure Optional. If set to true, any failure in the script will fail the + * deployment and ProvisioningState will be marked as Failed. If set to false, ProvisioningState would + * only reflect whether the run command was run or not by the extensions platform, it would not indicate + * whether script failed in case of script failures. See instance view of run command in case of script + * failures to see executionMessage, output, error: + * https://aka.ms/runcommandmanaged#get-execution-status-and-results. + * @return the next definition stage. + */ + Update withTreatFailureAsDeploymentFailure(Boolean treatFailureAsDeploymentFailure); + } + } + /** + * 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..24fb8070d0154 --- /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.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 { + /* + * 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; + + /** Creates an instance of VirtualMachineRunCommandInstanceView class. */ + public VirtualMachineRunCommandInstanceView() { + } + + /** + * 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..cd58c653ee032 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineRunCommandScriptSource.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the script sources for run command. Use only one of script, scriptUri, commandId. */ +@Fluent +public final class VirtualMachineRunCommandScriptSource { + /* + * Specifies the script content to be executed on the VM. + */ + @JsonProperty(value = "script") + private String script; + + /* + * Specifies the script download location. It can be either SAS URI of an Azure storage blob with read access or + * public URI. + */ + @JsonProperty(value = "scriptUri") + private String scriptUri; + + /* + * Specifies a commandId of predefined built-in script. + */ + @JsonProperty(value = "commandId") + private String commandId; + + /* + * User-assigned managed identity that has access to scriptUri in case of Azure storage blob. Use an empty object + * in case of system-assigned identity. Make sure the Azure storage blob exists, and managed identity has been + * given access to blob's container with 'Storage Blob Data Reader' role assignment. In case of user-assigned + * identity, make sure you add it under VM's identity. For more info on managed identity and Run Command, refer + * https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. + */ + @JsonProperty(value = "scriptUriManagedIdentity") + private RunCommandManagedIdentity scriptUriManagedIdentity; + + /** Creates an instance of VirtualMachineRunCommandScriptSource class. */ + public VirtualMachineRunCommandScriptSource() { + } + + /** + * 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. It can be either SAS URI of an Azure storage + * blob with read access or public URI. + * + * @return the scriptUri value. + */ + public String scriptUri() { + return this.scriptUri; + } + + /** + * Set the scriptUri property: Specifies the script download location. It can be either SAS URI of an Azure storage + * blob with read access or public URI. + * + * @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; + } + + /** + * Get the scriptUriManagedIdentity property: User-assigned managed identity that has access to scriptUri in case of + * Azure storage blob. Use an empty object in case of system-assigned identity. Make sure the Azure storage blob + * exists, and managed identity has been given access to blob's container with 'Storage Blob Data Reader' role + * assignment. In case of user-assigned identity, make sure you add it under VM's identity. For more info on managed + * identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. + * + * @return the scriptUriManagedIdentity value. + */ + public RunCommandManagedIdentity scriptUriManagedIdentity() { + return this.scriptUriManagedIdentity; + } + + /** + * Set the scriptUriManagedIdentity property: User-assigned managed identity that has access to scriptUri in case of + * Azure storage blob. Use an empty object in case of system-assigned identity. Make sure the Azure storage blob + * exists, and managed identity has been given access to blob's container with 'Storage Blob Data Reader' role + * assignment. In case of user-assigned identity, make sure you add it under VM's identity. For more info on managed + * identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. + * + * @param scriptUriManagedIdentity the scriptUriManagedIdentity value to set. + * @return the VirtualMachineRunCommandScriptSource object itself. + */ + public VirtualMachineRunCommandScriptSource withScriptUriManagedIdentity( + RunCommandManagedIdentity scriptUriManagedIdentity) { + this.scriptUriManagedIdentity = scriptUriManagedIdentity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (scriptUriManagedIdentity() != null) { + scriptUriManagedIdentity().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..692e15bc273ce --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineRunCommandUpdate.java @@ -0,0 +1,389 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineRunCommandProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Describes a Virtual Machine run command. */ +@Fluent +public final class VirtualMachineRunCommandUpdate extends UpdateResource { + /* + * Describes the properties of a Virtual Machine run command. + */ + @JsonProperty(value = "properties") + private VirtualMachineRunCommandProperties innerProperties; + + /** Creates an instance of VirtualMachineRunCommandUpdate class. */ + public VirtualMachineRunCommandUpdate() { + } + + /** + * Get the innerProperties property: Describes the properties of a Virtual Machine run command. + * + * @return the innerProperties value. + */ + private VirtualMachineRunCommandProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public VirtualMachineRunCommandUpdate withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the source property: The source of the run command script. + * + * @return the source value. + */ + public VirtualMachineRunCommandScriptSource source() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineRunCommandProperties(); + } + this.innerProperties().withSource(source); + return this; + } + + /** + * Get the parameters property: The parameters used by the script. + * + * @return the parameters value. + */ + public List parameters() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineRunCommandProperties(); + } + this.innerProperties().withParameters(parameters); + return this; + } + + /** + * Get the protectedParameters property: The parameters used by the script. + * + * @return the protectedParameters value. + */ + public List protectedParameters() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineRunCommandProperties(); + } + this.innerProperties().withProtectedParameters(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineRunCommandProperties(); + } + this.innerProperties().withAsyncExecution(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineRunCommandProperties(); + } + this.innerProperties().withRunAsUser(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineRunCommandProperties(); + } + this.innerProperties().withRunAsPassword(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineRunCommandProperties(); + } + this.innerProperties().withTimeoutInSeconds(timeoutInSeconds); + return this; + } + + /** + * Get the outputBlobUri property: Specifies the Azure storage blob where script output stream will be uploaded. Use + * a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. + * Refer outputBlobManagedIdentity parameter. + * + * @return the outputBlobUri value. + */ + public String outputBlobUri() { + return this.innerProperties() == null ? null : this.innerProperties().outputBlobUri(); + } + + /** + * Set the outputBlobUri property: Specifies the Azure storage blob where script output stream will be uploaded. Use + * a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. + * Refer outputBlobManagedIdentity parameter. + * + * @param outputBlobUri the outputBlobUri value to set. + * @return the VirtualMachineRunCommandUpdate object itself. + */ + public VirtualMachineRunCommandUpdate withOutputBlobUri(String outputBlobUri) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineRunCommandProperties(); + } + this.innerProperties().withOutputBlobUri(outputBlobUri); + return this; + } + + /** + * Get the errorBlobUri property: Specifies the Azure storage blob where script error stream will be uploaded. Use a + * SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. + * Refer errorBlobManagedIdentity parameter. + * + * @return the errorBlobUri value. + */ + public String errorBlobUri() { + return this.innerProperties() == null ? null : this.innerProperties().errorBlobUri(); + } + + /** + * Set the errorBlobUri property: Specifies the Azure storage blob where script error stream will be uploaded. Use a + * SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. + * Refer errorBlobManagedIdentity parameter. + * + * @param errorBlobUri the errorBlobUri value to set. + * @return the VirtualMachineRunCommandUpdate object itself. + */ + public VirtualMachineRunCommandUpdate withErrorBlobUri(String errorBlobUri) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineRunCommandProperties(); + } + this.innerProperties().withErrorBlobUri(errorBlobUri); + return this; + } + + /** + * Get the outputBlobManagedIdentity property: User-assigned managed identity that has access to outputBlobUri + * storage blob. Use an empty object in case of system-assigned identity. Make sure managed identity has been given + * access to blob's container with 'Storage Blob Data Contributor' role assignment. In case of user-assigned + * identity, make sure you add it under VM's identity. For more info on managed identity and Run Command, refer + * https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. + * + * @return the outputBlobManagedIdentity value. + */ + public RunCommandManagedIdentity outputBlobManagedIdentity() { + return this.innerProperties() == null ? null : this.innerProperties().outputBlobManagedIdentity(); + } + + /** + * Set the outputBlobManagedIdentity property: User-assigned managed identity that has access to outputBlobUri + * storage blob. Use an empty object in case of system-assigned identity. Make sure managed identity has been given + * access to blob's container with 'Storage Blob Data Contributor' role assignment. In case of user-assigned + * identity, make sure you add it under VM's identity. For more info on managed identity and Run Command, refer + * https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. + * + * @param outputBlobManagedIdentity the outputBlobManagedIdentity value to set. + * @return the VirtualMachineRunCommandUpdate object itself. + */ + public VirtualMachineRunCommandUpdate withOutputBlobManagedIdentity( + RunCommandManagedIdentity outputBlobManagedIdentity) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineRunCommandProperties(); + } + this.innerProperties().withOutputBlobManagedIdentity(outputBlobManagedIdentity); + return this; + } + + /** + * Get the errorBlobManagedIdentity property: User-assigned managed identity that has access to errorBlobUri storage + * blob. Use an empty object in case of system-assigned identity. Make sure managed identity has been given access + * to blob's container with 'Storage Blob Data Contributor' role assignment. In case of user-assigned identity, make + * sure you add it under VM's identity. For more info on managed identity and Run Command, refer + * https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. + * + * @return the errorBlobManagedIdentity value. + */ + public RunCommandManagedIdentity errorBlobManagedIdentity() { + return this.innerProperties() == null ? null : this.innerProperties().errorBlobManagedIdentity(); + } + + /** + * Set the errorBlobManagedIdentity property: User-assigned managed identity that has access to errorBlobUri storage + * blob. Use an empty object in case of system-assigned identity. Make sure managed identity has been given access + * to blob's container with 'Storage Blob Data Contributor' role assignment. In case of user-assigned identity, make + * sure you add it under VM's identity. For more info on managed identity and Run Command, refer + * https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. + * + * @param errorBlobManagedIdentity the errorBlobManagedIdentity value to set. + * @return the VirtualMachineRunCommandUpdate object itself. + */ + public VirtualMachineRunCommandUpdate withErrorBlobManagedIdentity( + RunCommandManagedIdentity errorBlobManagedIdentity) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineRunCommandProperties(); + } + this.innerProperties().withErrorBlobManagedIdentity(errorBlobManagedIdentity); + return this; + } + + /** + * Get the provisioningState property: The provisioning state, which only appears in the response. If + * treatFailureAsDeploymentFailure set to true, any failure in the script will fail the deployment and + * ProvisioningState will be marked as Failed. If treatFailureAsDeploymentFailure set to false, ProvisioningState + * would only reflect whether the run command was run or not by the extensions platform, it would not indicate + * whether script failed in case of script failures. See instance view of run command in case of script failures to + * see executionMessage, output, error: https://aka.ms/runcommandmanaged#get-execution-status-and-results. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the instanceView property: The virtual machine run command instance view. + * + * @return the instanceView value. + */ + public VirtualMachineRunCommandInstanceView instanceView() { + return this.innerProperties() == null ? null : this.innerProperties().instanceView(); + } + + /** + * Get the treatFailureAsDeploymentFailure property: Optional. If set to true, any failure in the script will fail + * the deployment and ProvisioningState will be marked as Failed. If set to false, ProvisioningState would only + * reflect whether the run command was run or not by the extensions platform, it would not indicate whether script + * failed in case of script failures. See instance view of run command in case of script failures to see + * executionMessage, output, error: https://aka.ms/runcommandmanaged#get-execution-status-and-results. + * + * @return the treatFailureAsDeploymentFailure value. + */ + public Boolean treatFailureAsDeploymentFailure() { + return this.innerProperties() == null ? null : this.innerProperties().treatFailureAsDeploymentFailure(); + } + + /** + * Set the treatFailureAsDeploymentFailure property: Optional. If set to true, any failure in the script will fail + * the deployment and ProvisioningState will be marked as Failed. If set to false, ProvisioningState would only + * reflect whether the run command was run or not by the extensions platform, it would not indicate whether script + * failed in case of script failures. See instance view of run command in case of script failures to see + * executionMessage, output, error: https://aka.ms/runcommandmanaged#get-execution-status-and-results. + * + * @param treatFailureAsDeploymentFailure the treatFailureAsDeploymentFailure value to set. + * @return the VirtualMachineRunCommandUpdate object itself. + */ + public VirtualMachineRunCommandUpdate withTreatFailureAsDeploymentFailure(Boolean treatFailureAsDeploymentFailure) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineRunCommandProperties(); + } + this.innerProperties().withTreatFailureAsDeploymentFailure(treatFailureAsDeploymentFailure); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().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..6ba2dcdf9dec3 --- /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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + Response getWithResponse(String location, String commandId, 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); + + /** + * 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. + * @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 along with {@link Response}. + */ + Response getByVirtualMachineWithResponse( + String resourceGroupName, String vmName, String runCommandName, String expand, 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 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..baf1746546303 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineRunCommandsListResult.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.VirtualMachineRunCommandInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List run command operation response. */ +@Fluent +public final class VirtualMachineRunCommandsListResult { + /* + * 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; + + /** Creates an instance of VirtualMachineRunCommandsListResult class. */ + public VirtualMachineRunCommandsListResult() { + } + + /** + * 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()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VirtualMachineRunCommandsListResult.class); +} 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..a45718b2247f6 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSet.java @@ -0,0 +1,1149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetInner; +import java.time.OffsetDateTime; +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. zoneBalance property can only be set if the zones property of the scale set contains more + * than one zone. If there are no zones or only one zone specified, then zoneBalance property should not be set. + * + * @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. 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. 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 policies applied when scaling in Virtual Machines in the Virtual + * Machine Scale Set. + * + * @return the scaleInPolicy value. + */ + ScaleInPolicy scaleInPolicy(); + + /** + * Gets the orchestrationMode property: Specifies the orchestration mode for the virtual machine scale set. + * + * @return the orchestrationMode value. + */ + OrchestrationMode orchestrationMode(); + + /** + * Gets the spotRestorePolicy property: Specifies the Spot Restore properties for the virtual machine scale set. + * + * @return the spotRestorePolicy value. + */ + SpotRestorePolicy spotRestorePolicy(); + + /** + * Gets the priorityMixPolicy property: Specifies the desired targets for mixing Spot and Regular priority VMs + * within the same VMSS Flex instance. + * + * @return the priorityMixPolicy value. + */ + PriorityMixPolicy priorityMixPolicy(); + + /** + * Gets the timeCreated property: Specifies the time at which the Virtual Machine Scale Set resource was created. + * Minimum api-version: 2021-11-01. + * + * @return the timeCreated value. + */ + OffsetDateTime timeCreated(); + + /** + * Gets the constrainedMaximumCapacity property: Optional property which must either be set to True or omitted. + * + * @return the constrainedMaximumCapacity value. + */ + Boolean constrainedMaximumCapacity(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetInner object. + * + * @return the inner object. + */ + VirtualMachineScaleSetInner innerModel(); + + /** The entirety of the VirtualMachineScaleSet definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The VirtualMachineScaleSet definition stages. */ + interface DefinitionStages { + /** The first stage of the VirtualMachineScaleSet definition. */ + interface Blank extends WithLocation { + } + /** The stage of the VirtualMachineScaleSet definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the VirtualMachineScaleSet definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the VirtualMachineScaleSet definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithSku, + DefinitionStages.WithPlan, + DefinitionStages.WithIdentity, + DefinitionStages.WithZones, + DefinitionStages.WithExtendedLocation, + DefinitionStages.WithUpgradePolicy, + DefinitionStages.WithAutomaticRepairsPolicy, + DefinitionStages.WithVirtualMachineProfile, + DefinitionStages.WithOverprovision, + DefinitionStages.WithDoNotRunExtensionsOnOverprovisionedVMs, + DefinitionStages.WithSinglePlacementGroup, + DefinitionStages.WithZoneBalance, + DefinitionStages.WithPlatformFaultDomainCount, + DefinitionStages.WithProximityPlacementGroup, + DefinitionStages.WithHostGroup, + DefinitionStages.WithAdditionalCapabilities, + DefinitionStages.WithScaleInPolicy, + DefinitionStages.WithOrchestrationMode, + DefinitionStages.WithSpotRestorePolicy, + DefinitionStages.WithPriorityMixPolicy, + DefinitionStages.WithConstrainedMaximumCapacity { + /** + * 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. zoneBalance property can only be set if the zones property of the + * scale set contains more than one zone. If there are no zones or only one zone specified, then zoneBalance + * property should not be set.. + * + * @param zoneBalance Whether to force strictly even Virtual Machine distribution cross x-zones in case + * there is zone outage. zoneBalance property can only be set if the zones property of the scale set + * contains more than one zone. If there are no zones or only one zone specified, then zoneBalance + * property should not be set. + * @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. 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. 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. Minimum api-version: 2020-06-01.. + * + * @param hostGroup Specifies information about the dedicated host group that the virtual machine scale set + * resides in. 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 policies applied when scaling in Virtual Machines in + * the Virtual Machine Scale Set.. + * + * @param scaleInPolicy Specifies the policies applied when scaling in Virtual Machines in the Virtual + * Machine Scale Set. + * @return the next definition stage. + */ + WithCreate withScaleInPolicy(ScaleInPolicy scaleInPolicy); + } + /** The stage of the VirtualMachineScaleSet definition allowing to specify orchestrationMode. */ + interface WithOrchestrationMode { + /** + * Specifies the orchestrationMode property: Specifies the orchestration mode for the virtual machine scale + * set.. + * + * @param orchestrationMode Specifies the orchestration mode for the virtual machine scale set. + * @return the next definition stage. + */ + WithCreate withOrchestrationMode(OrchestrationMode orchestrationMode); + } + /** The stage of the VirtualMachineScaleSet definition allowing to specify spotRestorePolicy. */ + interface WithSpotRestorePolicy { + /** + * Specifies the spotRestorePolicy property: Specifies the Spot Restore properties for the virtual machine + * scale set.. + * + * @param spotRestorePolicy Specifies the Spot Restore properties for the virtual machine scale set. + * @return the next definition stage. + */ + WithCreate withSpotRestorePolicy(SpotRestorePolicy spotRestorePolicy); + } + /** The stage of the VirtualMachineScaleSet definition allowing to specify priorityMixPolicy. */ + interface WithPriorityMixPolicy { + /** + * Specifies the priorityMixPolicy property: Specifies the desired targets for mixing Spot and Regular + * priority VMs within the same VMSS Flex instance.. + * + * @param priorityMixPolicy Specifies the desired targets for mixing Spot and Regular priority VMs within + * the same VMSS Flex instance. + * @return the next definition stage. + */ + WithCreate withPriorityMixPolicy(PriorityMixPolicy priorityMixPolicy); + } + /** The stage of the VirtualMachineScaleSet definition allowing to specify constrainedMaximumCapacity. */ + interface WithConstrainedMaximumCapacity { + /** + * Specifies the constrainedMaximumCapacity property: Optional property which must either be set to True or + * omitted.. + * + * @param constrainedMaximumCapacity Optional property which must either be set to True or omitted. + * @return the next definition stage. + */ + WithCreate withConstrainedMaximumCapacity(Boolean constrainedMaximumCapacity); + } + } + /** + * 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, + UpdateStages.WithPriorityMixPolicy, + UpdateStages.WithSpotRestorePolicy { + /** + * 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 policies applied when scaling in Virtual Machines in + * the Virtual Machine Scale Set.. + * + * @param scaleInPolicy Specifies the policies applied when scaling in Virtual Machines in the Virtual + * Machine Scale Set. + * @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); + } + /** The stage of the VirtualMachineScaleSet update allowing to specify priorityMixPolicy. */ + interface WithPriorityMixPolicy { + /** + * Specifies the priorityMixPolicy property: Specifies the desired targets for mixing Spot and Regular + * priority VMs within the same VMSS Flex instance.. + * + * @param priorityMixPolicy Specifies the desired targets for mixing Spot and Regular priority VMs within + * the same VMSS Flex instance. + * @return the next definition stage. + */ + Update withPriorityMixPolicy(PriorityMixPolicy priorityMixPolicy); + } + /** The stage of the VirtualMachineScaleSet update allowing to specify spotRestorePolicy. */ + interface WithSpotRestorePolicy { + /** + * Specifies the spotRestorePolicy property: Specifies the Spot Restore properties for the virtual machine + * scale set.. + * + * @param spotRestorePolicy Specifies the Spot Restore properties for the virtual machine scale set. + * @return the next definition stage. + */ + Update withSpotRestorePolicy(SpotRestorePolicy spotRestorePolicy); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + VirtualMachineScaleSet refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + VirtualMachineScaleSet refresh(Context context); + + /** + * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute + * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. + * + * @throws com.azure.resourcemanager.compute.generated.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 deallocate(); + + /** + * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute + * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. + * + * @param hibernate Optional parameter to hibernate a virtual machine from the VM scale set. (This feature is + * available for VMSS with Flexible OrchestrationMode only). + * @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.resourcemanager.compute.generated.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 deallocate(Boolean hibernate, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, Context context); + + /** + * Deletes virtual machines in a VM scale set. + * + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteInstances(VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs); + + /** + * Deletes virtual machines in a VM scale set. + * + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param forceDeletion Optional parameter to force delete virtual machines from the VM scale set. (Feature in + * Preview). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteInstances( + VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs, Boolean forceDeletion, Context context); + + /** + * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you + * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void powerOff(); + + /** + * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you + * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * specified. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void powerOff(Boolean skipShutdown, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, Context context); + + /** + * Restarts one or more virtual machines in a VM scale set. + * + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void restart(); + + /** + * Restarts one or more virtual machines in a VM scale set. + * + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void restart(VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, Context context); + + /** + * Starts one or more virtual machines in a VM scale set. + * + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(); + + /** + * Starts one or more virtual machines in a VM scale set. + * + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, Context context); + + /** + * Reapplies the Virtual Machine Scale Set Virtual Machine Profile to the Virtual Machine Instances. + * + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void reapply(); + + /** + * Reapplies the Virtual Machine Scale Set Virtual Machine Profile to the Virtual Machine Instances. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void reapply(Context context); + + /** + * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them + * back on. + * + * @throws com.azure.resourcemanager.compute.generated.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 redeploy(); + + /** + * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them + * back on. + * + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.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 redeploy(VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, Context context); + + /** + * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not + * eligible for perform maintenance will be failed. Please refer to best practices for more details: + * https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. + * + * @throws com.azure.resourcemanager.compute.generated.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 performMaintenance(); + + /** + * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not + * eligible for perform maintenance will be failed. Please refer to best practices for more details: + * https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. + * + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.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 performMaintenance(VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, Context context); + + /** + * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. + * + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.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 updateInstances(VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs); + + /** + * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. + * + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.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 updateInstances(VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs, Context context); + + /** + * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a + * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial + * state. + * + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void reimage(); + + /** + * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a + * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial + * state. + * + * @param vmScaleSetReimageInput Parameters for Reimaging VM ScaleSet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void reimage(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. + * + * @throws com.azure.resourcemanager.compute.generated.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 reimageAll(); + + /** + * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only + * supported for managed disks. + * + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.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 reimageAll(VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, Context context); + + /** + * Converts SinglePlacementGroup property to false for a existing virtual machine scale set. + * + * @param parameters The input object for ConvertToSinglePlacementGroup API. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response convertToSinglePlacementGroupWithResponse( + VMScaleSetConvertToSinglePlacementGroupInput parameters, Context context); + + /** + * Converts SinglePlacementGroup property to false for a existing virtual machine scale set. + * + * @param parameters The input object for ConvertToSinglePlacementGroup API. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.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 convertToSinglePlacementGroup(VMScaleSetConvertToSinglePlacementGroupInput parameters); + + /** + * Changes ServiceState property for a given service. + * + * @param parameters The input object for SetOrchestrationServiceState API. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.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 setOrchestrationServiceState(OrchestrationServiceStateInput parameters); + + /** + * Changes ServiceState property for a given service. + * + * @param parameters The input object for SetOrchestrationServiceState API. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.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 setOrchestrationServiceState(OrchestrationServiceStateInput parameters, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetDataDisk.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetDataDisk.java new file mode 100644 index 0000000000000..4c4af23d2851c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetDataDisk.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.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a virtual machine scale set data disk. */ +@Fluent +public final class VirtualMachineScaleSetDataDisk { + /* + * 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.** The default + * values are: **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. The property diskSizeGB is the number of bytes x 1024^3 for the disk and the + * value cannot be larger than 1023. + */ + @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; + + /* + * Specifies whether data disk should be deleted or detached upon VMSS Flex deletion (This feature is available for + * VMSS with Flexible OrchestrationMode only).

Possible values:

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

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

The default value is set to **Delete**. + */ + @JsonProperty(value = "deleteOption") + private DiskDeleteOptionTypes deleteOption; + + /** Creates an instance of VirtualMachineScaleSetDataDisk class. */ + public VirtualMachineScaleSetDataDisk() { + } + + /** + * 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. Possible values are: **None,** **ReadOnly,** + * **ReadWrite.** The default values are: **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. Possible values are: **None,** **ReadOnly,** + * **ReadWrite.** The default values are: **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. The property diskSizeGB is the number of bytes x + * 1024^3 for the disk and the value cannot be larger than 1023. + * + * @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. The property diskSizeGB is the number of bytes x + * 1024^3 for the disk and the value cannot be larger than 1023. + * + * @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; + } + + /** + * Get the deleteOption property: Specifies whether data disk should be deleted or detached upon VMSS Flex deletion + * (This feature is available for VMSS with Flexible OrchestrationMode only).<br><br> Possible values: + * <br><br> **Delete** If this value is used, the data disk is deleted when the VMSS Flex VM is + * deleted.<br><br> **Detach** If this value is used, the data disk is retained after VMSS Flex VM is + * deleted.<br><br> The default value is set to **Delete**. + * + * @return the deleteOption value. + */ + public DiskDeleteOptionTypes deleteOption() { + return this.deleteOption; + } + + /** + * Set the deleteOption property: Specifies whether data disk should be deleted or detached upon VMSS Flex deletion + * (This feature is available for VMSS with Flexible OrchestrationMode only).<br><br> Possible values: + * <br><br> **Delete** If this value is used, the data disk is deleted when the VMSS Flex VM is + * deleted.<br><br> **Detach** If this value is used, the data disk is retained after VMSS Flex VM is + * deleted.<br><br> The default value is set to **Delete**. + * + * @param deleteOption the deleteOption value to set. + * @return the VirtualMachineScaleSetDataDisk object itself. + */ + public VirtualMachineScaleSetDataDisk withDeleteOption(DiskDeleteOptionTypes deleteOption) { + this.deleteOption = deleteOption; + 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(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VirtualMachineScaleSetDataDisk.class); +} 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..f764d35820317 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetExtension.java @@ -0,0 +1,520 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 suppressFailures property: Indicates whether failures stemming from the extension will be suppressed + * (Operational failures such as not connecting to the VM will not be suppressed regardless of this value). The + * default is false. + * + * @return the suppressFailures value. + */ + Boolean suppressFailures(); + + /** + * Gets the protectedSettingsFromKeyVault property: The extensions protected settings that are passed by reference, + * and consumed from key vault. + * + * @return the protectedSettingsFromKeyVault value. + */ + KeyVaultSecretReference protectedSettingsFromKeyVault(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * 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, + DefinitionStages.WithSuppressFailures, + DefinitionStages.WithProtectedSettingsFromKeyVault { + /** + * 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); + } + /** The stage of the VirtualMachineScaleSetExtension definition allowing to specify suppressFailures. */ + interface WithSuppressFailures { + /** + * Specifies the suppressFailures property: Indicates whether failures stemming from the extension will be + * suppressed (Operational failures such as not connecting to the VM will not be suppressed regardless of + * this value). The default is false.. + * + * @param suppressFailures Indicates whether failures stemming from the extension will be suppressed + * (Operational failures such as not connecting to the VM will not be suppressed regardless of this + * value). The default is false. + * @return the next definition stage. + */ + WithCreate withSuppressFailures(Boolean suppressFailures); + } + /** + * The stage of the VirtualMachineScaleSetExtension definition allowing to specify + * protectedSettingsFromKeyVault. + */ + interface WithProtectedSettingsFromKeyVault { + /** + * Specifies the protectedSettingsFromKeyVault property: The extensions protected settings that are passed + * by reference, and consumed from key vault. + * + * @param protectedSettingsFromKeyVault The extensions protected settings that are passed by reference, and + * consumed from key vault. + * @return the next definition stage. + */ + WithCreate withProtectedSettingsFromKeyVault(KeyVaultSecretReference protectedSettingsFromKeyVault); + } + } + /** + * 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, + UpdateStages.WithSuppressFailures, + UpdateStages.WithProtectedSettingsFromKeyVault { + /** + * 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); + } + /** The stage of the VirtualMachineScaleSetExtension update allowing to specify suppressFailures. */ + interface WithSuppressFailures { + /** + * Specifies the suppressFailures property: Indicates whether failures stemming from the extension will be + * suppressed (Operational failures such as not connecting to the VM will not be suppressed regardless of + * this value). The default is false.. + * + * @param suppressFailures Indicates whether failures stemming from the extension will be suppressed + * (Operational failures such as not connecting to the VM will not be suppressed regardless of this + * value). The default is false. + * @return the next definition stage. + */ + Update withSuppressFailures(Boolean suppressFailures); + } + /** + * The stage of the VirtualMachineScaleSetExtension update allowing to specify protectedSettingsFromKeyVault. + */ + interface WithProtectedSettingsFromKeyVault { + /** + * Specifies the protectedSettingsFromKeyVault property: The extensions protected settings that are passed + * by reference, and consumed from key vault. + * + * @param protectedSettingsFromKeyVault The extensions protected settings that are passed by reference, and + * consumed from key vault. + * @return the next definition stage. + */ + Update withProtectedSettingsFromKeyVault(KeyVaultSecretReference protectedSettingsFromKeyVault); + } + } + /** + * 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..87e583177b966 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetExtensionListResult.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.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetExtensionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List VM scale set extension operation response. */ +@Fluent +public final class VirtualMachineScaleSetExtensionListResult { + /* + * 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; + + /** Creates an instance of VirtualMachineScaleSetExtensionListResult class. */ + public VirtualMachineScaleSetExtensionListResult() { + } + + /** + * 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()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VirtualMachineScaleSetExtensionListResult.class); +} 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..8a2ea62461785 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetExtensionProfile.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.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetExtensionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a virtual machine scale set extension profile. */ +@Fluent +public final class VirtualMachineScaleSetExtensionProfile { + /* + * 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; + + /** Creates an instance of VirtualMachineScaleSetExtensionProfile class. */ + public VirtualMachineScaleSetExtensionProfile() { + } + + /** + * 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). 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). 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..73eed11e6c4e3 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetExtensionUpdate.java @@ -0,0 +1,357 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetExtensionProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a Virtual Machine Scale Set Extension. */ +@Fluent +public final class VirtualMachineScaleSetExtensionUpdate extends SubResourceReadOnly { + /* + * 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; + + /* + * Describes the properties of a Virtual Machine Scale Set Extension. + */ + @JsonProperty(value = "properties") + private VirtualMachineScaleSetExtensionProperties innerProperties; + + /** Creates an instance of VirtualMachineScaleSetExtensionUpdate class. */ + public VirtualMachineScaleSetExtensionUpdate() { + } + + /** + * 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 innerProperties property: Describes the properties of a Virtual Machine Scale Set Extension. + * + * @return the innerProperties value. + */ + private VirtualMachineScaleSetExtensionProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetExtensionProperties(); + } + this.innerProperties().withForceUpdateTag(forceUpdateTag); + return this; + } + + /** + * Get the publisher property: The name of the extension handler publisher. + * + * @return the publisher value. + */ + public String publisher() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetExtensionProperties(); + } + this.innerProperties().withPublisher(publisher); + return this; + } + + /** + * Get the type property: Specifies the type of the extension; an example is "CustomScriptExtension". + * + * @return the type value. + */ + public String typePropertiesType() { + return this.innerProperties() == null ? null : this.innerProperties().type(); + } + + /** + * Set the type property: Specifies the type of the extension; an example is "CustomScriptExtension". + * + * @param type the type value to set. + * @return the VirtualMachineScaleSetExtensionUpdate object itself. + */ + public VirtualMachineScaleSetExtensionUpdate withTypePropertiesType(String type) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetExtensionProperties(); + } + this.innerProperties().withType(type); + return this; + } + + /** + * Get the typeHandlerVersion property: Specifies the version of the script handler. + * + * @return the typeHandlerVersion value. + */ + public String typeHandlerVersion() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetExtensionProperties(); + } + this.innerProperties().withTypeHandlerVersion(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetExtensionProperties(); + } + this.innerProperties().withAutoUpgradeMinorVersion(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetExtensionProperties(); + } + this.innerProperties().withEnableAutomaticUpgrade(enableAutomaticUpgrade); + return this; + } + + /** + * Get the settings property: Json formatted public settings for the extension. + * + * @return the settings value. + */ + public Object settings() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetExtensionProperties(); + } + this.innerProperties().withSettings(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetExtensionProperties(); + } + this.innerProperties().withProtectedSettings(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.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetExtensionProperties(); + } + this.innerProperties().withProvisionAfterExtensions(provisionAfterExtensions); + return this; + } + + /** + * Get the suppressFailures property: Indicates whether failures stemming from the extension will be suppressed + * (Operational failures such as not connecting to the VM will not be suppressed regardless of this value). The + * default is false. + * + * @return the suppressFailures value. + */ + public Boolean suppressFailures() { + return this.innerProperties() == null ? null : this.innerProperties().suppressFailures(); + } + + /** + * Set the suppressFailures property: Indicates whether failures stemming from the extension will be suppressed + * (Operational failures such as not connecting to the VM will not be suppressed regardless of this value). The + * default is false. + * + * @param suppressFailures the suppressFailures value to set. + * @return the VirtualMachineScaleSetExtensionUpdate object itself. + */ + public VirtualMachineScaleSetExtensionUpdate withSuppressFailures(Boolean suppressFailures) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetExtensionProperties(); + } + this.innerProperties().withSuppressFailures(suppressFailures); + return this; + } + + /** + * Get the protectedSettingsFromKeyVault property: The extensions protected settings that are passed by reference, + * and consumed from key vault. + * + * @return the protectedSettingsFromKeyVault value. + */ + public KeyVaultSecretReference protectedSettingsFromKeyVault() { + return this.innerProperties() == null ? null : this.innerProperties().protectedSettingsFromKeyVault(); + } + + /** + * Set the protectedSettingsFromKeyVault property: The extensions protected settings that are passed by reference, + * and consumed from key vault. + * + * @param protectedSettingsFromKeyVault the protectedSettingsFromKeyVault value to set. + * @return the VirtualMachineScaleSetExtensionUpdate object itself. + */ + public VirtualMachineScaleSetExtensionUpdate withProtectedSettingsFromKeyVault( + KeyVaultSecretReference protectedSettingsFromKeyVault) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetExtensionProperties(); + } + this.innerProperties().withProtectedSettingsFromKeyVault(protectedSettingsFromKeyVault); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().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..b23701dc47f14 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetExtensions.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.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.resourcemanager.compute.generated.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 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.resourcemanager.compute.generated.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 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. + * @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 Scale Set Extension along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String vmScaleSetName, String vmssExtensionName, String expand, 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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); + + /** + * 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.resourcemanager.compute.generated.models.ApiErrorException thrown if 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 as paginated response with {@link PagedIterable}. + */ + 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.resourcemanager.compute.generated.models.ApiErrorException thrown if 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 as paginated response with {@link PagedIterable}. + */ + 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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 along with {@link Response}. + */ + 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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 along with {@link Response}. + */ + 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.resourcemanager.compute.generated.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 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 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/VirtualMachineScaleSetHardwareProfile.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetHardwareProfile.java new file mode 100644 index 0000000000000..aef70b89a3866 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetHardwareProfile.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.fasterxml.jackson.annotation.JsonProperty; + +/** Specifies the hardware settings for the virtual machine scale set. */ +@Fluent +public final class VirtualMachineScaleSetHardwareProfile { + /* + * Specifies the properties for customizing the size of the virtual machine. Minimum api-version: 2021-11-01. + * Please follow the instructions in [VM Customization](https://aka.ms/vmcustomization) for more details. + */ + @JsonProperty(value = "vmSizeProperties") + private VMSizeProperties vmSizeProperties; + + /** Creates an instance of VirtualMachineScaleSetHardwareProfile class. */ + public VirtualMachineScaleSetHardwareProfile() { + } + + /** + * Get the vmSizeProperties property: Specifies the properties for customizing the size of the virtual machine. + * Minimum api-version: 2021-11-01. Please follow the instructions in [VM + * Customization](https://aka.ms/vmcustomization) for more details. + * + * @return the vmSizeProperties value. + */ + public VMSizeProperties vmSizeProperties() { + return this.vmSizeProperties; + } + + /** + * Set the vmSizeProperties property: Specifies the properties for customizing the size of the virtual machine. + * Minimum api-version: 2021-11-01. Please follow the instructions in [VM + * Customization](https://aka.ms/vmcustomization) for more details. + * + * @param vmSizeProperties the vmSizeProperties value to set. + * @return the VirtualMachineScaleSetHardwareProfile object itself. + */ + public VirtualMachineScaleSetHardwareProfile withVmSizeProperties(VMSizeProperties vmSizeProperties) { + this.vmSizeProperties = vmSizeProperties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (vmSizeProperties() != null) { + vmSizeProperties().validate(); + } + } +} 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..ac9a661dfa591 --- /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.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Identity for the virtual machine scale set. */ +@Fluent +public final class VirtualMachineScaleSetIdentity { + /* + * 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") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map userAssignedIdentities; + + /** Creates an instance of VirtualMachineScaleSetIdentity class. */ + public VirtualMachineScaleSetIdentity() { + } + + /** + * 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/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..2c7e7aaccffab --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetInstanceViewStatusesSummary.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.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 { + /* + * The extensions information. + */ + @JsonProperty(value = "statusesSummary", access = JsonProperty.Access.WRITE_ONLY) + private List statusesSummary; + + /** Creates an instance of VirtualMachineScaleSetInstanceViewStatusesSummary class. */ + public VirtualMachineScaleSetInstanceViewStatusesSummary() { + } + + /** + * 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..3c0cb3f1d5ef6 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetIpConfiguration.java @@ -0,0 +1,286 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code 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.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetIpConfigurationProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a virtual machine scale set network profile's IP configuration. */ +@Fluent +public final class VirtualMachineScaleSetIpConfiguration { + /* + * The IP configuration name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Describes a virtual machine scale set network profile's IP configuration properties. + */ + @JsonProperty(value = "properties") + private VirtualMachineScaleSetIpConfigurationProperties innerProperties; + + /** Creates an instance of VirtualMachineScaleSetIpConfiguration class. */ + public VirtualMachineScaleSetIpConfiguration() { + } + + /** + * 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 innerProperties property: Describes a virtual machine scale set network profile's IP configuration + * properties. + * + * @return the innerProperties value. + */ + private VirtualMachineScaleSetIpConfigurationProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the subnet property: Specifies the identifier of the subnet. + * + * @return the subnet value. + */ + public ApiEntityReference subnet() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetIpConfigurationProperties(); + } + this.innerProperties().withSubnet(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetIpConfigurationProperties(); + } + this.innerProperties().withPrimary(primary); + return this; + } + + /** + * Get the publicIpAddressConfiguration property: The publicIPAddressConfiguration. + * + * @return the publicIpAddressConfiguration value. + */ + public VirtualMachineScaleSetPublicIpAddressConfiguration publicIpAddressConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().publicIpAddressConfiguration(); + } + + /** + * Set the publicIpAddressConfiguration property: The publicIPAddressConfiguration. + * + * @param publicIpAddressConfiguration the publicIpAddressConfiguration value to set. + * @return the VirtualMachineScaleSetIpConfiguration object itself. + */ + public VirtualMachineScaleSetIpConfiguration withPublicIpAddressConfiguration( + VirtualMachineScaleSetPublicIpAddressConfiguration publicIpAddressConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetIpConfigurationProperties(); + } + this.innerProperties().withPublicIpAddressConfiguration(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetIpConfigurationProperties(); + } + this.innerProperties().withPrivateIpAddressVersion(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetIpConfigurationProperties(); + } + this.innerProperties().withApplicationGatewayBackendAddressPools(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetIpConfigurationProperties(); + } + this.innerProperties().withApplicationSecurityGroups(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetIpConfigurationProperties(); + } + this.innerProperties().withLoadBalancerBackendAddressPools(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetIpConfigurationProperties(); + } + this.innerProperties().withLoadBalancerInboundNatPools(loadBalancerInboundNatPools); + 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 (innerProperties() != null) { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VirtualMachineScaleSetIpConfiguration.class); +} 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..3b4fdc287bfa7 --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** Contains the IP tag associated with the public IP address. */ +@Fluent +public final class VirtualMachineScaleSetIpTag { + /* + * 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; + + /** Creates an instance of VirtualMachineScaleSetIpTag class. */ + public VirtualMachineScaleSetIpTag() { + } + + /** + * 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..283a86f81a914 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetListOSUpgradeHistory.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.azure.resourcemanager.compute.generated.fluent.models.UpgradeOperationHistoricalStatusInfoInner; +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 { + /* + * 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; + + /** Creates an instance of VirtualMachineScaleSetListOSUpgradeHistory class. */ + public VirtualMachineScaleSetListOSUpgradeHistory() { + } + + /** + * 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()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VirtualMachineScaleSetListOSUpgradeHistory.class); +} 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..d5577fc47eb13 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetListResult.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.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List Virtual Machine operation response. */ +@Fluent +public final class VirtualMachineScaleSetListResult { + /* + * 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; + + /** Creates an instance of VirtualMachineScaleSetListResult class. */ + public VirtualMachineScaleSetListResult() { + } + + /** + * 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()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VirtualMachineScaleSetListResult.class); +} 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..5e10215e8c548 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetListSkusResult.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.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetSkuInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The Virtual Machine Scale Set List Skus operation response. */ +@Fluent +public final class VirtualMachineScaleSetListSkusResult { + /* + * 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; + + /** Creates an instance of VirtualMachineScaleSetListSkusResult class. */ + public VirtualMachineScaleSetListSkusResult() { + } + + /** + * 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()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VirtualMachineScaleSetListSkusResult.class); +} 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..840dcf628392c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetListWithLinkResult.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.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List Virtual Machine operation response. */ +@Fluent +public final class VirtualMachineScaleSetListWithLinkResult { + /* + * 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; + + /** Creates an instance of VirtualMachineScaleSetListWithLinkResult class. */ + public VirtualMachineScaleSetListWithLinkResult() { + } + + /** + * 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()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VirtualMachineScaleSetListWithLinkResult.class); +} 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..d8c583e95008b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetManagedDiskParameters.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.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the parameters of a ScaleSet managed disk. */ +@Fluent +public final class VirtualMachineScaleSetManagedDiskParameters { + /* + * 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; + + /* + * Specifies the security profile for the managed disk. + */ + @JsonProperty(value = "securityProfile") + private VMDiskSecurityProfile securityProfile; + + /** Creates an instance of VirtualMachineScaleSetManagedDiskParameters class. */ + public VirtualMachineScaleSetManagedDiskParameters() { + } + + /** + * 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; + } + + /** + * Get the securityProfile property: Specifies the security profile for the managed disk. + * + * @return the securityProfile value. + */ + public VMDiskSecurityProfile securityProfile() { + return this.securityProfile; + } + + /** + * Set the securityProfile property: Specifies the security profile for the managed disk. + * + * @param securityProfile the securityProfile value to set. + * @return the VirtualMachineScaleSetManagedDiskParameters object itself. + */ + public VirtualMachineScaleSetManagedDiskParameters withSecurityProfile(VMDiskSecurityProfile securityProfile) { + this.securityProfile = securityProfile; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (diskEncryptionSet() != null) { + diskEncryptionSet().validate(); + } + if (securityProfile() != null) { + securityProfile().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..8c27f8a677f46 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetNetworkConfiguration.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.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetNetworkConfigurationProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a virtual machine scale set network profile's network configurations. */ +@Fluent +public final class VirtualMachineScaleSetNetworkConfiguration { + /* + * The network configuration name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Describes a virtual machine scale set network profile's IP configuration. + */ + @JsonProperty(value = "properties") + private VirtualMachineScaleSetNetworkConfigurationProperties innerProperties; + + /** Creates an instance of VirtualMachineScaleSetNetworkConfiguration class. */ + public VirtualMachineScaleSetNetworkConfiguration() { + } + + /** + * 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 innerProperties property: Describes a virtual machine scale set network profile's IP configuration. + * + * @return the innerProperties value. + */ + private VirtualMachineScaleSetNetworkConfigurationProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetNetworkConfigurationProperties(); + } + this.innerProperties().withPrimary(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetNetworkConfigurationProperties(); + } + this.innerProperties().withEnableAcceleratedNetworking(enableAcceleratedNetworking); + return this; + } + + /** + * Get the disableTcpStateTracking property: Specifies whether the network interface is disabled for tcp state + * tracking. + * + * @return the disableTcpStateTracking value. + */ + public Boolean disableTcpStateTracking() { + return this.innerProperties() == null ? null : this.innerProperties().disableTcpStateTracking(); + } + + /** + * Set the disableTcpStateTracking property: Specifies whether the network interface is disabled for tcp state + * tracking. + * + * @param disableTcpStateTracking the disableTcpStateTracking value to set. + * @return the VirtualMachineScaleSetNetworkConfiguration object itself. + */ + public VirtualMachineScaleSetNetworkConfiguration withDisableTcpStateTracking(Boolean disableTcpStateTracking) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetNetworkConfigurationProperties(); + } + this.innerProperties().withDisableTcpStateTracking(disableTcpStateTracking); + return this; + } + + /** + * Get the enableFpga property: Specifies whether the network interface is FPGA networking-enabled. + * + * @return the enableFpga value. + */ + public Boolean enableFpga() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetNetworkConfigurationProperties(); + } + this.innerProperties().withEnableFpga(enableFpga); + return this; + } + + /** + * Get the networkSecurityGroup property: The network security group. + * + * @return the networkSecurityGroup value. + */ + public SubResource networkSecurityGroup() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetNetworkConfigurationProperties(); + } + this.innerProperties().withNetworkSecurityGroup(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetNetworkConfigurationProperties(); + } + this.innerProperties().withDnsSettings(dnsSettings); + return this; + } + + /** + * Get the ipConfigurations property: Specifies the IP configurations of the network interface. + * + * @return the ipConfigurations value. + */ + public List ipConfigurations() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetNetworkConfigurationProperties(); + } + this.innerProperties().withIpConfigurations(ipConfigurations); + return this; + } + + /** + * Get the enableIpForwarding property: Whether IP forwarding enabled on this NIC. + * + * @return the enableIpForwarding value. + */ + public Boolean enableIpForwarding() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetNetworkConfigurationProperties(); + } + this.innerProperties().withEnableIpForwarding(enableIpForwarding); + return this; + } + + /** + * Get the deleteOption property: Specify what happens to the network interface when the VM is deleted. + * + * @return the deleteOption value. + */ + public DeleteOptions deleteOption() { + return this.innerProperties() == null ? null : this.innerProperties().deleteOption(); + } + + /** + * Set the deleteOption property: Specify what happens to the network interface when the VM is deleted. + * + * @param deleteOption the deleteOption value to set. + * @return the VirtualMachineScaleSetNetworkConfiguration object itself. + */ + public VirtualMachineScaleSetNetworkConfiguration withDeleteOption(DeleteOptions deleteOption) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetNetworkConfigurationProperties(); + } + this.innerProperties().withDeleteOption(deleteOption); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property name in model VirtualMachineScaleSetNetworkConfiguration")); + } + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VirtualMachineScaleSetNetworkConfiguration.class); +} 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..a2f19901a70c0 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetNetworkConfigurationDnsSettings.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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a virtual machines scale sets network configuration's DNS settings. */ +@Fluent +public final class VirtualMachineScaleSetNetworkConfigurationDnsSettings { + /* + * List of DNS servers IP addresses + */ + @JsonProperty(value = "dnsServers") + private List dnsServers; + + /** Creates an instance of VirtualMachineScaleSetNetworkConfigurationDnsSettings class. */ + public VirtualMachineScaleSetNetworkConfigurationDnsSettings() { + } + + /** + * 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..cd7e8f307a72d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetNetworkProfile.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a virtual machine scale set network profile. */ +@Fluent +public final class VirtualMachineScaleSetNetworkProfile { + /* + * A reference to a load balancer probe used to determine the health of an instance in the virtual machine scale + * set. The reference will be in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. + */ + @JsonProperty(value = "healthProbe") + private ApiEntityReference healthProbe; + + /* + * The list of network configurations. + */ + @JsonProperty(value = "networkInterfaceConfigurations") + private List networkInterfaceConfigurations; + + /* + * specifies the Microsoft.Network API version used when creating networking resources in the Network Interface + * Configurations for Virtual Machine Scale Set with orchestration mode 'Flexible' + */ + @JsonProperty(value = "networkApiVersion") + private NetworkApiVersion networkApiVersion; + + /** Creates an instance of VirtualMachineScaleSetNetworkProfile class. */ + public VirtualMachineScaleSetNetworkProfile() { + } + + /** + * Get the healthProbe property: A reference to a load balancer probe used to determine the health of an instance in + * the virtual machine scale set. The reference will be in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. + * + * @return the healthProbe value. + */ + public ApiEntityReference healthProbe() { + return this.healthProbe; + } + + /** + * Set the healthProbe property: A reference to a load balancer probe used to determine the health of an instance in + * the virtual machine scale set. The reference will be in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. + * + * @param healthProbe the healthProbe value to set. + * @return the VirtualMachineScaleSetNetworkProfile object itself. + */ + public VirtualMachineScaleSetNetworkProfile withHealthProbe(ApiEntityReference healthProbe) { + this.healthProbe = healthProbe; + return this; + } + + /** + * Get the networkInterfaceConfigurations property: The list of network configurations. + * + * @return the networkInterfaceConfigurations value. + */ + public List networkInterfaceConfigurations() { + return this.networkInterfaceConfigurations; + } + + /** + * Set the networkInterfaceConfigurations property: The list of network configurations. + * + * @param networkInterfaceConfigurations the networkInterfaceConfigurations value to set. + * @return the VirtualMachineScaleSetNetworkProfile object itself. + */ + public VirtualMachineScaleSetNetworkProfile withNetworkInterfaceConfigurations( + List networkInterfaceConfigurations) { + this.networkInterfaceConfigurations = networkInterfaceConfigurations; + return this; + } + + /** + * Get the networkApiVersion property: specifies the Microsoft.Network API version used when creating networking + * resources in the Network Interface Configurations for Virtual Machine Scale Set with orchestration mode + * 'Flexible'. + * + * @return the networkApiVersion value. + */ + public NetworkApiVersion networkApiVersion() { + return this.networkApiVersion; + } + + /** + * Set the networkApiVersion property: specifies the Microsoft.Network API version used when creating networking + * resources in the Network Interface Configurations for Virtual Machine Scale Set with orchestration mode + * 'Flexible'. + * + * @param networkApiVersion the networkApiVersion value to set. + * @return the VirtualMachineScaleSetNetworkProfile object itself. + */ + public VirtualMachineScaleSetNetworkProfile withNetworkApiVersion(NetworkApiVersion networkApiVersion) { + this.networkApiVersion = networkApiVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (healthProbe() != null) { + healthProbe().validate(); + } + if (networkInterfaceConfigurations() != null) { + networkInterfaceConfigurations().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetOSDisk.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetOSDisk.java new file mode 100644 index 0000000000000..ad69d3ef0839e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetOSDisk.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a virtual machine scale set operating system disk. */ +@Fluent +public final class VirtualMachineScaleSetOSDisk { + /* + * The disk name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Specifies the caching requirements. Possible values are: **None,** **ReadOnly,** **ReadWrite.** The default + * values are: **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.** + * 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 an empty data disk in gigabytes. This element can be used to overwrite the size of the + * disk in a virtual machine image. The property 'diskSizeGB' is the number of bytes x 1024^3 for the disk and the + * value cannot be larger than 1023. + */ + @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; + + /* + * Specifies whether OS Disk should be deleted or detached upon VMSS Flex deletion (This feature is available for + * VMSS with Flexible OrchestrationMode only).

Possible values:

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

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

The default value is set to **Delete**. For an Ephemeral OS + * Disk, the default value is set to **Delete**. User cannot change the delete option for Ephemeral OS Disk. + */ + @JsonProperty(value = "deleteOption") + private DiskDeleteOptionTypes deleteOption; + + /** Creates an instance of VirtualMachineScaleSetOSDisk class. */ + public VirtualMachineScaleSetOSDisk() { + } + + /** + * 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. Possible values are: **None,** **ReadOnly,** + * **ReadWrite.** The default values are: **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. Possible values are: **None,** **ReadOnly,** + * **ReadWrite.** The default values are: **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. The only + * allowed value is: **FromImage.** 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. The only + * allowed value is: **FromImage.** 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 an empty data disk in gigabytes. This element can be used to + * overwrite the size of the disk in a virtual machine image. The property 'diskSizeGB' is the number of bytes x + * 1024^3 for the disk and the value cannot be larger than 1023. + * + * @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. The property 'diskSizeGB' is the number of bytes x + * 1024^3 for the disk and the value cannot be larger than 1023. + * + * @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. Possible values are: **Windows,** **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. Possible values are: **Windows,** **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; + } + + /** + * Get the deleteOption property: Specifies whether OS Disk should be deleted or detached upon VMSS Flex deletion + * (This feature is available for VMSS with Flexible OrchestrationMode only). <br><br> Possible values: + * <br><br> **Delete** If this value is used, the OS disk is deleted when VMSS Flex VM is + * deleted.<br><br> **Detach** If this value is used, the OS disk is retained after VMSS Flex VM is + * deleted. <br><br> The default value is set to **Delete**. For an Ephemeral OS Disk, the default value + * is set to **Delete**. User cannot change the delete option for Ephemeral OS Disk. + * + * @return the deleteOption value. + */ + public DiskDeleteOptionTypes deleteOption() { + return this.deleteOption; + } + + /** + * Set the deleteOption property: Specifies whether OS Disk should be deleted or detached upon VMSS Flex deletion + * (This feature is available for VMSS with Flexible OrchestrationMode only). <br><br> Possible values: + * <br><br> **Delete** If this value is used, the OS disk is deleted when VMSS Flex VM is + * deleted.<br><br> **Detach** If this value is used, the OS disk is retained after VMSS Flex VM is + * deleted. <br><br> The default value is set to **Delete**. For an Ephemeral OS Disk, the default value + * is set to **Delete**. User cannot change the delete option for Ephemeral OS Disk. + * + * @param deleteOption the deleteOption value to set. + * @return the VirtualMachineScaleSetOSDisk object itself. + */ + public VirtualMachineScaleSetOSDisk withDeleteOption(DiskDeleteOptionTypes deleteOption) { + this.deleteOption = deleteOption; + 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(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VirtualMachineScaleSetOSDisk.class); +} 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..73c700ea143f5 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetOSProfile.java @@ -0,0 +1,349 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a virtual machine scale set OS profile. */ +@Fluent +public final class VirtualMachineScaleSetOSProfile { + /* + * Specifies the computer name prefix for all of the virtual machines in the scale set. Computer name prefixes must + * be 1 to 15 characters long. + */ + @JsonProperty(value = "computerNamePrefix") + private String computerNamePrefix; + + /* + * Specifies the name of the administrator account.

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

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

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

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

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

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

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

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

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

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

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

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

For resetting root + * password, see [Manage users, SSH, and check or repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection) + */ + @JsonProperty(value = "adminPassword") + private String adminPassword; + + /* + * Specifies a base-64 encoded string of custom data. The base-64 encoded string is decoded to a binary array that + * is saved as a file on the Virtual Machine. The maximum length of the binary array is 65535 bytes. For using + * cloud-init for your VM, see [Using cloud-init to customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/linux/using-cloud-init) + */ + @JsonProperty(value = "customData") + private String customData; + + /* + * Specifies Windows operating system settings on the virtual machine. + */ + @JsonProperty(value = "windowsConfiguration") + private WindowsConfiguration windowsConfiguration; + + /* + * Specifies the Linux operating system settings on the virtual machine. For a list of supported Linux + * distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/linux/endorsed-distros). + */ + @JsonProperty(value = "linuxConfiguration") + private LinuxConfiguration linuxConfiguration; + + /* + * Specifies set of certificates that should be installed onto the virtual machines in the scale set. To install + * certificates on a virtual machine it is recommended to use the [Azure Key Vault virtual machine extension for + * Linux](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux) or the [Azure Key Vault + * virtual machine extension for + * Windows](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows). + */ + @JsonProperty(value = "secrets") + private List secrets; + + /* + * Specifies whether extension operations should be allowed on the virtual machine scale set. This may only be set + * to False when no extensions are present on the virtual machine scale set. + */ + @JsonProperty(value = "allowExtensionOperations") + private Boolean allowExtensionOperations; + + /* + * Optional property which must either be set to True or omitted. + */ + @JsonProperty(value = "requireGuestProvisionSignal") + private Boolean requireGuestProvisionSignal; + + /** Creates an instance of VirtualMachineScaleSetOSProfile class. */ + public VirtualMachineScaleSetOSProfile() { + } + + /** + * Get the computerNamePrefix property: Specifies the computer name prefix for all of the virtual machines in the + * scale set. Computer name prefixes must be 1 to 15 characters long. + * + * @return the computerNamePrefix value. + */ + public String computerNamePrefix() { + return this.computerNamePrefix; + } + + /** + * Set the computerNamePrefix property: Specifies the computer name prefix for all of the virtual machines in the + * scale set. Computer name prefixes must be 1 to 15 characters long. + * + * @param computerNamePrefix the computerNamePrefix value to set. + * @return the VirtualMachineScaleSetOSProfile object itself. + */ + public VirtualMachineScaleSetOSProfile withComputerNamePrefix(String computerNamePrefix) { + this.computerNamePrefix = computerNamePrefix; + return this; + } + + /** + * Get the adminUsername property: Specifies the name of the administrator account. <br><br> + * **Windows-only restriction:** Cannot end in "." <br><br> **Disallowed values:** "administrator", + * "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", + * "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", + * "support_388945a0", "sys", "test2", "test3", "user4", "user5". <br><br> **Minimum-length (Linux):** 1 + * character <br><br> **Max-length (Linux):** 64 characters <br><br> **Max-length + * (Windows):** 20 characters. + * + * @return the adminUsername value. + */ + public String adminUsername() { + return this.adminUsername; + } + + /** + * Set the adminUsername property: Specifies the name of the administrator account. <br><br> + * **Windows-only restriction:** Cannot end in "." <br><br> **Disallowed values:** "administrator", + * "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", + * "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", + * "support_388945a0", "sys", "test2", "test3", "user4", "user5". <br><br> **Minimum-length (Linux):** 1 + * character <br><br> **Max-length (Linux):** 64 characters <br><br> **Max-length + * (Windows):** 20 characters. + * + * @param adminUsername the adminUsername value to set. + * @return the VirtualMachineScaleSetOSProfile object itself. + */ + public VirtualMachineScaleSetOSProfile withAdminUsername(String adminUsername) { + this.adminUsername = adminUsername; + return this; + } + + /** + * Get the adminPassword property: Specifies the password of the administrator account. <br><br> + * **Minimum-length (Windows):** 8 characters <br><br> **Minimum-length (Linux):** 6 characters + * <br><br> **Max-length (Windows):** 123 characters <br><br> **Max-length (Linux):** 72 + * characters <br><br> **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled + * <br> Has lower characters <br>Has upper characters <br> Has a digit <br> Has a special + * character (Regex match [\W_]) <br><br> **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", + * "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!" <br><br> + * For resetting the password, see [How to reset the Remote Desktop service or its login password in a Windows + * VM](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/reset-rdp) <br><br> For resetting + * root password, see [Manage users, SSH, and check or repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection). + * + * @return the adminPassword value. + */ + public String adminPassword() { + return this.adminPassword; + } + + /** + * Set the adminPassword property: Specifies the password of the administrator account. <br><br> + * **Minimum-length (Windows):** 8 characters <br><br> **Minimum-length (Linux):** 6 characters + * <br><br> **Max-length (Windows):** 123 characters <br><br> **Max-length (Linux):** 72 + * characters <br><br> **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled + * <br> Has lower characters <br>Has upper characters <br> Has a digit <br> Has a special + * character (Regex match [\W_]) <br><br> **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", + * "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!" <br><br> + * For resetting the password, see [How to reset the Remote Desktop service or its login password in a Windows + * VM](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/reset-rdp) <br><br> For resetting + * root password, see [Manage users, SSH, and check or repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection). + * + * @param adminPassword the adminPassword value to set. + * @return the VirtualMachineScaleSetOSProfile object itself. + */ + public VirtualMachineScaleSetOSProfile withAdminPassword(String adminPassword) { + this.adminPassword = adminPassword; + return this; + } + + /** + * Get the customData property: Specifies a base-64 encoded string of custom data. The base-64 encoded string is + * decoded to a binary array that is saved as a file on the Virtual Machine. The maximum length of the binary array + * is 65535 bytes. For using cloud-init for your VM, see [Using cloud-init to customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/linux/using-cloud-init). + * + * @return the customData value. + */ + public String customData() { + return this.customData; + } + + /** + * Set the customData property: Specifies a base-64 encoded string of custom data. The base-64 encoded string is + * decoded to a binary array that is saved as a file on the Virtual Machine. The maximum length of the binary array + * is 65535 bytes. For using cloud-init for your VM, see [Using cloud-init to customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/linux/using-cloud-init). + * + * @param customData the customData value to set. + * @return the VirtualMachineScaleSetOSProfile object itself. + */ + public VirtualMachineScaleSetOSProfile withCustomData(String customData) { + this.customData = customData; + return this; + } + + /** + * Get the windowsConfiguration property: Specifies Windows operating system settings on the virtual machine. + * + * @return the windowsConfiguration value. + */ + public WindowsConfiguration windowsConfiguration() { + return this.windowsConfiguration; + } + + /** + * Set the windowsConfiguration property: Specifies Windows operating system settings on the virtual machine. + * + * @param windowsConfiguration the windowsConfiguration value to set. + * @return the VirtualMachineScaleSetOSProfile object itself. + */ + public VirtualMachineScaleSetOSProfile withWindowsConfiguration(WindowsConfiguration windowsConfiguration) { + this.windowsConfiguration = windowsConfiguration; + return this; + } + + /** + * Get the linuxConfiguration property: Specifies the Linux operating system settings on the virtual machine. For a + * list of supported Linux distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/linux/endorsed-distros). + * + * @return the linuxConfiguration value. + */ + public LinuxConfiguration linuxConfiguration() { + return this.linuxConfiguration; + } + + /** + * Set the linuxConfiguration property: Specifies the Linux operating system settings on the virtual machine. For a + * list of supported Linux distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/linux/endorsed-distros). + * + * @param linuxConfiguration the linuxConfiguration value to set. + * @return the VirtualMachineScaleSetOSProfile object itself. + */ + public VirtualMachineScaleSetOSProfile withLinuxConfiguration(LinuxConfiguration linuxConfiguration) { + this.linuxConfiguration = linuxConfiguration; + return this; + } + + /** + * Get the secrets property: Specifies set of certificates that should be installed onto the virtual machines in the + * scale set. To install certificates on a virtual machine it is recommended to use the [Azure Key Vault virtual + * machine extension for Linux](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux) or the + * [Azure Key Vault virtual machine extension for + * Windows](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows). + * + * @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. To install certificates on a virtual machine it is recommended to use the [Azure Key Vault virtual + * machine extension for Linux](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux) or the + * [Azure Key Vault virtual machine extension for + * Windows](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows). + * + * @param secrets the secrets value to set. + * @return the VirtualMachineScaleSetOSProfile object itself. + */ + public VirtualMachineScaleSetOSProfile withSecrets(List secrets) { + this.secrets = secrets; + return this; + } + + /** + * Get the allowExtensionOperations property: Specifies whether extension operations should be allowed on the + * virtual machine scale set. This may only be set to False when no extensions are present on the virtual machine + * scale set. + * + * @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 scale set. This may only be set to False when no extensions are present on the virtual machine + * scale set. + * + * @param allowExtensionOperations the allowExtensionOperations value to set. + * @return the VirtualMachineScaleSetOSProfile object itself. + */ + public VirtualMachineScaleSetOSProfile withAllowExtensionOperations(Boolean allowExtensionOperations) { + this.allowExtensionOperations = allowExtensionOperations; + return this; + } + + /** + * Get the requireGuestProvisionSignal property: Optional property which must either be set to True or omitted. + * + * @return the requireGuestProvisionSignal value. + */ + public Boolean requireGuestProvisionSignal() { + return this.requireGuestProvisionSignal; + } + + /** + * Set the requireGuestProvisionSignal property: Optional property which must either be set to True or omitted. + * + * @param requireGuestProvisionSignal the requireGuestProvisionSignal value to set. + * @return the VirtualMachineScaleSetOSProfile object itself. + */ + public VirtualMachineScaleSetOSProfile 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/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..3a5cd8c2e77a0 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetPublicIpAddressConfiguration.java @@ -0,0 +1,253 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code 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.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetPublicIpAddressConfigurationProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a virtual machines scale set IP Configuration's PublicIPAddress configuration. */ +@Fluent +public final class VirtualMachineScaleSetPublicIpAddressConfiguration { + /* + * The publicIP address configuration name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Describes a virtual machines scale set IP Configuration's PublicIPAddress configuration + */ + @JsonProperty(value = "properties") + private VirtualMachineScaleSetPublicIpAddressConfigurationProperties innerProperties; + + /* + * Describes the public IP Sku. It can only be set with OrchestrationMode as Flexible. + */ + @JsonProperty(value = "sku") + private PublicIpAddressSku sku; + + /** Creates an instance of VirtualMachineScaleSetPublicIpAddressConfiguration class. */ + public VirtualMachineScaleSetPublicIpAddressConfiguration() { + } + + /** + * 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 innerProperties property: Describes a virtual machines scale set IP Configuration's PublicIPAddress + * configuration. + * + * @return the innerProperties value. + */ + private VirtualMachineScaleSetPublicIpAddressConfigurationProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the sku property: Describes the public IP Sku. It can only be set with OrchestrationMode as Flexible. + * + * @return the sku value. + */ + public PublicIpAddressSku sku() { + return this.sku; + } + + /** + * Set the sku property: Describes the public IP Sku. It can only be set with OrchestrationMode as Flexible. + * + * @param sku the sku value to set. + * @return the VirtualMachineScaleSetPublicIpAddressConfiguration object itself. + */ + public VirtualMachineScaleSetPublicIpAddressConfiguration withSku(PublicIpAddressSku sku) { + this.sku = sku; + return this; + } + + /** + * Get the idleTimeoutInMinutes property: The idle timeout of the public IP address. + * + * @return the idleTimeoutInMinutes value. + */ + public Integer idleTimeoutInMinutes() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetPublicIpAddressConfigurationProperties(); + } + this.innerProperties().withIdleTimeoutInMinutes(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetPublicIpAddressConfigurationProperties(); + } + this.innerProperties().withDnsSettings(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetPublicIpAddressConfigurationProperties(); + } + this.innerProperties().withIpTags(ipTags); + return this; + } + + /** + * Get the publicIpPrefix property: The PublicIPPrefix from which to allocate publicIP addresses. + * + * @return the publicIpPrefix value. + */ + public SubResource publicIpPrefix() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetPublicIpAddressConfigurationProperties(); + } + this.innerProperties().withPublicIpPrefix(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetPublicIpAddressConfigurationProperties(); + } + this.innerProperties().withPublicIpAddressVersion(publicIpAddressVersion); + return this; + } + + /** + * Get the deleteOption property: Specify what happens to the public IP when the VM is deleted. + * + * @return the deleteOption value. + */ + public DeleteOptions deleteOption() { + return this.innerProperties() == null ? null : this.innerProperties().deleteOption(); + } + + /** + * Set the deleteOption property: Specify what happens to the public IP when the VM is deleted. + * + * @param deleteOption the deleteOption value to set. + * @return the VirtualMachineScaleSetPublicIpAddressConfiguration object itself. + */ + public VirtualMachineScaleSetPublicIpAddressConfiguration withDeleteOption(DeleteOptions deleteOption) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetPublicIpAddressConfigurationProperties(); + } + this.innerProperties().withDeleteOption(deleteOption); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property name in model VirtualMachineScaleSetPublicIpAddressConfiguration")); + } + if (innerProperties() != null) { + innerProperties().validate(); + } + if (sku() != null) { + sku().validate(); + } + } + + private static final ClientLogger LOGGER = + new ClientLogger(VirtualMachineScaleSetPublicIpAddressConfiguration.class); +} 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..4bc2f3e713fc5 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings.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.JsonProperty; + +/** Describes a virtual machines scale sets network configuration's DNS settings. */ +@Fluent +public final class VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings { + /* + * 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; + + /** Creates an instance of VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings class. */ + public VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings() { + } + + /** + * 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")); + } + } + + private static final ClientLogger LOGGER = + new ClientLogger(VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings.class); +} 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..63bf91c5b1128 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetReimageParameters.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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a Virtual Machine Scale Set VM Reimage Parameters. */ +@Fluent +public final class VirtualMachineScaleSetReimageParameters extends VirtualMachineScaleSetVMReimageParameters { + /* + * 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; + + /** Creates an instance of VirtualMachineScaleSetReimageParameters class. */ + public VirtualMachineScaleSetReimageParameters() { + } + + /** + * 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; + } + + /** {@inheritDoc} */ + @Override + public VirtualMachineScaleSetReimageParameters withExactVersion(String exactVersion) { + super.withExactVersion(exactVersion); + return this; + } + + /** {@inheritDoc} */ + @Override + public VirtualMachineScaleSetReimageParameters withOsProfile(OSProfileProvisioningData osProfile) { + super.withOsProfile(osProfile); + 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..15949a3a56698 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetRollingUpgrades.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.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.resourcemanager.compute.generated.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 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.resourcemanager.compute.generated.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 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.resourcemanager.compute.generated.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 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.resourcemanager.compute.generated.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 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.resourcemanager.compute.generated.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 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.resourcemanager.compute.generated.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 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 along with {@link Response}. + */ + Response getLatestWithResponse( + 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.resourcemanager.compute.generated.models.ApiErrorException 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); +} 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..3df0b3da4a965 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetScaleInRules.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.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 a new instance of VirtualMachineScaleSetScaleInRules value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VirtualMachineScaleSetScaleInRules() { + } + + /** + * 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); + } + + /** + * Gets known VirtualMachineScaleSetScaleInRules values. + * + * @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..8d93dea1f92e2 --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** Describes scaling information of a sku. */ +@Immutable +public final class VirtualMachineScaleSetSkuCapacity { + /* + * 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; + + /** Creates an instance of VirtualMachineScaleSetSkuCapacity class. */ + public VirtualMachineScaleSetSkuCapacity() { + } + + /** + * 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..a40bf8833d35a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetSkuScaleType.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.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** The scale type applicable to the sku. */ +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) { + if (value == null) { + return null; + } + VirtualMachineScaleSetSkuScaleType[] items = VirtualMachineScaleSetSkuScaleType.values(); + for (VirtualMachineScaleSetSkuScaleType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @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..c2cd7f7e06d4a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetStorageProfile.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a virtual machine scale set storage profile. */ +@Fluent +public final class VirtualMachineScaleSetStorageProfile { + /* + * Specifies information about the image to use. You can specify information about platform images, marketplace + * images, or virtual machine images. This element is required when you want to use a platform image, marketplace + * image, or virtual machine image, but is not used in other creation operations. + */ + @JsonProperty(value = "imageReference") + private ImageReference imageReference; + + /* + * Specifies information about the operating system disk used by the virtual machines in the scale set. For more + * information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). + */ + @JsonProperty(value = "osDisk") + private VirtualMachineScaleSetOSDisk osDisk; + + /* + * Specifies the parameters that are used to add data disks to the virtual machines in the scale set. For more + * information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). + */ + @JsonProperty(value = "dataDisks") + private List dataDisks; + + /* + * The diskControllerType property. + */ + @JsonProperty(value = "diskControllerType") + private String diskControllerType; + + /** Creates an instance of VirtualMachineScaleSetStorageProfile class. */ + public VirtualMachineScaleSetStorageProfile() { + } + + /** + * 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. For more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). + * + * @return the osDisk value. + */ + public VirtualMachineScaleSetOSDisk osDisk() { + return this.osDisk; + } + + /** + * Set the osDisk property: Specifies information about the operating system disk used by the virtual machines in + * the scale set. For more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). + * + * @param osDisk the osDisk value to set. + * @return the VirtualMachineScaleSetStorageProfile object itself. + */ + public VirtualMachineScaleSetStorageProfile withOsDisk(VirtualMachineScaleSetOSDisk osDisk) { + this.osDisk = osDisk; + return this; + } + + /** + * Get the dataDisks property: Specifies the parameters that are used to add data disks to the virtual machines in + * the scale set. For more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). + * + * @return the dataDisks value. + */ + public List dataDisks() { + return this.dataDisks; + } + + /** + * Set the dataDisks property: Specifies the parameters that are used to add data disks to the virtual machines in + * the scale set. For more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). + * + * @param dataDisks the dataDisks value to set. + * @return the VirtualMachineScaleSetStorageProfile object itself. + */ + public VirtualMachineScaleSetStorageProfile withDataDisks(List dataDisks) { + this.dataDisks = dataDisks; + return this; + } + + /** + * Get the diskControllerType property: The diskControllerType property. + * + * @return the diskControllerType value. + */ + public String diskControllerType() { + return this.diskControllerType; + } + + /** + * Set the diskControllerType property: The diskControllerType property. + * + * @param diskControllerType the diskControllerType value to set. + * @return the VirtualMachineScaleSetStorageProfile object itself. + */ + public VirtualMachineScaleSetStorageProfile withDiskControllerType(String diskControllerType) { + this.diskControllerType = diskControllerType; + 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..32a4dd1be1814 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetUpdate.java @@ -0,0 +1,414 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code 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.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetUpdateProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Describes a Virtual Machine Scale Set. */ +@Fluent +public final class VirtualMachineScaleSetUpdate extends UpdateResource { + /* + * 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; + + /* + * Describes the properties of a Virtual Machine Scale Set. + */ + @JsonProperty(value = "properties") + private VirtualMachineScaleSetUpdateProperties innerProperties; + + /* + * The identity of the virtual machine scale set, if configured. + */ + @JsonProperty(value = "identity") + private VirtualMachineScaleSetIdentity identity; + + /** Creates an instance of VirtualMachineScaleSetUpdate class. */ + public VirtualMachineScaleSetUpdate() { + } + + /** + * 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 innerProperties property: Describes the properties of a Virtual Machine Scale Set. + * + * @return the innerProperties value. + */ + private VirtualMachineScaleSetUpdateProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** {@inheritDoc} */ + @Override + public VirtualMachineScaleSetUpdate withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the upgradePolicy property: The upgrade policy. + * + * @return the upgradePolicy value. + */ + public UpgradePolicy upgradePolicy() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetUpdateProperties(); + } + this.innerProperties().withUpgradePolicy(upgradePolicy); + return this; + } + + /** + * Get the automaticRepairsPolicy property: Policy for automatic repairs. + * + * @return the automaticRepairsPolicy value. + */ + public AutomaticRepairsPolicy automaticRepairsPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetUpdateProperties(); + } + this.innerProperties().withAutomaticRepairsPolicy(automaticRepairsPolicy); + return this; + } + + /** + * Get the virtualMachineProfile property: The virtual machine profile. + * + * @return the virtualMachineProfile value. + */ + public VirtualMachineScaleSetUpdateVMProfile virtualMachineProfile() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetUpdateProperties(); + } + this.innerProperties().withVirtualMachineProfile(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetUpdateProperties(); + } + this.innerProperties().withOverprovision(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetUpdateProperties(); + } + this.innerProperties().withDoNotRunExtensionsOnOverprovisionedVMs(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetUpdateProperties(); + } + this.innerProperties().withSinglePlacementGroup(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetUpdateProperties(); + } + this.innerProperties().withAdditionalCapabilities(additionalCapabilities); + return this; + } + + /** + * Get the scaleInPolicy property: Specifies the policies applied when scaling in Virtual Machines in the Virtual + * Machine Scale Set. + * + * @return the scaleInPolicy value. + */ + public ScaleInPolicy scaleInPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().scaleInPolicy(); + } + + /** + * Set the scaleInPolicy property: Specifies the policies applied when scaling in Virtual Machines in the Virtual + * Machine Scale Set. + * + * @param scaleInPolicy the scaleInPolicy value to set. + * @return the VirtualMachineScaleSetUpdate object itself. + */ + public VirtualMachineScaleSetUpdate withScaleInPolicy(ScaleInPolicy scaleInPolicy) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetUpdateProperties(); + } + this.innerProperties().withScaleInPolicy(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetUpdateProperties(); + } + this.innerProperties().withProximityPlacementGroup(proximityPlacementGroup); + return this; + } + + /** + * Get the priorityMixPolicy property: Specifies the desired targets for mixing Spot and Regular priority VMs within + * the same VMSS Flex instance. + * + * @return the priorityMixPolicy value. + */ + public PriorityMixPolicy priorityMixPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().priorityMixPolicy(); + } + + /** + * Set the priorityMixPolicy property: Specifies the desired targets for mixing Spot and Regular priority VMs within + * the same VMSS Flex instance. + * + * @param priorityMixPolicy the priorityMixPolicy value to set. + * @return the VirtualMachineScaleSetUpdate object itself. + */ + public VirtualMachineScaleSetUpdate withPriorityMixPolicy(PriorityMixPolicy priorityMixPolicy) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetUpdateProperties(); + } + this.innerProperties().withPriorityMixPolicy(priorityMixPolicy); + return this; + } + + /** + * Get the spotRestorePolicy property: Specifies the Spot Restore properties for the virtual machine scale set. + * + * @return the spotRestorePolicy value. + */ + public SpotRestorePolicy spotRestorePolicy() { + return this.innerProperties() == null ? null : this.innerProperties().spotRestorePolicy(); + } + + /** + * Set the spotRestorePolicy property: Specifies the Spot Restore properties for the virtual machine scale set. + * + * @param spotRestorePolicy the spotRestorePolicy value to set. + * @return the VirtualMachineScaleSetUpdate object itself. + */ + public VirtualMachineScaleSetUpdate withSpotRestorePolicy(SpotRestorePolicy spotRestorePolicy) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetUpdateProperties(); + } + this.innerProperties().withSpotRestorePolicy(spotRestorePolicy); + 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 (innerProperties() != null) { + innerProperties().validate(); + } + if (identity() != null) { + identity().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..68206843e08a1 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetUpdateIpConfiguration.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetUpdateIpConfigurationProperties; +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. + */ +@Fluent +public final class VirtualMachineScaleSetUpdateIpConfiguration { + /* + * The IP configuration name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Describes a virtual machine scale set network profile's IP configuration properties. + */ + @JsonProperty(value = "properties") + private VirtualMachineScaleSetUpdateIpConfigurationProperties innerProperties; + + /** Creates an instance of VirtualMachineScaleSetUpdateIpConfiguration class. */ + public VirtualMachineScaleSetUpdateIpConfiguration() { + } + + /** + * 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 innerProperties property: Describes a virtual machine scale set network profile's IP configuration + * properties. + * + * @return the innerProperties value. + */ + private VirtualMachineScaleSetUpdateIpConfigurationProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the subnet property: The subnet. + * + * @return the subnet value. + */ + public ApiEntityReference subnet() { + return this.innerProperties() == null ? null : this.innerProperties().subnet(); + } + + /** + * Set the subnet property: The subnet. + * + * @param subnet the subnet value to set. + * @return the VirtualMachineScaleSetUpdateIpConfiguration object itself. + */ + public VirtualMachineScaleSetUpdateIpConfiguration withSubnet(ApiEntityReference subnet) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetUpdateIpConfigurationProperties(); + } + this.innerProperties().withSubnet(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetUpdateIpConfigurationProperties(); + } + this.innerProperties().withPrimary(primary); + return this; + } + + /** + * Get the publicIpAddressConfiguration property: The publicIPAddressConfiguration. + * + * @return the publicIpAddressConfiguration value. + */ + public VirtualMachineScaleSetUpdatePublicIpAddressConfiguration publicIpAddressConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().publicIpAddressConfiguration(); + } + + /** + * Set the publicIpAddressConfiguration property: The publicIPAddressConfiguration. + * + * @param publicIpAddressConfiguration the publicIpAddressConfiguration value to set. + * @return the VirtualMachineScaleSetUpdateIpConfiguration object itself. + */ + public VirtualMachineScaleSetUpdateIpConfiguration withPublicIpAddressConfiguration( + VirtualMachineScaleSetUpdatePublicIpAddressConfiguration publicIpAddressConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetUpdateIpConfigurationProperties(); + } + this.innerProperties().withPublicIpAddressConfiguration(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetUpdateIpConfigurationProperties(); + } + this.innerProperties().withPrivateIpAddressVersion(privateIpAddressVersion); + return this; + } + + /** + * Get the applicationGatewayBackendAddressPools property: The application gateway backend address pools. + * + * @return the applicationGatewayBackendAddressPools value. + */ + public List applicationGatewayBackendAddressPools() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetUpdateIpConfigurationProperties(); + } + this.innerProperties().withApplicationGatewayBackendAddressPools(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetUpdateIpConfigurationProperties(); + } + this.innerProperties().withApplicationSecurityGroups(applicationSecurityGroups); + return this; + } + + /** + * Get the loadBalancerBackendAddressPools property: The load balancer backend address pools. + * + * @return the loadBalancerBackendAddressPools value. + */ + public List loadBalancerBackendAddressPools() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetUpdateIpConfigurationProperties(); + } + this.innerProperties().withLoadBalancerBackendAddressPools(loadBalancerBackendAddressPools); + return this; + } + + /** + * Get the loadBalancerInboundNatPools property: The load balancer inbound nat pools. + * + * @return the loadBalancerInboundNatPools value. + */ + public List loadBalancerInboundNatPools() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetUpdateIpConfigurationProperties(); + } + this.innerProperties().withLoadBalancerInboundNatPools(loadBalancerInboundNatPools); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().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..ae5da7f8f4053 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetUpdateNetworkConfiguration.java @@ -0,0 +1,288 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code 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.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetUpdateNetworkConfigurationProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a virtual machine scale set network profile's network configurations. */ +@Fluent +public final class VirtualMachineScaleSetUpdateNetworkConfiguration { + /* + * The network configuration name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Describes a virtual machine scale set updatable network profile's IP configuration.Use this object for updating + * network profile's IP Configuration. + */ + @JsonProperty(value = "properties") + private VirtualMachineScaleSetUpdateNetworkConfigurationProperties innerProperties; + + /** Creates an instance of VirtualMachineScaleSetUpdateNetworkConfiguration class. */ + public VirtualMachineScaleSetUpdateNetworkConfiguration() { + } + + /** + * 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 innerProperties property: Describes a virtual machine scale set updatable network profile's IP + * configuration.Use this object for updating network profile's IP Configuration. + * + * @return the innerProperties value. + */ + private VirtualMachineScaleSetUpdateNetworkConfigurationProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the primary property: Whether this is a primary NIC on a virtual machine. + * + * @return the primary value. + */ + public Boolean primary() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetUpdateNetworkConfigurationProperties(); + } + this.innerProperties().withPrimary(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetUpdateNetworkConfigurationProperties(); + } + this.innerProperties().withEnableAcceleratedNetworking(enableAcceleratedNetworking); + return this; + } + + /** + * Get the disableTcpStateTracking property: Specifies whether the network interface is disabled for tcp state + * tracking. + * + * @return the disableTcpStateTracking value. + */ + public Boolean disableTcpStateTracking() { + return this.innerProperties() == null ? null : this.innerProperties().disableTcpStateTracking(); + } + + /** + * Set the disableTcpStateTracking property: Specifies whether the network interface is disabled for tcp state + * tracking. + * + * @param disableTcpStateTracking the disableTcpStateTracking value to set. + * @return the VirtualMachineScaleSetUpdateNetworkConfiguration object itself. + */ + public VirtualMachineScaleSetUpdateNetworkConfiguration withDisableTcpStateTracking( + Boolean disableTcpStateTracking) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetUpdateNetworkConfigurationProperties(); + } + this.innerProperties().withDisableTcpStateTracking(disableTcpStateTracking); + return this; + } + + /** + * Get the enableFpga property: Specifies whether the network interface is FPGA networking-enabled. + * + * @return the enableFpga value. + */ + public Boolean enableFpga() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetUpdateNetworkConfigurationProperties(); + } + this.innerProperties().withEnableFpga(enableFpga); + return this; + } + + /** + * Get the networkSecurityGroup property: The network security group. + * + * @return the networkSecurityGroup value. + */ + public SubResource networkSecurityGroup() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetUpdateNetworkConfigurationProperties(); + } + this.innerProperties().withNetworkSecurityGroup(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetUpdateNetworkConfigurationProperties(); + } + this.innerProperties().withDnsSettings(dnsSettings); + return this; + } + + /** + * Get the ipConfigurations property: The virtual machine scale set IP Configuration. + * + * @return the ipConfigurations value. + */ + public List ipConfigurations() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetUpdateNetworkConfigurationProperties(); + } + this.innerProperties().withIpConfigurations(ipConfigurations); + return this; + } + + /** + * Get the enableIpForwarding property: Whether IP forwarding enabled on this NIC. + * + * @return the enableIpForwarding value. + */ + public Boolean enableIpForwarding() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetUpdateNetworkConfigurationProperties(); + } + this.innerProperties().withEnableIpForwarding(enableIpForwarding); + return this; + } + + /** + * Get the deleteOption property: Specify what happens to the network interface when the VM is deleted. + * + * @return the deleteOption value. + */ + public DeleteOptions deleteOption() { + return this.innerProperties() == null ? null : this.innerProperties().deleteOption(); + } + + /** + * Set the deleteOption property: Specify what happens to the network interface when the VM is deleted. + * + * @param deleteOption the deleteOption value to set. + * @return the VirtualMachineScaleSetUpdateNetworkConfiguration object itself. + */ + public VirtualMachineScaleSetUpdateNetworkConfiguration withDeleteOption(DeleteOptions deleteOption) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetUpdateNetworkConfigurationProperties(); + } + this.innerProperties().withDeleteOption(deleteOption); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().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..56f317d85e775 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetUpdateNetworkProfile.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a virtual machine scale set network profile. */ +@Fluent +public final class VirtualMachineScaleSetUpdateNetworkProfile { + /* + * A reference to a load balancer probe used to determine the health of an instance in the virtual machine scale + * set. The reference will be in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. + */ + @JsonProperty(value = "healthProbe") + private ApiEntityReference healthProbe; + + /* + * The list of network configurations. + */ + @JsonProperty(value = "networkInterfaceConfigurations") + private List networkInterfaceConfigurations; + + /* + * specifies the Microsoft.Network API version used when creating networking resources in the Network Interface + * Configurations for Virtual Machine Scale Set with orchestration mode 'Flexible' + */ + @JsonProperty(value = "networkApiVersion") + private NetworkApiVersion networkApiVersion; + + /** Creates an instance of VirtualMachineScaleSetUpdateNetworkProfile class. */ + public VirtualMachineScaleSetUpdateNetworkProfile() { + } + + /** + * Get the healthProbe property: A reference to a load balancer probe used to determine the health of an instance in + * the virtual machine scale set. The reference will be in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. + * + * @return the healthProbe value. + */ + public ApiEntityReference healthProbe() { + return this.healthProbe; + } + + /** + * Set the healthProbe property: A reference to a load balancer probe used to determine the health of an instance in + * the virtual machine scale set. The reference will be in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. + * + * @param healthProbe the healthProbe value to set. + * @return the VirtualMachineScaleSetUpdateNetworkProfile object itself. + */ + public VirtualMachineScaleSetUpdateNetworkProfile withHealthProbe(ApiEntityReference healthProbe) { + this.healthProbe = healthProbe; + return this; + } + + /** + * Get the networkInterfaceConfigurations property: The list of network configurations. + * + * @return the networkInterfaceConfigurations value. + */ + public List networkInterfaceConfigurations() { + return this.networkInterfaceConfigurations; + } + + /** + * Set the networkInterfaceConfigurations property: The list of network configurations. + * + * @param networkInterfaceConfigurations the networkInterfaceConfigurations value to set. + * @return the VirtualMachineScaleSetUpdateNetworkProfile object itself. + */ + public VirtualMachineScaleSetUpdateNetworkProfile withNetworkInterfaceConfigurations( + List networkInterfaceConfigurations) { + this.networkInterfaceConfigurations = networkInterfaceConfigurations; + return this; + } + + /** + * Get the networkApiVersion property: specifies the Microsoft.Network API version used when creating networking + * resources in the Network Interface Configurations for Virtual Machine Scale Set with orchestration mode + * 'Flexible'. + * + * @return the networkApiVersion value. + */ + public NetworkApiVersion networkApiVersion() { + return this.networkApiVersion; + } + + /** + * Set the networkApiVersion property: specifies the Microsoft.Network API version used when creating networking + * resources in the Network Interface Configurations for Virtual Machine Scale Set with orchestration mode + * 'Flexible'. + * + * @param networkApiVersion the networkApiVersion value to set. + * @return the VirtualMachineScaleSetUpdateNetworkProfile object itself. + */ + public VirtualMachineScaleSetUpdateNetworkProfile withNetworkApiVersion(NetworkApiVersion networkApiVersion) { + this.networkApiVersion = networkApiVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (healthProbe() != null) { + healthProbe().validate(); + } + if (networkInterfaceConfigurations() != null) { + networkInterfaceConfigurations().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetUpdateOSDisk.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetUpdateOSDisk.java new file mode 100644 index 0000000000000..8b7e4feef6de4 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetUpdateOSDisk.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.annotation.Fluent; +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 { + /* + * 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 an empty data disk in gigabytes. This element can be used to overwrite the size of the + * disk in a virtual machine image.

diskSizeGB is the number of bytes x 1024^3 for the disk and the value + * cannot be larger than 1023 + */ + @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; + + /* + * Specifies whether OS Disk should be deleted or detached upon VMSS Flex deletion (This feature is available for + * VMSS with Flexible OrchestrationMode only).

Possible values:

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

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

The default value is set to **Delete**. For an Ephemeral OS + * Disk, the default value is set to **Delete**. User cannot change the delete option for Ephemeral OS Disk. + */ + @JsonProperty(value = "deleteOption") + private DiskDeleteOptionTypes deleteOption; + + /** Creates an instance of VirtualMachineScaleSetUpdateOSDisk class. */ + public VirtualMachineScaleSetUpdateOSDisk() { + } + + /** + * 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 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> diskSizeGB is the number of bytes + * x 1024^3 for the disk and the value cannot be larger than 1023. + * + * @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> diskSizeGB is the number of bytes + * x 1024^3 for the disk and the value cannot be larger than 1023. + * + * @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; + } + + /** + * Get the deleteOption property: Specifies whether OS Disk should be deleted or detached upon VMSS Flex deletion + * (This feature is available for VMSS with Flexible OrchestrationMode only). <br><br> Possible values: + * <br><br> **Delete** If this value is used, the OS disk is deleted when VMSS Flex VM is + * deleted.<br><br> **Detach** If this value is used, the OS disk is retained after VMSS Flex VM is + * deleted. <br><br> The default value is set to **Delete**. For an Ephemeral OS Disk, the default value + * is set to **Delete**. User cannot change the delete option for Ephemeral OS Disk. + * + * @return the deleteOption value. + */ + public DiskDeleteOptionTypes deleteOption() { + return this.deleteOption; + } + + /** + * Set the deleteOption property: Specifies whether OS Disk should be deleted or detached upon VMSS Flex deletion + * (This feature is available for VMSS with Flexible OrchestrationMode only). <br><br> Possible values: + * <br><br> **Delete** If this value is used, the OS disk is deleted when VMSS Flex VM is + * deleted.<br><br> **Detach** If this value is used, the OS disk is retained after VMSS Flex VM is + * deleted. <br><br> The default value is set to **Delete**. For an Ephemeral OS Disk, the default value + * is set to **Delete**. User cannot change the delete option for Ephemeral OS Disk. + * + * @param deleteOption the deleteOption value to set. + * @return the VirtualMachineScaleSetUpdateOSDisk object itself. + */ + public VirtualMachineScaleSetUpdateOSDisk withDeleteOption(DiskDeleteOptionTypes deleteOption) { + this.deleteOption = deleteOption; + 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..4da3fce7d6f24 --- /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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a virtual machine scale set OS profile. */ +@Fluent +public final class VirtualMachineScaleSetUpdateOSProfile { + /* + * 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; + + /** Creates an instance of VirtualMachineScaleSetUpdateOSProfile class. */ + public VirtualMachineScaleSetUpdateOSProfile() { + } + + /** + * 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..3b391f399b65a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetUpdatePublicIpAddressConfiguration.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code 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.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetUpdatePublicIpAddressConfigurationProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a virtual machines scale set IP Configuration's PublicIPAddress configuration. */ +@Fluent +public final class VirtualMachineScaleSetUpdatePublicIpAddressConfiguration { + /* + * The publicIP address configuration name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Describes a virtual machines scale set IP Configuration's PublicIPAddress configuration + */ + @JsonProperty(value = "properties") + private VirtualMachineScaleSetUpdatePublicIpAddressConfigurationProperties innerProperties; + + /** Creates an instance of VirtualMachineScaleSetUpdatePublicIpAddressConfiguration class. */ + public VirtualMachineScaleSetUpdatePublicIpAddressConfiguration() { + } + + /** + * 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 innerProperties property: Describes a virtual machines scale set IP Configuration's PublicIPAddress + * configuration. + * + * @return the innerProperties value. + */ + private VirtualMachineScaleSetUpdatePublicIpAddressConfigurationProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the idleTimeoutInMinutes property: The idle timeout of the public IP address. + * + * @return the idleTimeoutInMinutes value. + */ + public Integer idleTimeoutInMinutes() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetUpdatePublicIpAddressConfigurationProperties(); + } + this.innerProperties().withIdleTimeoutInMinutes(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetUpdatePublicIpAddressConfigurationProperties(); + } + this.innerProperties().withDnsSettings(dnsSettings); + return this; + } + + /** + * Get the publicIpPrefix property: The PublicIPPrefix from which to allocate publicIP addresses. + * + * @return the publicIpPrefix value. + */ + public SubResource publicIpPrefix() { + return this.innerProperties() == null ? null : this.innerProperties().publicIpPrefix(); + } + + /** + * Set the publicIpPrefix property: The PublicIPPrefix from which to allocate publicIP addresses. + * + * @param publicIpPrefix the publicIpPrefix value to set. + * @return the VirtualMachineScaleSetUpdatePublicIpAddressConfiguration object itself. + */ + public VirtualMachineScaleSetUpdatePublicIpAddressConfiguration withPublicIpPrefix(SubResource publicIpPrefix) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetUpdatePublicIpAddressConfigurationProperties(); + } + this.innerProperties().withPublicIpPrefix(publicIpPrefix); + return this; + } + + /** + * Get the deleteOption property: Specify what happens to the public IP when the VM is deleted. + * + * @return the deleteOption value. + */ + public DeleteOptions deleteOption() { + return this.innerProperties() == null ? null : this.innerProperties().deleteOption(); + } + + /** + * Set the deleteOption property: Specify what happens to the public IP when the VM is deleted. + * + * @param deleteOption the deleteOption value to set. + * @return the VirtualMachineScaleSetUpdatePublicIpAddressConfiguration object itself. + */ + public VirtualMachineScaleSetUpdatePublicIpAddressConfiguration withDeleteOption(DeleteOptions deleteOption) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetUpdatePublicIpAddressConfigurationProperties(); + } + this.innerProperties().withDeleteOption(deleteOption); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().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..8f26fc36a0d62 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetUpdateStorageProfile.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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a virtual machine scale set storage profile. */ +@Fluent +public final class VirtualMachineScaleSetUpdateStorageProfile { + /* + * 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; + + /* + * The diskControllerType property. + */ + @JsonProperty(value = "diskControllerType") + private String diskControllerType; + + /** Creates an instance of VirtualMachineScaleSetUpdateStorageProfile class. */ + public VirtualMachineScaleSetUpdateStorageProfile() { + } + + /** + * 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; + } + + /** + * Get the diskControllerType property: The diskControllerType property. + * + * @return the diskControllerType value. + */ + public String diskControllerType() { + return this.diskControllerType; + } + + /** + * Set the diskControllerType property: The diskControllerType property. + * + * @param diskControllerType the diskControllerType value to set. + * @return the VirtualMachineScaleSetUpdateStorageProfile object itself. + */ + public VirtualMachineScaleSetUpdateStorageProfile withDiskControllerType(String diskControllerType) { + this.diskControllerType = diskControllerType; + 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..f9188da6c4588 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetUpdateVMProfile.java @@ -0,0 +1,349 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a virtual machine scale set virtual machine profile. */ +@Fluent +public final class VirtualMachineScaleSetUpdateVMProfile { + /* + * The virtual machine scale set OS profile. + */ + @JsonProperty(value = "osProfile") + private VirtualMachineScaleSetUpdateOSProfile osProfile; + + /* + * The virtual machine scale set storage profile. + */ + @JsonProperty(value = "storageProfile") + private VirtualMachineScaleSetUpdateStorageProfile storageProfile; + + /* + * The virtual machine scale set network profile. + */ + @JsonProperty(value = "networkProfile") + private VirtualMachineScaleSetUpdateNetworkProfile networkProfile; + + /* + * The virtual machine scale set Security profile + */ + @JsonProperty(value = "securityProfile") + private SecurityProfile securityProfile; + + /* + * The virtual machine scale set diagnostics profile. + */ + @JsonProperty(value = "diagnosticsProfile") + private DiagnosticsProfile diagnosticsProfile; + + /* + * The virtual machine scale set extension profile. + */ + @JsonProperty(value = "extensionProfile") + private VirtualMachineScaleSetExtensionProfile extensionProfile; + + /* + * The license type, which is for bring your own license scenario. + */ + @JsonProperty(value = "licenseType") + private String licenseType; + + /* + * Specifies the billing related details of a Azure Spot VMSS. Minimum api-version: 2019-03-01. + */ + @JsonProperty(value = "billingProfile") + private BillingProfile billingProfile; + + /* + * Specifies Scheduled Event related configurations. + */ + @JsonProperty(value = "scheduledEventsProfile") + private ScheduledEventsProfile scheduledEventsProfile; + + /* + * UserData for the VM, which must be base-64 encoded. Customer should not pass any secrets in here. + *

Minimum api-version: 2021-03-01 + */ + @JsonProperty(value = "userData") + private String userData; + + /* + * Specifies the hardware profile related details of a scale set. Minimum api-version: 2021-11-01. + */ + @JsonProperty(value = "hardwareProfile") + private VirtualMachineScaleSetHardwareProfile hardwareProfile; + + /** Creates an instance of VirtualMachineScaleSetUpdateVMProfile class. */ + public VirtualMachineScaleSetUpdateVMProfile() { + } + + /** + * 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. 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. Minimum api-version: + * 2019-03-01. + * + * @param billingProfile the billingProfile value to set. + * @return the VirtualMachineScaleSetUpdateVMProfile object itself. + */ + public VirtualMachineScaleSetUpdateVMProfile withBillingProfile(BillingProfile billingProfile) { + this.billingProfile = billingProfile; + return this; + } + + /** + * Get the scheduledEventsProfile property: Specifies Scheduled Event related configurations. + * + * @return the scheduledEventsProfile value. + */ + public ScheduledEventsProfile scheduledEventsProfile() { + return this.scheduledEventsProfile; + } + + /** + * Set the scheduledEventsProfile property: Specifies Scheduled Event related configurations. + * + * @param scheduledEventsProfile the scheduledEventsProfile value to set. + * @return the VirtualMachineScaleSetUpdateVMProfile object itself. + */ + public VirtualMachineScaleSetUpdateVMProfile withScheduledEventsProfile( + ScheduledEventsProfile scheduledEventsProfile) { + this.scheduledEventsProfile = scheduledEventsProfile; + return this; + } + + /** + * Get the userData property: UserData for the VM, which must be base-64 encoded. Customer should not pass any + * secrets in here. <br><br>Minimum api-version: 2021-03-01. + * + * @return the userData value. + */ + public String userData() { + return this.userData; + } + + /** + * Set the userData property: UserData for the VM, which must be base-64 encoded. Customer should not pass any + * secrets in here. <br><br>Minimum api-version: 2021-03-01. + * + * @param userData the userData value to set. + * @return the VirtualMachineScaleSetUpdateVMProfile object itself. + */ + public VirtualMachineScaleSetUpdateVMProfile withUserData(String userData) { + this.userData = userData; + return this; + } + + /** + * Get the hardwareProfile property: Specifies the hardware profile related details of a scale set. Minimum + * api-version: 2021-11-01. + * + * @return the hardwareProfile value. + */ + public VirtualMachineScaleSetHardwareProfile hardwareProfile() { + return this.hardwareProfile; + } + + /** + * Set the hardwareProfile property: Specifies the hardware profile related details of a scale set. Minimum + * api-version: 2021-11-01. + * + * @param hardwareProfile the hardwareProfile value to set. + * @return the VirtualMachineScaleSetUpdateVMProfile object itself. + */ + public VirtualMachineScaleSetUpdateVMProfile withHardwareProfile( + VirtualMachineScaleSetHardwareProfile hardwareProfile) { + this.hardwareProfile = hardwareProfile; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (osProfile() != null) { + osProfile().validate(); + } + if (storageProfile() != null) { + storageProfile().validate(); + } + if (networkProfile() != null) { + networkProfile().validate(); + } + if (securityProfile() != null) { + securityProfile().validate(); + } + if (diagnosticsProfile() != null) { + diagnosticsProfile().validate(); + } + if (extensionProfile() != null) { + extensionProfile().validate(); + } + if (billingProfile() != null) { + billingProfile().validate(); + } + if (scheduledEventsProfile() != null) { + scheduledEventsProfile().validate(); + } + if (hardwareProfile() != null) { + hardwareProfile().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..f4cf999d08700 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVM.java @@ -0,0 +1,248 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.time.OffsetDateTime; +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 identity property: The identity of the virtual machine, if configured. + * + * @return the identity value. + */ + VirtualMachineIdentity identity(); + + /** + * 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. Minimum api-version: + * 2015-06-15. + * + * @return the diagnosticsProfile value. + */ + DiagnosticsProfile diagnosticsProfile(); + + /** + * Gets the availabilitySet property: Specifies information about the availability set that the virtual machine + * should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes + * to maximize availability. For more information about availability sets, see [Availability sets + * overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). For more information on + * Azure planned maintenance, see [Maintenance and updates for Virtual Machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates). Currently, a VM can only be + * added to availability set at creation time. An existing VM cannot be added to an availability set. + * + * @return the availabilitySet value. + */ + SubResource availabilitySet(); + + /** + * Gets the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the licenseType property: Specifies that the image or disk that is being used was licensed on-premises. + * <br><br> Possible values for Windows Server operating system are: <br><br> Windows_Client + * <br><br> Windows_Server <br><br> Possible values for Linux Server operating system are: + * <br><br> RHEL_BYOS (for RHEL) <br><br> SLES_BYOS (for SUSE) <br><br> For more + * information, see [Azure Hybrid Use Benefit for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) + * <br><br> [Azure Hybrid Use Benefit for Linux + * Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) <br><br> + * Minimum api-version: 2015-06-15. + * + * @return the licenseType value. + */ + String licenseType(); + + /** + * Gets the modelDefinitionApplied property: Specifies whether the model applied to the virtual machine is the model + * of the virtual machine scale set or the customized model for the virtual machine. + * + * @return the modelDefinitionApplied value. + */ + String modelDefinitionApplied(); + + /** + * Gets the protectionPolicy property: Specifies the protection policy of the virtual machine. + * + * @return the protectionPolicy value. + */ + VirtualMachineScaleSetVMProtectionPolicy protectionPolicy(); + + /** + * Gets the userData property: UserData for the VM, which must be base-64 encoded. Customer should not pass any + * secrets in here. <br><br>Minimum api-version: 2021-03-01. + * + * @return the userData value. + */ + String userData(); + + /** + * Gets the timeCreated property: Specifies the time at which the Virtual Machine resource was created. + * + * @return the timeCreated value. + */ + OffsetDateTime timeCreated(); + + /** + * 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..df0908e44ed31 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMExtension.java @@ -0,0 +1,560 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.VirtualMachineScaleSetVMExtensionInner; +import java.util.List; + +/** 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 location property: The location of the extension. + * + * @return the location value. + */ + String location(); + + /** + * 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 suppressFailures property: Indicates whether failures stemming from the extension will be suppressed + * (Operational failures such as not connecting to the VM will not be suppressed regardless of this value). The + * default is false. + * + * @return the suppressFailures value. + */ + Boolean suppressFailures(); + + /** + * Gets the protectedSettingsFromKeyVault property: The extensions protected settings that are passed by reference, + * and consumed from key vault. + * + * @return the protectedSettingsFromKeyVault value. + */ + KeyVaultSecretReference protectedSettingsFromKeyVault(); + + /** + * Gets the provisionAfterExtensions property: Collection of extension names after which this extension needs to be + * provisioned. + * + * @return the provisionAfterExtensions value. + */ + List provisionAfterExtensions(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.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.WithLocation, + DefinitionStages.WithForceUpdateTag, + DefinitionStages.WithPublisher, + DefinitionStages.WithTypePropertiesType, + DefinitionStages.WithTypeHandlerVersion, + DefinitionStages.WithAutoUpgradeMinorVersion, + DefinitionStages.WithEnableAutomaticUpgrade, + DefinitionStages.WithSettings, + DefinitionStages.WithProtectedSettings, + DefinitionStages.WithInstanceView, + DefinitionStages.WithSuppressFailures, + DefinitionStages.WithProtectedSettingsFromKeyVault, + DefinitionStages.WithProvisionAfterExtensions { + /** + * 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 location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The location of the extension. + * @return the next definition stage. + */ + WithCreate withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The location of the extension. + * @return the next definition stage. + */ + WithCreate withRegion(String location); + } + /** 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); + } + /** The stage of the VirtualMachineScaleSetVMExtension definition allowing to specify suppressFailures. */ + interface WithSuppressFailures { + /** + * Specifies the suppressFailures property: Indicates whether failures stemming from the extension will be + * suppressed (Operational failures such as not connecting to the VM will not be suppressed regardless of + * this value). The default is false.. + * + * @param suppressFailures Indicates whether failures stemming from the extension will be suppressed + * (Operational failures such as not connecting to the VM will not be suppressed regardless of this + * value). The default is false. + * @return the next definition stage. + */ + WithCreate withSuppressFailures(Boolean suppressFailures); + } + /** + * The stage of the VirtualMachineScaleSetVMExtension definition allowing to specify + * protectedSettingsFromKeyVault. + */ + interface WithProtectedSettingsFromKeyVault { + /** + * Specifies the protectedSettingsFromKeyVault property: The extensions protected settings that are passed + * by reference, and consumed from key vault. + * + * @param protectedSettingsFromKeyVault The extensions protected settings that are passed by reference, and + * consumed from key vault. + * @return the next definition stage. + */ + WithCreate withProtectedSettingsFromKeyVault(KeyVaultSecretReference protectedSettingsFromKeyVault); + } + /** + * The stage of the VirtualMachineScaleSetVMExtension 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 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, + UpdateStages.WithSuppressFailures, + UpdateStages.WithProtectedSettingsFromKeyVault { + /** + * 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); + } + /** The stage of the VirtualMachineScaleSetVMExtension update allowing to specify suppressFailures. */ + interface WithSuppressFailures { + /** + * Specifies the suppressFailures property: Indicates whether failures stemming from the extension will be + * suppressed (Operational failures such as not connecting to the VM will not be suppressed regardless of + * this value). The default is false.. + * + * @param suppressFailures Indicates whether failures stemming from the extension will be suppressed + * (Operational failures such as not connecting to the VM will not be suppressed regardless of this + * value). The default is false. + * @return the next definition stage. + */ + Update withSuppressFailures(Boolean suppressFailures); + } + /** + * The stage of the VirtualMachineScaleSetVMExtension update allowing to specify protectedSettingsFromKeyVault. + */ + interface WithProtectedSettingsFromKeyVault { + /** + * Specifies the protectedSettingsFromKeyVault property: The extensions protected settings that are passed + * by reference, and consumed from key vault. + * + * @param protectedSettingsFromKeyVault The extensions protected settings that are passed by reference, and + * consumed from key vault. + * @return the next definition stage. + */ + Update withProtectedSettingsFromKeyVault(KeyVaultSecretReference protectedSettingsFromKeyVault); + } + } + /** + * 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..b5b6ea3319fff --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMExtensionUpdate.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.annotation.Fluent; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineExtensionUpdateProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a VMSS VM Extension. */ +@Fluent +public final class VirtualMachineScaleSetVMExtensionUpdate extends SubResourceReadOnly { + /* + * 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; + + /* + * Describes the properties of a Virtual Machine Extension. + */ + @JsonProperty(value = "properties") + private VirtualMachineExtensionUpdateProperties innerProperties; + + /** Creates an instance of VirtualMachineScaleSetVMExtensionUpdate class. */ + public VirtualMachineScaleSetVMExtensionUpdate() { + } + + /** + * 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 innerProperties property: Describes the properties of a Virtual Machine Extension. + * + * @return the innerProperties value. + */ + private VirtualMachineExtensionUpdateProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineExtensionUpdateProperties(); + } + this.innerProperties().withForceUpdateTag(forceUpdateTag); + return this; + } + + /** + * Get the publisher property: The name of the extension handler publisher. + * + * @return the publisher value. + */ + public String publisher() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineExtensionUpdateProperties(); + } + this.innerProperties().withPublisher(publisher); + return this; + } + + /** + * Get the type property: Specifies the type of the extension; an example is "CustomScriptExtension". + * + * @return the type value. + */ + public String typePropertiesType() { + return this.innerProperties() == null ? null : this.innerProperties().type(); + } + + /** + * Set the type property: Specifies the type of the extension; an example is "CustomScriptExtension". + * + * @param type the type value to set. + * @return the VirtualMachineScaleSetVMExtensionUpdate object itself. + */ + public VirtualMachineScaleSetVMExtensionUpdate withTypePropertiesType(String type) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineExtensionUpdateProperties(); + } + this.innerProperties().withType(type); + return this; + } + + /** + * Get the typeHandlerVersion property: Specifies the version of the script handler. + * + * @return the typeHandlerVersion value. + */ + public String typeHandlerVersion() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineExtensionUpdateProperties(); + } + this.innerProperties().withTypeHandlerVersion(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineExtensionUpdateProperties(); + } + this.innerProperties().withAutoUpgradeMinorVersion(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineExtensionUpdateProperties(); + } + this.innerProperties().withEnableAutomaticUpgrade(enableAutomaticUpgrade); + return this; + } + + /** + * Get the settings property: Json formatted public settings for the extension. + * + * @return the settings value. + */ + public Object settings() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineExtensionUpdateProperties(); + } + this.innerProperties().withSettings(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineExtensionUpdateProperties(); + } + this.innerProperties().withProtectedSettings(protectedSettings); + return this; + } + + /** + * Get the suppressFailures property: Indicates whether failures stemming from the extension will be suppressed + * (Operational failures such as not connecting to the VM will not be suppressed regardless of this value). The + * default is false. + * + * @return the suppressFailures value. + */ + public Boolean suppressFailures() { + return this.innerProperties() == null ? null : this.innerProperties().suppressFailures(); + } + + /** + * Set the suppressFailures property: Indicates whether failures stemming from the extension will be suppressed + * (Operational failures such as not connecting to the VM will not be suppressed regardless of this value). The + * default is false. + * + * @param suppressFailures the suppressFailures value to set. + * @return the VirtualMachineScaleSetVMExtensionUpdate object itself. + */ + public VirtualMachineScaleSetVMExtensionUpdate withSuppressFailures(Boolean suppressFailures) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineExtensionUpdateProperties(); + } + this.innerProperties().withSuppressFailures(suppressFailures); + return this; + } + + /** + * Get the protectedSettingsFromKeyVault property: The extensions protected settings that are passed by reference, + * and consumed from key vault. + * + * @return the protectedSettingsFromKeyVault value. + */ + public KeyVaultSecretReference protectedSettingsFromKeyVault() { + return this.innerProperties() == null ? null : this.innerProperties().protectedSettingsFromKeyVault(); + } + + /** + * Set the protectedSettingsFromKeyVault property: The extensions protected settings that are passed by reference, + * and consumed from key vault. + * + * @param protectedSettingsFromKeyVault the protectedSettingsFromKeyVault value to set. + * @return the VirtualMachineScaleSetVMExtensionUpdate object itself. + */ + public VirtualMachineScaleSetVMExtensionUpdate withProtectedSettingsFromKeyVault( + KeyVaultSecretReference protectedSettingsFromKeyVault) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineExtensionUpdateProperties(); + } + this.innerProperties().withProtectedSettingsFromKeyVault(protectedSettingsFromKeyVault); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().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..e665dd8163ef4 --- /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. + * @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 along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String vmExtensionName, + String expand, + 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 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 along with {@link Response}. + */ + Response listWithResponse( + String resourceGroupName, String vmScaleSetName, String instanceId, 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 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..d02facca3d13e --- /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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Extensions summary for virtual machines of a virtual machine scale set. */ +@Immutable +public final class VirtualMachineScaleSetVMExtensionsSummary { + /* + * 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; + + /** Creates an instance of VirtualMachineScaleSetVMExtensionsSummary class. */ + public VirtualMachineScaleSetVMExtensionsSummary() { + } + + /** + * 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..62a2adadf2ef0 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMInstanceIDs.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.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 { + /* + * 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; + + /** Creates an instance of VirtualMachineScaleSetVMInstanceIDs class. */ + public VirtualMachineScaleSetVMInstanceIDs() { + } + + /** + * 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..992cb701975bf --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMInstanceRequiredIDs.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.JsonProperty; +import java.util.List; + +/** Specifies a list of virtual machine instance IDs from the VM scale set. */ +@Fluent +public final class VirtualMachineScaleSetVMInstanceRequiredIDs { + /* + * The virtual machine scale set instance ids. + */ + @JsonProperty(value = "instanceIds", required = true) + private List instanceIds; + + /** Creates an instance of VirtualMachineScaleSetVMInstanceRequiredIDs class. */ + public VirtualMachineScaleSetVMInstanceRequiredIDs() { + } + + /** + * 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")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VirtualMachineScaleSetVMInstanceRequiredIDs.class); +} 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..d08c033bd81a8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMInstanceView.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.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. You can easily view the output of your console log. 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. 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 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. + */ + String computerName(); + + /** + * Gets the osName property: The Operating System running on the hybrid machine. + * + * @return the osName value. + */ + String osName(); + + /** + * Gets the osVersion property: The version of Operating System running on the hybrid machine. + * + * @return the osVersion value. + */ + String osVersion(); + + /** + * Gets the hyperVGeneration property: The hypervisor generation of the Virtual Machine [V1, V2]. + * + * @return the hyperVGeneration value. + */ + HyperVGeneration hyperVGeneration(); + + /** + * 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..5127cc433b187 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMListResult.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.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetVMInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List Virtual Machine Scale Set VMs operation response. */ +@Fluent +public final class VirtualMachineScaleSetVMListResult { + /* + * 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; + + /** Creates an instance of VirtualMachineScaleSetVMListResult class. */ + public VirtualMachineScaleSetVMListResult() { + } + + /** + * 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()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VirtualMachineScaleSetVMListResult.class); +} 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..bd1702cedd284 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMNetworkProfileConfiguration.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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a virtual machine scale set VM network profile. */ +@Fluent +public final class VirtualMachineScaleSetVMNetworkProfileConfiguration { + /* + * The list of network configurations. + */ + @JsonProperty(value = "networkInterfaceConfigurations") + private List networkInterfaceConfigurations; + + /** Creates an instance of VirtualMachineScaleSetVMNetworkProfileConfiguration class. */ + public VirtualMachineScaleSetVMNetworkProfileConfiguration() { + } + + /** + * 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..43bdf856a1cb7 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMProfile.java @@ -0,0 +1,569 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a virtual machine scale set virtual machine profile. */ +@Fluent +public final class VirtualMachineScaleSetVMProfile { + /* + * Specifies the operating system settings for the virtual machines in the scale set. + */ + @JsonProperty(value = "osProfile") + private VirtualMachineScaleSetOSProfile osProfile; + + /* + * Specifies the storage settings for the virtual machine disks. + */ + @JsonProperty(value = "storageProfile") + private VirtualMachineScaleSetStorageProfile storageProfile; + + /* + * Specifies properties of the network interfaces of the virtual machines in the scale set. + */ + @JsonProperty(value = "networkProfile") + private VirtualMachineScaleSetNetworkProfile networkProfile; + + /* + * Specifies the Security related profile settings for the virtual machines in the scale set. + */ + @JsonProperty(value = "securityProfile") + private SecurityProfile securityProfile; + + /* + * Specifies the boot diagnostic settings state. Minimum api-version: 2015-06-15. + */ + @JsonProperty(value = "diagnosticsProfile") + private DiagnosticsProfile diagnosticsProfile; + + /* + * Specifies a collection of settings for extensions installed on virtual machines in the scale set. + */ + @JsonProperty(value = "extensionProfile") + private VirtualMachineScaleSetExtensionProfile extensionProfile; + + /* + * Specifies that the image or disk that is being used was licensed on-premises.

Possible values for + * Windows Server operating system are:

Windows_Client

Windows_Server

Possible values + * for Linux Server operating system are:

RHEL_BYOS (for RHEL)

SLES_BYOS (for SUSE)

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

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

Minimum + * api-version: 2015-06-15 + */ + @JsonProperty(value = "licenseType") + private String licenseType; + + /* + * Specifies the priority for the virtual machines in the scale set. Minimum api-version: 2017-10-30-preview. + */ + @JsonProperty(value = "priority") + private VirtualMachinePriorityTypes priority; + + /* + * Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot scale set. For Azure Spot + * virtual machines, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2019-03-01. For + * Azure Spot scale sets, both 'Deallocate' and 'Delete' are supported and the minimum api-version is + * 2017-10-30-preview. + */ + @JsonProperty(value = "evictionPolicy") + private VirtualMachineEvictionPolicyTypes evictionPolicy; + + /* + * Specifies the billing related details of a Azure Spot VMSS. Minimum api-version: 2019-03-01. + */ + @JsonProperty(value = "billingProfile") + private BillingProfile billingProfile; + + /* + * Specifies Scheduled Event related configurations. + */ + @JsonProperty(value = "scheduledEventsProfile") + private ScheduledEventsProfile scheduledEventsProfile; + + /* + * UserData for the virtual machines in the scale set, which must be base-64 encoded. Customer should not pass any + * secrets in here. Minimum api-version: 2021-03-01. + */ + @JsonProperty(value = "userData") + private String userData; + + /* + * Specifies the capacity reservation related details of a scale set. Minimum api-version: 2021-04-01. + */ + @JsonProperty(value = "capacityReservation") + private CapacityReservationProfile capacityReservation; + + /* + * Specifies the gallery applications that should be made available to the VM/VMSS + */ + @JsonProperty(value = "applicationProfile") + private ApplicationProfile applicationProfile; + + /* + * Specifies the hardware profile related details of a scale set. Minimum api-version: 2021-11-01. + */ + @JsonProperty(value = "hardwareProfile") + private VirtualMachineScaleSetHardwareProfile hardwareProfile; + + /* + * Specifies the service artifact reference id used to set same image version for all virtual machines in the scale + * set when using 'latest' image version. Minimum api-version: 2022-11-01 + */ + @JsonProperty(value = "serviceArtifactReference") + private ServiceArtifactReference serviceArtifactReference; + + /* + * Specifies the security posture to be used for all virtual machines in the scale set. Minimum api-version: + * 2023-03-01 + */ + @JsonProperty(value = "securityPostureReference") + private SecurityPostureReference securityPostureReference; + + /** Creates an instance of VirtualMachineScaleSetVMProfile class. */ + public VirtualMachineScaleSetVMProfile() { + } + + /** + * 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. 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. 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. 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. 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. 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. + * + * @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. 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. + * + * @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. 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. Minimum api-version: + * 2019-03-01. + * + * @param billingProfile the billingProfile value to set. + * @return the VirtualMachineScaleSetVMProfile object itself. + */ + public VirtualMachineScaleSetVMProfile withBillingProfile(BillingProfile billingProfile) { + this.billingProfile = billingProfile; + return this; + } + + /** + * Get the scheduledEventsProfile property: Specifies Scheduled Event related configurations. + * + * @return the scheduledEventsProfile value. + */ + public ScheduledEventsProfile scheduledEventsProfile() { + return this.scheduledEventsProfile; + } + + /** + * Set the scheduledEventsProfile property: Specifies Scheduled Event related configurations. + * + * @param scheduledEventsProfile the scheduledEventsProfile value to set. + * @return the VirtualMachineScaleSetVMProfile object itself. + */ + public VirtualMachineScaleSetVMProfile withScheduledEventsProfile(ScheduledEventsProfile scheduledEventsProfile) { + this.scheduledEventsProfile = scheduledEventsProfile; + return this; + } + + /** + * Get the userData property: UserData for the virtual machines in the scale set, which must be base-64 encoded. + * Customer should not pass any secrets in here. Minimum api-version: 2021-03-01. + * + * @return the userData value. + */ + public String userData() { + return this.userData; + } + + /** + * Set the userData property: UserData for the virtual machines in the scale set, which must be base-64 encoded. + * Customer should not pass any secrets in here. Minimum api-version: 2021-03-01. + * + * @param userData the userData value to set. + * @return the VirtualMachineScaleSetVMProfile object itself. + */ + public VirtualMachineScaleSetVMProfile withUserData(String userData) { + this.userData = userData; + return this; + } + + /** + * Get the capacityReservation property: Specifies the capacity reservation related details of a scale set. Minimum + * api-version: 2021-04-01. + * + * @return the capacityReservation value. + */ + public CapacityReservationProfile capacityReservation() { + return this.capacityReservation; + } + + /** + * Set the capacityReservation property: Specifies the capacity reservation related details of a scale set. Minimum + * api-version: 2021-04-01. + * + * @param capacityReservation the capacityReservation value to set. + * @return the VirtualMachineScaleSetVMProfile object itself. + */ + public VirtualMachineScaleSetVMProfile withCapacityReservation(CapacityReservationProfile capacityReservation) { + this.capacityReservation = capacityReservation; + return this; + } + + /** + * Get the applicationProfile property: Specifies the gallery applications that should be made available to the + * VM/VMSS. + * + * @return the applicationProfile value. + */ + public ApplicationProfile applicationProfile() { + return this.applicationProfile; + } + + /** + * Set the applicationProfile property: Specifies the gallery applications that should be made available to the + * VM/VMSS. + * + * @param applicationProfile the applicationProfile value to set. + * @return the VirtualMachineScaleSetVMProfile object itself. + */ + public VirtualMachineScaleSetVMProfile withApplicationProfile(ApplicationProfile applicationProfile) { + this.applicationProfile = applicationProfile; + return this; + } + + /** + * Get the hardwareProfile property: Specifies the hardware profile related details of a scale set. Minimum + * api-version: 2021-11-01. + * + * @return the hardwareProfile value. + */ + public VirtualMachineScaleSetHardwareProfile hardwareProfile() { + return this.hardwareProfile; + } + + /** + * Set the hardwareProfile property: Specifies the hardware profile related details of a scale set. Minimum + * api-version: 2021-11-01. + * + * @param hardwareProfile the hardwareProfile value to set. + * @return the VirtualMachineScaleSetVMProfile object itself. + */ + public VirtualMachineScaleSetVMProfile withHardwareProfile(VirtualMachineScaleSetHardwareProfile hardwareProfile) { + this.hardwareProfile = hardwareProfile; + return this; + } + + /** + * Get the serviceArtifactReference property: Specifies the service artifact reference id used to set same image + * version for all virtual machines in the scale set when using 'latest' image version. Minimum api-version: + * 2022-11-01. + * + * @return the serviceArtifactReference value. + */ + public ServiceArtifactReference serviceArtifactReference() { + return this.serviceArtifactReference; + } + + /** + * Set the serviceArtifactReference property: Specifies the service artifact reference id used to set same image + * version for all virtual machines in the scale set when using 'latest' image version. Minimum api-version: + * 2022-11-01. + * + * @param serviceArtifactReference the serviceArtifactReference value to set. + * @return the VirtualMachineScaleSetVMProfile object itself. + */ + public VirtualMachineScaleSetVMProfile withServiceArtifactReference( + ServiceArtifactReference serviceArtifactReference) { + this.serviceArtifactReference = serviceArtifactReference; + return this; + } + + /** + * Get the securityPostureReference property: Specifies the security posture to be used for all virtual machines in + * the scale set. Minimum api-version: 2023-03-01. + * + * @return the securityPostureReference value. + */ + public SecurityPostureReference securityPostureReference() { + return this.securityPostureReference; + } + + /** + * Set the securityPostureReference property: Specifies the security posture to be used for all virtual machines in + * the scale set. Minimum api-version: 2023-03-01. + * + * @param securityPostureReference the securityPostureReference value to set. + * @return the VirtualMachineScaleSetVMProfile object itself. + */ + public VirtualMachineScaleSetVMProfile withSecurityPostureReference( + SecurityPostureReference securityPostureReference) { + this.securityPostureReference = securityPostureReference; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (osProfile() != null) { + osProfile().validate(); + } + if (storageProfile() != null) { + storageProfile().validate(); + } + if (networkProfile() != null) { + networkProfile().validate(); + } + if (securityProfile() != null) { + securityProfile().validate(); + } + if (diagnosticsProfile() != null) { + diagnosticsProfile().validate(); + } + if (extensionProfile() != null) { + extensionProfile().validate(); + } + if (billingProfile() != null) { + billingProfile().validate(); + } + if (scheduledEventsProfile() != null) { + scheduledEventsProfile().validate(); + } + if (capacityReservation() != null) { + capacityReservation().validate(); + } + if (applicationProfile() != null) { + applicationProfile().validate(); + } + if (hardwareProfile() != null) { + hardwareProfile().validate(); + } + if (serviceArtifactReference() != null) { + serviceArtifactReference().validate(); + } + if (securityPostureReference() != null) { + securityPostureReference().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMProperties.java new file mode 100644 index 0000000000000..997ffbe77b289 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMProperties.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.management.SubResource; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetVMPropertiesInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of VirtualMachineScaleSetVMProperties. */ +public interface VirtualMachineScaleSetVMProperties { + /** + * 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. Minimum api-version: + * 2015-06-15. + * + * @return the diagnosticsProfile value. + */ + DiagnosticsProfile diagnosticsProfile(); + + /** + * Gets the availabilitySet property: Specifies information about the availability set that the virtual machine + * should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes + * to maximize availability. For more information about availability sets, see [Availability sets + * overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). For more information on + * Azure planned maintenance, see [Maintenance and updates for Virtual Machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates). Currently, a VM can only be + * added to availability set at creation time. An existing VM cannot be added to an availability set. + * + * @return the availabilitySet value. + */ + SubResource availabilitySet(); + + /** + * Gets the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the licenseType property: Specifies that the image or disk that is being used was licensed on-premises. + * <br><br> Possible values for Windows Server operating system are: <br><br> Windows_Client + * <br><br> Windows_Server <br><br> Possible values for Linux Server operating system are: + * <br><br> RHEL_BYOS (for RHEL) <br><br> SLES_BYOS (for SUSE) <br><br> For more + * information, see [Azure Hybrid Use Benefit for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) + * <br><br> [Azure Hybrid Use Benefit for Linux + * Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) <br><br> + * Minimum api-version: 2015-06-15. + * + * @return the licenseType value. + */ + String licenseType(); + + /** + * Gets the modelDefinitionApplied property: Specifies whether the model applied to the virtual machine is the model + * of the virtual machine scale set or the customized model for the virtual machine. + * + * @return the modelDefinitionApplied value. + */ + String modelDefinitionApplied(); + + /** + * Gets the protectionPolicy property: Specifies the protection policy of the virtual machine. + * + * @return the protectionPolicy value. + */ + VirtualMachineScaleSetVMProtectionPolicy protectionPolicy(); + + /** + * Gets the userData property: UserData for the VM, which must be base-64 encoded. Customer should not pass any + * secrets in here. <br><br>Minimum api-version: 2021-03-01. + * + * @return the userData value. + */ + String userData(); + + /** + * Gets the timeCreated property: Specifies the time at which the Virtual Machine resource was created. + * + * @return the timeCreated value. + */ + OffsetDateTime timeCreated(); + + /** + * Gets the inner com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetVMPropertiesInner + * object. + * + * @return the inner object. + */ + VirtualMachineScaleSetVMPropertiesInner innerModel(); +} 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..769a27b5be89d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMProtectionPolicy.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.fasterxml.jackson.annotation.JsonProperty; + +/** The protection policy of a virtual machine scale set VM. */ +@Fluent +public final class VirtualMachineScaleSetVMProtectionPolicy { + /* + * 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; + + /** Creates an instance of VirtualMachineScaleSetVMProtectionPolicy class. */ + public VirtualMachineScaleSetVMProtectionPolicy() { + } + + /** + * 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..535a907216fae --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMReimageParameters.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.annotation.Fluent; + +/** Describes a Virtual Machine Scale Set VM Reimage Parameters. */ +@Fluent +public class VirtualMachineScaleSetVMReimageParameters extends VirtualMachineReimageParameters { + /** Creates an instance of VirtualMachineScaleSetVMReimageParameters class. */ + public VirtualMachineScaleSetVMReimageParameters() { + } + + /** {@inheritDoc} */ + @Override + public VirtualMachineScaleSetVMReimageParameters withTempDisk(Boolean tempDisk) { + super.withTempDisk(tempDisk); + return this; + } + + /** {@inheritDoc} */ + @Override + public VirtualMachineScaleSetVMReimageParameters withExactVersion(String exactVersion) { + super.withExactVersion(exactVersion); + return this; + } + + /** {@inheritDoc} */ + @Override + public VirtualMachineScaleSetVMReimageParameters withOsProfile(OSProfileProvisioningData osProfile) { + super.withOsProfile(osProfile); + 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..4684ed5fe71c2 --- /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. + * @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 along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String runCommandName, + String expand, + 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 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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..6b1bc7e51a32f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMs.java @@ -0,0 +1,514 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void reimage(String resourceGroupName, String 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void reimage( + String resourceGroupName, + String 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.resourcemanager.compute.generated.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 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.resourcemanager.compute.generated.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 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.resourcemanager.compute.generated.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 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.resourcemanager.compute.generated.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 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.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); + + /** + * 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.resourcemanager.compute.generated.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, 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. + * @param expand The expand expression to apply on the operation. 'InstanceView' will retrieve the instance view of + * the virtual machine. 'UserData' will retrieve the UserData of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String vmScaleSetName, String instanceId, InstanceViewTypes expand, 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.resourcemanager.compute.generated.models.ApiErrorException 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 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.resourcemanager.compute.generated.models.ApiErrorException 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 along with {@link Response}. + */ + Response getInstanceViewWithResponse( + String resourceGroupName, String vmScaleSetName, String instanceId, 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.resourcemanager.compute.generated.models.ApiErrorException 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 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.resourcemanager.compute.generated.models.ApiErrorException thrown if 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 as paginated response with {@link PagedIterable}. + */ + 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.resourcemanager.compute.generated.models.ApiErrorException thrown if 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 as paginated response with {@link PagedIterable}. + */ + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void powerOff(String resourceGroupName, String 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void powerOff( + String resourceGroupName, String 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void restart(String resourceGroupName, String 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void restart(String resourceGroupName, String 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(String resourceGroupName, String 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(String resourceGroupName, String 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.resourcemanager.compute.generated.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 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.resourcemanager.compute.generated.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 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. + * @param sasUriExpirationTimeInMinutes Expiration duration in minutes for the SAS URIs with a value between 1 to + * 1440 minutes. **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 along with {@link Response}. + */ + Response retrieveBootDiagnosticsDataWithResponse( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + Integer sasUriExpirationTimeInMinutes, + 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); + + /** + * 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.resourcemanager.compute.generated.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 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.resourcemanager.compute.generated.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 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response simulateEvictionWithResponse( + 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.resourcemanager.compute.generated.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 simulateEviction(String resourceGroupName, String vmScaleSetName, String instanceId); + + /** + * 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..1de9a1eeb4717 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSets.java @@ -0,0 +1,751 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 as paginated response + * with {@link PagedIterable}. + */ + 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 as paginated response + * with {@link PagedIterable}. + */ + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.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); + + /** + * 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.resourcemanager.compute.generated.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, 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. + * @param expand The expand expression to apply on the operation. 'UserData' retrieves the UserData property of the + * VM scale set that was provided by the user during the VM scale set Create/Update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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 along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String vmScaleSetName, ExpandTypesForGetVMScaleSets expand, 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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); + + /** + * 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.resourcemanager.compute.generated.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 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 hibernate Optional parameter to hibernate a virtual machine from the VM scale set. (This feature is + * available for VMSS with Flexible OrchestrationMode only). + * @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.resourcemanager.compute.generated.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 deallocate( + String resourceGroupName, + String vmScaleSetName, + Boolean hibernate, + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteInstances( + String resourceGroupName, String 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteInstances( + String resourceGroupName, + String 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 along with {@link Response}. + */ + Response getInstanceViewWithResponse( + String resourceGroupName, String vmScaleSetName, 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.resourcemanager.compute.generated.models.ApiErrorException 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 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.resourcemanager.compute.generated.models.ApiErrorException thrown if 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 as paginated response with {@link PagedIterable}. + */ + 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.resourcemanager.compute.generated.models.ApiErrorException thrown if 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 as paginated response with {@link PagedIterable}. + */ + 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.resourcemanager.compute.generated.models.ApiErrorException thrown if 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 as paginated + * response with {@link PagedIterable}. + */ + 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.resourcemanager.compute.generated.models.ApiErrorException thrown if 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 as paginated + * response with {@link PagedIterable}. + */ + 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.resourcemanager.compute.generated.models.ApiErrorException thrown if 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 as paginated response with {@link PagedIterable}. + */ + 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.resourcemanager.compute.generated.models.ApiErrorException thrown if 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 as paginated response with {@link PagedIterable}. + */ + 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.resourcemanager.compute.generated.models.ApiErrorException 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 as paginated response with {@link PagedIterable}. + */ + 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.resourcemanager.compute.generated.models.ApiErrorException 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 as paginated response with {@link PagedIterable}. + */ + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void powerOff(String resourceGroupName, String 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void powerOff( + String resourceGroupName, + String 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void restart(String resourceGroupName, String 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void restart( + String resourceGroupName, + String 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(String resourceGroupName, String 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context); + + /** + * Reapplies the Virtual Machine Scale Set Virtual Machine Profile to the Virtual Machine Instances. + * + * @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.resourcemanager.compute.generated.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 vmScaleSetName); + + /** + * Reapplies the Virtual Machine Scale Set Virtual Machine Profile to the Virtual Machine Instances. + * + * @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.resourcemanager.compute.generated.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 vmScaleSetName, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.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 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.resourcemanager.compute.generated.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 redeploy( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context); + + /** + * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not + * eligible for perform maintenance will be failed. Please refer to best practices for more details: + * https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.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 performMaintenance(String resourceGroupName, String vmScaleSetName); + + /** + * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not + * eligible for perform maintenance will be failed. Please refer to best practices for more details: + * https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.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 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.resourcemanager.compute.generated.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 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.resourcemanager.compute.generated.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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void reimage(String resourceGroupName, String 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void reimage( + String resourceGroupName, + String 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.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 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.resourcemanager.compute.generated.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 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. + * @param zone The zone in which the manual recovery walk is requested for cross zone virtual machine scale set. + * @param placementGroupId The placement group id for which the 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.resourcemanager.compute.generated.models.ApiErrorException 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 along with {@link Response}. + */ + Response forceRecoveryServiceFabricPlatformUpdateDomainWalkWithResponse( + String resourceGroupName, + String vmScaleSetName, + int platformUpdateDomain, + String zone, + String placementGroupId, + 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.resourcemanager.compute.generated.models.ApiErrorException 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); + + /** + * 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response convertToSinglePlacementGroupWithResponse( + String resourceGroupName, + String vmScaleSetName, + VMScaleSetConvertToSinglePlacementGroupInput parameters, + 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.resourcemanager.compute.generated.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 convertToSinglePlacementGroup( + String resourceGroupName, String vmScaleSetName, VMScaleSetConvertToSinglePlacementGroupInput 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.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 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.resourcemanager.compute.generated.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 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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 along with {@link Response}. + */ + VirtualMachineScaleSet getById(String id); + + /** + * Display information about a virtual machine scale set. + * + * @param id the resource ID. + * @param expand The expand expression to apply on the operation. 'UserData' retrieves the UserData property of the + * VM scale set that was provided by the user during the VM scale set Create/Update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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 along with {@link Response}. + */ + Response getByIdWithResponse( + String id, ExpandTypesForGetVMScaleSets expand, Context context); + + /** + * Deletes a VM scale set. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.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 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.resourcemanager.compute.generated.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, Boolean forceDeletion, Context context); + + /** + * Begins definition for a new VirtualMachineScaleSet resource. + * + * @param name resource name. + * @return the first stage of the new VirtualMachineScaleSet definition. + */ + VirtualMachineScaleSet.DefinitionStages.Blank define(String name); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineSize.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineSize.java new file mode 100644 index 0000000000000..8ffc12b7aadfa --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineSize.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineSizeInner; + +/** An immutable client-side representation of VirtualMachineSize. */ +public interface VirtualMachineSize { + /** + * Gets the name property: The name of the virtual machine size. + * + * @return the name value. + */ + String name(); + + /** + * Gets the numberOfCores property: The number of cores supported by the virtual machine size. For Constrained vCPU + * capable VM sizes, this number represents the total vCPUs of quota that the VM uses. For accurate vCPU count, + * please refer to https://docs.microsoft.com/azure/virtual-machines/constrained-vcpu or + * https://docs.microsoft.com/rest/api/compute/resourceskus/list. + * + * @return the numberOfCores value. + */ + Integer numberOfCores(); + + /** + * Gets the osDiskSizeInMB property: The OS disk size, in MB, allowed by the virtual machine size. + * + * @return the osDiskSizeInMB value. + */ + Integer osDiskSizeInMB(); + + /** + * Gets the resourceDiskSizeInMB property: The resource disk size, in MB, allowed by the virtual machine size. + * + * @return the resourceDiskSizeInMB value. + */ + Integer resourceDiskSizeInMB(); + + /** + * Gets the memoryInMB property: The amount of memory, in MB, supported by the virtual machine size. + * + * @return the memoryInMB value. + */ + Integer memoryInMB(); + + /** + * Gets the maxDataDiskCount property: The maximum number of data disks that can be attached to the virtual machine + * size. + * + * @return the maxDataDiskCount value. + */ + Integer maxDataDiskCount(); + + /** + * Gets the inner com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineSizeInner object. + * + * @return the inner object. + */ + VirtualMachineSizeInner innerModel(); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineSizeListResult.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineSizeListResult.java new file mode 100644 index 0000000000000..7d7506d3db7cd --- /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.resourcemanager.compute.generated.fluent.models.VirtualMachineSizeInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List Virtual Machine operation response. */ +@Fluent +public final class VirtualMachineSizeListResult { + /* + * The list of virtual machine sizes. + */ + @JsonProperty(value = "value") + private List value; + + /** Creates an instance of VirtualMachineSizeListResult class. */ + public VirtualMachineSizeListResult() { + } + + /** + * 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..fb3fab58187de --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineSizeTypes.java @@ -0,0 +1,549 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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; + +/** + * Specifies the size of the virtual machine. The enum data type is currently deprecated and will be removed by December + * 23rd 2023. The recommended way to get the list of available sizes is using these APIs: [List all available virtual + * machine sizes in an availability + * set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes), [List all available virtual + * machine sizes in a region]( https://docs.microsoft.com/rest/api/compute/resourceskus/list), [List all available + * virtual machine sizes for resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). + * For more information about virtual machine sizes, see [Sizes for virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/sizes). The available VM sizes depend on region and + * availability set. + */ +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 a new instance of VirtualMachineSizeTypes value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VirtualMachineSizeTypes() { + } + + /** + * 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); + } + + /** + * Gets known VirtualMachineSizeTypes values. + * + * @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..e56a15c02ead9 --- /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/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.resourcemanager.compute.generated.models.ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String location); + + /** + * This API is deprecated. Use [Resources Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list). + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + 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..2d936b01ff2f7 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineSoftwarePatchProperties.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.models; + +import com.azure.core.annotation.Immutable; +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 { + /* + * 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; + + /** Creates an instance of VirtualMachineSoftwarePatchProperties class. */ + public VirtualMachineSoftwarePatchProperties() { + } + + /** + * 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..7799d71742acf --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** The status code and count of the virtual machine scale set instance view status summary. */ +@Immutable +public final class VirtualMachineStatusCodeCount { + /* + * 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; + + /** Creates an instance of VirtualMachineStatusCodeCount class. */ + public VirtualMachineStatusCodeCount() { + } + + /** + * 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..fd630a478eb1c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineUpdate.java @@ -0,0 +1,277 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.time.OffsetDateTime; +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. Minimum api-version: + * 2015-06-15. + * + * @return the diagnosticsProfile value. + */ + DiagnosticsProfile diagnosticsProfile(); + + /** + * Gets the availabilitySet property: Specifies information about the availability set that the virtual machine + * should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes + * to maximize availability. For more information about availability sets, see [Availability sets + * overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). For more information on + * Azure planned maintenance, see [Maintenance and updates for Virtual Machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates). Currently, a VM can only be + * added to availability set at creation time. The availability set to which the VM is being added should be under + * the same resource group as the availability set resource. An existing VM cannot be added to an availability set. + * This property cannot exist along with a non-null properties.virtualMachineScaleSet reference. + * + * @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. This property cannot exist + * along with a non-null properties.availabilitySet reference. 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. Minimum api-version: 2018-04-01. + * + * @return the proximityPlacementGroup value. + */ + SubResource proximityPlacementGroup(); + + /** + * Gets the priority property: Specifies the priority for the virtual machine. 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. 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. + * + * @return the evictionPolicy value. + */ + VirtualMachineEvictionPolicyTypes evictionPolicy(); + + /** + * Gets the billingProfile property: Specifies the billing related details of a Azure Spot virtual machine. 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. + * 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. **Note:** User cannot specify both host and hostGroup properties. Minimum api-version: 2020-06-01. + * + * @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). 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. 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' greater than 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. + * + * @return the platformFaultDomain value. + */ + Integer platformFaultDomain(); + + /** + * Gets the scheduledEventsProfile property: Specifies Scheduled Event related configurations. + * + * @return the scheduledEventsProfile value. + */ + ScheduledEventsProfile scheduledEventsProfile(); + + /** + * Gets the userData property: UserData for the VM, which must be base-64 encoded. Customer should not pass any + * secrets in here. Minimum api-version: 2021-03-01. + * + * @return the userData value. + */ + String userData(); + + /** + * Gets the capacityReservation property: Specifies information about the capacity reservation that is used to + * allocate virtual machine. Minimum api-version: 2021-04-01. + * + * @return the capacityReservation value. + */ + CapacityReservationProfile capacityReservation(); + + /** + * Gets the applicationProfile property: Specifies the gallery applications that should be made available to the + * VM/VMSS. + * + * @return the applicationProfile value. + */ + ApplicationProfile applicationProfile(); + + /** + * Gets the timeCreated property: Specifies the time at which the Virtual Machine resource was created. Minimum + * api-version: 2021-11-01. + * + * @return the timeCreated value. + */ + OffsetDateTime timeCreated(); + + /** + * 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..edbc6ecb7afdc --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachines.java @@ -0,0 +1,732 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.resourcemanager.compute.generated.models.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 virtual machines under the specified subscription for the specified location as paginated + * response with {@link PagedIterable}. + */ + 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.resourcemanager.compute.generated.models.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 virtual machines under the specified subscription for the specified location as paginated + * response with {@link PagedIterable}. + */ + 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.resourcemanager.compute.generated.models.ApiErrorException 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.resourcemanager.compute.generated.models.ApiErrorException 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.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); + + /** + * 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.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, 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. + * @param expand The expand expression to apply on the operation. 'InstanceView' retrieves a snapshot of the runtime + * properties of the virtual machine that is managed by the platform and can change outside of control plane + * operations. 'UserData' retrieves the UserData property as part of the VM model view that was provided by the + * user during the VM Create/Update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String vmName, InstanceViewTypes expand, 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the 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 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.resourcemanager.compute.generated.models.ApiErrorException 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 along with {@link Response}. + */ + Response instanceViewWithResponse( + String resourceGroupName, String vmName, 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.resourcemanager.compute.generated.models.ApiErrorException 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); + + /** + * 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.resourcemanager.compute.generated.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 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.resourcemanager.compute.generated.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 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.resourcemanager.compute.generated.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 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 hibernate Optional parameter to hibernate a virtual machine. (Feature in Preview). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.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 deallocate(String resourceGroupName, String vmName, Boolean hibernate, Context context); + + /** + * Sets the OS state of the virtual machine to generalized. It is recommended to sysprep the virtual machine before + * performing this operation. For Windows, please refer to [Create a managed image of a generalized VM in + * Azure](https://docs.microsoft.com/azure/virtual-machines/windows/capture-image-resource). For Linux, please refer + * to [How to create an image of a virtual machine or + * VHD](https://docs.microsoft.com/azure/virtual-machines/linux/capture-image). + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response generalizeWithResponse(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. For Windows, please refer to [Create a managed image of a generalized VM in + * Azure](https://docs.microsoft.com/azure/virtual-machines/windows/capture-image-resource). For Linux, please refer + * to [How to create an image of a virtual machine or + * VHD](https://docs.microsoft.com/azure/virtual-machines/linux/capture-image). + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.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 generalize(String resourceGroupName, String vmName); + + /** + * 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.resourcemanager.compute.generated.models.ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + 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 filter The system query option to filter VMs returned in the response. Allowed value is + * 'virtualMachineScaleSet/id' eq + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}'. + * @param expand The expand expression to apply on operation. 'instanceView' enables fetching run time status of all + * Virtual Machines, this can only be specified if a valid $filter option is specified. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup( + String resourceGroupName, String filter, ExpandTypeForListVMs expand, 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.resourcemanager.compute.generated.models.ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + 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 filter The system query option to filter VMs returned in the response. Allowed value is + * 'virtualMachineScaleSet/id' eq + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}'. + * @param expand The expand expression to apply on operation. 'instanceView' enables fetching run time status of all + * Virtual Machines, this can only be specified if a valid $filter option is specified. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String statusOnly, String filter, ExpandTypesForListVMs expand, 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.resourcemanager.compute.generated.models.ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + 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.resourcemanager.compute.generated.models.ApiErrorException thrown 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 as paginated response with {@link PagedIterable}. + */ + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void powerOff(String resourceGroupName, String 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void powerOff(String resourceGroupName, String 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void restart(String resourceGroupName, String 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void restart(String resourceGroupName, String 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(String resourceGroupName, String 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(String resourceGroupName, String 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.resourcemanager.compute.generated.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 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.resourcemanager.compute.generated.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 redeploy(String resourceGroupName, String vmName, Context context); + + /** + * Reimages (upgrade the operating system) a virtual machine 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. NOTE: The retaining of old + * OS disk depends on the value of deleteOption of OS disk. If deleteOption is detach, the old OS disk will be + * preserved after reimage. If deleteOption is delete, the old OS disk will be deleted after reimage. The + * deleteOption of the OS disk should be updated accordingly before performing the reimage. + * + * @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 reimage(String resourceGroupName, String vmName); + + /** + * Reimages (upgrade the operating system) a virtual machine 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. NOTE: The retaining of old + * OS disk depends on the value of deleteOption of OS disk. If deleteOption is detach, the old OS disk will be + * preserved after reimage. If deleteOption is delete, the old OS disk will be deleted after reimage. The + * deleteOption of the OS disk should be updated accordingly before performing the reimage. + * + * @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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void reimage(String resourceGroupName, String 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. + * @param sasUriExpirationTimeInMinutes Expiration duration in minutes for the SAS URIs with a value between 1 to + * 1440 minutes. **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 along with {@link Response}. + */ + Response retrieveBootDiagnosticsDataWithResponse( + String resourceGroupName, String vmName, Integer sasUriExpirationTimeInMinutes, 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 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.resourcemanager.compute.generated.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 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.resourcemanager.compute.generated.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 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response simulateEvictionWithResponse(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.resourcemanager.compute.generated.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 simulateEviction(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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine along with {@link Response}. + */ + VirtualMachine getById(String id); + + /** + * Retrieves information about the model view or the instance view of a virtual machine. + * + * @param id the resource ID. + * @param expand The expand expression to apply on the operation. 'InstanceView' retrieves a snapshot of the runtime + * properties of the virtual machine that is managed by the platform and can change outside of control plane + * operations. 'UserData' retrieves the UserData property as part of the VM model view that was provided by the + * user during the VM Create/Update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine along with {@link Response}. + */ + 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * The operation to delete a virtual machine. + * + * @param id the resource ID. + * @param forceDeletion Optional parameter to force delete virtual machines. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.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, 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..bb4bff38602c1 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VmDiskTypes.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; + +/** VM disk types which are disallowed. */ +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 a new instance of VmDiskTypes value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VmDiskTypes() { + } + + /** + * 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); + } + + /** + * Gets known VmDiskTypes values. + * + * @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/VmImagesInEdgeZoneListResult.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VmImagesInEdgeZoneListResult.java new file mode 100644 index 0000000000000..0890f81302676 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VmImagesInEdgeZoneListResult.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.VmImagesInEdgeZoneListResultInner; +import java.util.List; + +/** An immutable client-side representation of VmImagesInEdgeZoneListResult. */ +public interface VmImagesInEdgeZoneListResult { + /** + * Gets the value property: The list of VMImages in EdgeZone. + * + * @return the value value. + */ + List value(); + + /** + * Gets the nextLink property: The URI to fetch the next page of VMImages in EdgeZone. Call ListNext() with this URI + * to fetch the next page of VmImages. + * + * @return the nextLink value. + */ + String nextLink(); + + /** + * Gets the inner com.azure.resourcemanager.compute.generated.fluent.models.VmImagesInEdgeZoneListResultInner + * object. + * + * @return the inner object. + */ + VmImagesInEdgeZoneListResultInner innerModel(); +} 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..f185ffb863770 --- /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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes Windows Remote Management configuration of the VM. */ +@Fluent +public final class WinRMConfiguration { + /* + * The list of Windows Remote Management listeners + */ + @JsonProperty(value = "listeners") + private List listeners; + + /** Creates an instance of WinRMConfiguration class. */ + public WinRMConfiguration() { + } + + /** + * 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..2ecff903078e1 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/WinRMListener.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.fasterxml.jackson.annotation.JsonProperty; + +/** Describes Protocol and thumbprint of Windows Remote Management listener. */ +@Fluent +public final class WinRMListener { + /* + * 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 the Base64 encoding of the following JSON Object which is encoded in UTF-8:

{
+ * "data":"",
"dataType":"pfx",
"password":""
}
To + * install certificates on a virtual machine it is recommended to use the [Azure Key Vault virtual machine + * extension for Linux](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux) or the [Azure + * Key Vault virtual machine extension for + * Windows](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows). + */ + @JsonProperty(value = "certificateUrl") + private String certificateUrl; + + /** Creates an instance of WinRMListener class. */ + public WinRMListener() { + } + + /** + * Get the protocol property: Specifies the protocol of WinRM listener. Possible values are: **http,** **https.**. + * + * @return the protocol value. + */ + public ProtocolTypes protocol() { + return this.protocol; + } + + /** + * Set the protocol property: Specifies the protocol of WinRM listener. Possible values are: **http,** **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 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>} <br> To install certificates on a virtual machine it is + * recommended to use the [Azure Key Vault virtual machine extension for + * Linux](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux) or the [Azure Key Vault + * virtual machine extension for + * Windows](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows). + * + * @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 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>} <br> To install certificates on a virtual machine it is + * recommended to use the [Azure Key Vault virtual machine extension for + * Linux](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux) or the [Azure Key Vault + * virtual machine extension for + * Windows](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows). + * + * @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..6e36d516b0bdc --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/WindowsConfiguration.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.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Specifies Windows operating system settings on the virtual machine. */ +@Fluent +public final class WindowsConfiguration { + /* + * Indicates whether virtual machine agent should be provisioned on the virtual machine. When this property is not + * specified in the request body, it is set to true by default. This will ensure that VM Agent is installed on the + * VM so that extensions can be added to the VM later. + */ + @JsonProperty(value = "provisionVMAgent") + private Boolean provisionVMAgent; + + /* + * Indicates whether Automatic Updates is enabled for the Windows virtual machine. Default value is true. For + * virtual machine scale sets, this property can be updated and updates will take effect on OS reprovisioning. + */ + @JsonProperty(value = "enableAutomaticUpdates") + private Boolean enableAutomaticUpdates; + + /* + * Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time". Possible values can be + * [TimeZoneInfo.Id](https://docs.microsoft.com/dotnet/api/system.timezoneinfo.id?#System_TimeZoneInfo_Id) value + * from time zones returned by + * [TimeZoneInfo.GetSystemTimeZones](https://docs.microsoft.com/dotnet/api/system.timezoneinfo.getsystemtimezones). + */ + @JsonProperty(value = "timeZone") + private String timeZone; + + /* + * Specifies additional base-64 encoded XML formatted information that can be included in the Unattend.xml file, + * which is used by Windows Setup. + */ + @JsonProperty(value = "additionalUnattendContent") + private List additionalUnattendContent; + + /* + * [Preview Feature] Specifies settings related to VM Guest Patching on Windows. + */ + @JsonProperty(value = "patchSettings") + private PatchSettings patchSettings; + + /* + * Specifies the Windows Remote Management listeners. This enables remote Windows PowerShell. + */ + @JsonProperty(value = "winRM") + private WinRMConfiguration winRM; + + /* + * Indicates whether VMAgent Platform Updates is enabled for the Windows virtual machine. Default value is false. + */ + @JsonProperty(value = "enableVMAgentPlatformUpdates") + private Boolean enableVMAgentPlatformUpdates; + + /** Creates an instance of WindowsConfiguration class. */ + public WindowsConfiguration() { + } + + /** + * Get the provisionVMAgent property: Indicates whether virtual machine agent should be provisioned on the virtual + * machine. When this property is not specified in the request body, it is set to true by default. 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. When this property is not specified in the request body, it is set to true by default. 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. 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. 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". Possible + * values can be + * [TimeZoneInfo.Id](https://docs.microsoft.com/dotnet/api/system.timezoneinfo.id?#System_TimeZoneInfo_Id) value + * from time zones returned by + * [TimeZoneInfo.GetSystemTimeZones](https://docs.microsoft.com/dotnet/api/system.timezoneinfo.getsystemtimezones). + * + * @return the timeZone value. + */ + public String timeZone() { + return this.timeZone; + } + + /** + * Set the timeZone property: Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time". Possible + * values can be + * [TimeZoneInfo.Id](https://docs.microsoft.com/dotnet/api/system.timezoneinfo.id?#System_TimeZoneInfo_Id) value + * from time zones returned by + * [TimeZoneInfo.GetSystemTimeZones](https://docs.microsoft.com/dotnet/api/system.timezoneinfo.getsystemtimezones). + * + * @param timeZone the timeZone value to set. + * @return the WindowsConfiguration object itself. + */ + public WindowsConfiguration withTimeZone(String timeZone) { + this.timeZone = timeZone; + return this; + } + + /** + * Get the additionalUnattendContent property: Specifies additional base-64 encoded XML formatted information that + * can be included in the Unattend.xml file, which is used by Windows Setup. + * + * @return the additionalUnattendContent value. + */ + public List additionalUnattendContent() { + return this.additionalUnattendContent; + } + + /** + * Set the additionalUnattendContent property: Specifies additional base-64 encoded XML formatted information that + * can be included in the Unattend.xml file, which is used by Windows Setup. + * + * @param additionalUnattendContent the additionalUnattendContent value to set. + * @return the WindowsConfiguration object itself. + */ + public WindowsConfiguration withAdditionalUnattendContent( + List additionalUnattendContent) { + this.additionalUnattendContent = additionalUnattendContent; + return this; + } + + /** + * Get the patchSettings property: [Preview Feature] Specifies settings related to VM Guest Patching on Windows. + * + * @return the patchSettings value. + */ + public PatchSettings patchSettings() { + return this.patchSettings; + } + + /** + * Set the patchSettings property: [Preview Feature] Specifies settings related to VM Guest Patching on Windows. + * + * @param patchSettings the patchSettings value to set. + * @return the WindowsConfiguration object itself. + */ + public WindowsConfiguration withPatchSettings(PatchSettings patchSettings) { + this.patchSettings = patchSettings; + return this; + } + + /** + * Get the winRM property: Specifies the Windows Remote Management listeners. This enables remote Windows + * PowerShell. + * + * @return the winRM value. + */ + public WinRMConfiguration winRM() { + return this.winRM; + } + + /** + * Set the winRM property: Specifies the Windows Remote Management listeners. This enables remote Windows + * PowerShell. + * + * @param winRM the winRM value to set. + * @return the WindowsConfiguration object itself. + */ + public WindowsConfiguration withWinRM(WinRMConfiguration winRM) { + this.winRM = winRM; + return this; + } + + /** + * Get the enableVMAgentPlatformUpdates property: Indicates whether VMAgent Platform Updates is enabled for the + * Windows virtual machine. Default value is false. + * + * @return the enableVMAgentPlatformUpdates value. + */ + public Boolean enableVMAgentPlatformUpdates() { + return this.enableVMAgentPlatformUpdates; + } + + /** + * Set the enableVMAgentPlatformUpdates property: Indicates whether VMAgent Platform Updates is enabled for the + * Windows virtual machine. Default value is false. + * + * @param enableVMAgentPlatformUpdates the enableVMAgentPlatformUpdates value to set. + * @return the WindowsConfiguration object itself. + */ + public WindowsConfiguration withEnableVMAgentPlatformUpdates(Boolean enableVMAgentPlatformUpdates) { + this.enableVMAgentPlatformUpdates = enableVMAgentPlatformUpdates; + 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..f822097d0812b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/WindowsParameters.java @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.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 { + /* + * 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; + + /** Creates an instance of WindowsParameters class. */ + public WindowsParameters() { + } + + /** + * Get the classificationsToInclude property: The update classifications to select when installing patches for + * Windows. + * + * @return the classificationsToInclude value. + */ + public List classificationsToInclude() { + return this.classificationsToInclude; + } + + /** + * Set the classificationsToInclude property: The update classifications to select when installing patches for + * Windows. + * + * @param classificationsToInclude the classificationsToInclude value to set. + * @return the WindowsParameters object itself. + */ + public WindowsParameters withClassificationsToInclude( + List classificationsToInclude) { + this.classificationsToInclude = classificationsToInclude; + return this; + } + + /** + * Get the kbNumbersToInclude property: Kbs to include in the patch operation. + * + * @return the kbNumbersToInclude value. + */ + public List kbNumbersToInclude() { + return this.kbNumbersToInclude; + } + + /** + * Set the kbNumbersToInclude property: Kbs to include in the patch operation. + * + * @param kbNumbersToInclude the kbNumbersToInclude value to set. + * @return the WindowsParameters object itself. + */ + public WindowsParameters withKbNumbersToInclude(List kbNumbersToInclude) { + this.kbNumbersToInclude = kbNumbersToInclude; + return this; + } + + /** + * Get the kbNumbersToExclude property: Kbs to exclude in the patch operation. + * + * @return the kbNumbersToExclude value. + */ + public List kbNumbersToExclude() { + return this.kbNumbersToExclude; + } + + /** + * Set the kbNumbersToExclude property: Kbs to exclude in the patch operation. + * + * @param kbNumbersToExclude the kbNumbersToExclude value to set. + * @return the WindowsParameters object itself. + */ + public WindowsParameters withKbNumbersToExclude(List kbNumbersToExclude) { + this.kbNumbersToExclude = kbNumbersToExclude; + return this; + } + + /** + * Get the excludeKbsRequiringReboot property: Filters out Kbs that don't have an InstallationRebootBehavior of + * 'NeverReboots' when this is set to true. + * + * @return the excludeKbsRequiringReboot value. + */ + public Boolean excludeKbsRequiringReboot() { + return this.excludeKbsRequiringReboot; + } + + /** + * Set the excludeKbsRequiringReboot property: Filters out Kbs that don't have an InstallationRebootBehavior of + * 'NeverReboots' when this is set to true. + * + * @param excludeKbsRequiringReboot the excludeKbsRequiringReboot value to set. + * @return the WindowsParameters object itself. + */ + public WindowsParameters withExcludeKbsRequiringReboot(Boolean excludeKbsRequiringReboot) { + this.excludeKbsRequiringReboot = excludeKbsRequiringReboot; + return this; + } + + /** + * Get the maxPatchPublishDate property: This is used to install patches that were published on or before this given + * max published date. + * + * @return the maxPatchPublishDate value. + */ + public OffsetDateTime maxPatchPublishDate() { + return this.maxPatchPublishDate; + } + + /** + * Set the maxPatchPublishDate property: This is used to install patches that were published on or before this given + * max published date. + * + * @param maxPatchPublishDate the maxPatchPublishDate value to set. + * @return the WindowsParameters object itself. + */ + public WindowsParameters withMaxPatchPublishDate(OffsetDateTime maxPatchPublishDate) { + this.maxPatchPublishDate = maxPatchPublishDate; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/WindowsPatchAssessmentMode.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/WindowsPatchAssessmentMode.java new file mode 100644 index 0000000000000..971ee75843b40 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/WindowsPatchAssessmentMode.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; + +/** + * Specifies the mode of VM Guest patch assessment for the IaaS virtual machine.<br /><br /> Possible values + * are:<br /><br /> **ImageDefault** - You control the timing of patch assessments on a virtual + * machine.<br /><br /> **AutomaticByPlatform** - The platform will trigger periodic patch assessments. The + * property provisionVMAgent must be true. + */ +public final class WindowsPatchAssessmentMode extends ExpandableStringEnum { + /** Static value ImageDefault for WindowsPatchAssessmentMode. */ + public static final WindowsPatchAssessmentMode IMAGE_DEFAULT = fromString("ImageDefault"); + + /** Static value AutomaticByPlatform for WindowsPatchAssessmentMode. */ + public static final WindowsPatchAssessmentMode AUTOMATIC_BY_PLATFORM = fromString("AutomaticByPlatform"); + + /** + * Creates a new instance of WindowsPatchAssessmentMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public WindowsPatchAssessmentMode() { + } + + /** + * Creates or finds a WindowsPatchAssessmentMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding WindowsPatchAssessmentMode. + */ + @JsonCreator + public static WindowsPatchAssessmentMode fromString(String name) { + return fromString(name, WindowsPatchAssessmentMode.class); + } + + /** + * Gets known WindowsPatchAssessmentMode values. + * + * @return known WindowsPatchAssessmentMode values. + */ + public static Collection values() { + return values(WindowsPatchAssessmentMode.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/WindowsVMGuestPatchAutomaticByPlatformRebootSetting.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/WindowsVMGuestPatchAutomaticByPlatformRebootSetting.java new file mode 100644 index 0000000000000..3ccf83439f12c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/WindowsVMGuestPatchAutomaticByPlatformRebootSetting.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Specifies the reboot setting for all AutomaticByPlatform patch installation operations. */ +public final class WindowsVMGuestPatchAutomaticByPlatformRebootSetting + extends ExpandableStringEnum { + /** Static value Unknown for WindowsVMGuestPatchAutomaticByPlatformRebootSetting. */ + public static final WindowsVMGuestPatchAutomaticByPlatformRebootSetting UNKNOWN = fromString("Unknown"); + + /** Static value IfRequired for WindowsVMGuestPatchAutomaticByPlatformRebootSetting. */ + public static final WindowsVMGuestPatchAutomaticByPlatformRebootSetting IF_REQUIRED = fromString("IfRequired"); + + /** Static value Never for WindowsVMGuestPatchAutomaticByPlatformRebootSetting. */ + public static final WindowsVMGuestPatchAutomaticByPlatformRebootSetting NEVER = fromString("Never"); + + /** Static value Always for WindowsVMGuestPatchAutomaticByPlatformRebootSetting. */ + public static final WindowsVMGuestPatchAutomaticByPlatformRebootSetting ALWAYS = fromString("Always"); + + /** + * Creates a new instance of WindowsVMGuestPatchAutomaticByPlatformRebootSetting value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public WindowsVMGuestPatchAutomaticByPlatformRebootSetting() { + } + + /** + * Creates or finds a WindowsVMGuestPatchAutomaticByPlatformRebootSetting from its string representation. + * + * @param name a name to look for. + * @return the corresponding WindowsVMGuestPatchAutomaticByPlatformRebootSetting. + */ + @JsonCreator + public static WindowsVMGuestPatchAutomaticByPlatformRebootSetting fromString(String name) { + return fromString(name, WindowsVMGuestPatchAutomaticByPlatformRebootSetting.class); + } + + /** + * Gets known WindowsVMGuestPatchAutomaticByPlatformRebootSetting values. + * + * @return known WindowsVMGuestPatchAutomaticByPlatformRebootSetting values. + */ + public static Collection values() { + return values(WindowsVMGuestPatchAutomaticByPlatformRebootSetting.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/WindowsVMGuestPatchAutomaticByPlatformSettings.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/WindowsVMGuestPatchAutomaticByPlatformSettings.java new file mode 100644 index 0000000000000..684097aa1ed19 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/WindowsVMGuestPatchAutomaticByPlatformSettings.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.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifies additional settings to be applied when patch mode AutomaticByPlatform is selected in Windows patch + * settings. + */ +@Fluent +public final class WindowsVMGuestPatchAutomaticByPlatformSettings { + /* + * Specifies the reboot setting for all AutomaticByPlatform patch installation operations. + */ + @JsonProperty(value = "rebootSetting") + private WindowsVMGuestPatchAutomaticByPlatformRebootSetting rebootSetting; + + /* + * Enables customer to schedule patching without accidental upgrades + */ + @JsonProperty(value = "bypassPlatformSafetyChecksOnUserSchedule") + private Boolean bypassPlatformSafetyChecksOnUserSchedule; + + /** Creates an instance of WindowsVMGuestPatchAutomaticByPlatformSettings class. */ + public WindowsVMGuestPatchAutomaticByPlatformSettings() { + } + + /** + * Get the rebootSetting property: Specifies the reboot setting for all AutomaticByPlatform patch installation + * operations. + * + * @return the rebootSetting value. + */ + public WindowsVMGuestPatchAutomaticByPlatformRebootSetting rebootSetting() { + return this.rebootSetting; + } + + /** + * Set the rebootSetting property: Specifies the reboot setting for all AutomaticByPlatform patch installation + * operations. + * + * @param rebootSetting the rebootSetting value to set. + * @return the WindowsVMGuestPatchAutomaticByPlatformSettings object itself. + */ + public WindowsVMGuestPatchAutomaticByPlatformSettings withRebootSetting( + WindowsVMGuestPatchAutomaticByPlatformRebootSetting rebootSetting) { + this.rebootSetting = rebootSetting; + return this; + } + + /** + * Get the bypassPlatformSafetyChecksOnUserSchedule property: Enables customer to schedule patching without + * accidental upgrades. + * + * @return the bypassPlatformSafetyChecksOnUserSchedule value. + */ + public Boolean bypassPlatformSafetyChecksOnUserSchedule() { + return this.bypassPlatformSafetyChecksOnUserSchedule; + } + + /** + * Set the bypassPlatformSafetyChecksOnUserSchedule property: Enables customer to schedule patching without + * accidental upgrades. + * + * @param bypassPlatformSafetyChecksOnUserSchedule the bypassPlatformSafetyChecksOnUserSchedule value to set. + * @return the WindowsVMGuestPatchAutomaticByPlatformSettings object itself. + */ + public WindowsVMGuestPatchAutomaticByPlatformSettings withBypassPlatformSafetyChecksOnUserSchedule( + Boolean bypassPlatformSafetyChecksOnUserSchedule) { + this.bypassPlatformSafetyChecksOnUserSchedule = bypassPlatformSafetyChecksOnUserSchedule; + 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..02980593753d5 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/WindowsVMGuestPatchMode.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * 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. + */ +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 a new instance of WindowsVMGuestPatchMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public WindowsVMGuestPatchMode() { + } + + /** + * 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); + } + + /** + * Gets known WindowsVMGuestPatchMode values. + * + * @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/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/AvailabilitySetsCreateOrUpdateSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/AvailabilitySetsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..87a9f1d1ddd56 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/AvailabilitySetsCreateOrUpdateSamples.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.generated; + +/** Samples for AvailabilitySets CreateOrUpdate. */ +public final class AvailabilitySetsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/availabilitySetExamples/AvailabilitySet_Create.json + */ + /** + * Sample code: Create an availability set. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAnAvailabilitySet(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .availabilitySets() + .define("myAvailabilitySet") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withPlatformUpdateDomainCount(20) + .withPlatformFaultDomainCount(2) + .create(); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/AvailabilitySetsDeleteSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/AvailabilitySetsDeleteSamples.java new file mode 100644 index 0000000000000..e874768885f61 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/AvailabilitySetsDeleteSamples.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.generated; + +/** Samples for AvailabilitySets Delete. */ +public final class AvailabilitySetsDeleteSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/availabilitySetExamples/AvailabilitySet_Delete_MinimumSet_Gen.json + */ + /** + * Sample code: AvailabilitySet_Delete_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void availabilitySetDeleteMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .availabilitySets() + .deleteByResourceGroupWithResponse("rgcompute", "aaaaaaaaaaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/availabilitySetExamples/AvailabilitySet_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: AvailabilitySet_Delete_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void availabilitySetDeleteMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .availabilitySets() + .deleteByResourceGroupWithResponse("rgcompute", "aaaaaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/AvailabilitySetsGetByResourceGroupSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/AvailabilitySetsGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..cba854e647af0 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/AvailabilitySetsGetByResourceGroupSamples.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.generated; + +/** Samples for AvailabilitySets GetByResourceGroup. */ +public final class AvailabilitySetsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/availabilitySetExamples/AvailabilitySet_Get_MaximumSet_Gen.json + */ + /** + * Sample code: AvailabilitySet_Get_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void availabilitySetGetMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .availabilitySets() + .getByResourceGroupWithResponse("rgcompute", "aaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/availabilitySetExamples/AvailabilitySet_Get_MinimumSet_Gen.json + */ + /** + * Sample code: AvailabilitySet_Get_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void availabilitySetGetMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .availabilitySets() + .getByResourceGroupWithResponse("rgcompute", "aaaaaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/AvailabilitySetsListAvailableSizesSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/AvailabilitySetsListAvailableSizesSamples.java new file mode 100644 index 0000000000000..08b9cdf77f868 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/AvailabilitySetsListAvailableSizesSamples.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.generated; + +/** Samples for AvailabilitySets ListAvailableSizes. */ +public final class AvailabilitySetsListAvailableSizesSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/availabilitySetExamples/AvailabilitySet_ListAvailableSizes_MinimumSet_Gen.json + */ + /** + * Sample code: AvailabilitySet_ListAvailableSizes_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void availabilitySetListAvailableSizesMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.availabilitySets().listAvailableSizes("rgcompute", "aa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/availabilitySetExamples/AvailabilitySet_ListAvailableSizes_MaximumSet_Gen.json + */ + /** + * Sample code: AvailabilitySet_ListAvailableSizes_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void availabilitySetListAvailableSizesMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .availabilitySets() + .listAvailableSizes("rgcompute", "aaaaaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/AvailabilitySetsListByResourceGroupSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/AvailabilitySetsListByResourceGroupSamples.java new file mode 100644 index 0000000000000..a8ec49088f9e4 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/AvailabilitySetsListByResourceGroupSamples.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.generated; + +/** Samples for AvailabilitySets ListByResourceGroup. */ +public final class AvailabilitySetsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/availabilitySetExamples/AvailabilitySet_List_MaximumSet_Gen.json + */ + /** + * Sample code: AvailabilitySet_List_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void availabilitySetListMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.availabilitySets().listByResourceGroup("rgcompute", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/availabilitySetExamples/AvailabilitySet_List_MinimumSet_Gen.json + */ + /** + * Sample code: AvailabilitySet_List_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void availabilitySetListMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.availabilitySets().listByResourceGroup("rgcompute", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/AvailabilitySetsListSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/AvailabilitySetsListSamples.java new file mode 100644 index 0000000000000..430a3180a4ac6 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/AvailabilitySetsListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for AvailabilitySets List. */ +public final class AvailabilitySetsListSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/availabilitySetExamples/AvailabilitySet_ListBySubscription.json + */ + /** + * Sample code: List availability sets in a subscription. + * + * @param manager Entry point to ComputeManager. + */ + public static void listAvailabilitySetsInASubscription( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.availabilitySets().list("virtualMachines\\$ref", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/AvailabilitySetsUpdateSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/AvailabilitySetsUpdateSamples.java new file mode 100644 index 0000000000000..b36bca9b67076 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/AvailabilitySetsUpdateSamples.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.generated; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.compute.generated.models.AvailabilitySet; +import com.azure.resourcemanager.compute.generated.models.Sku; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for AvailabilitySets Update. */ +public final class AvailabilitySetsUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/availabilitySetExamples/AvailabilitySet_Update_MinimumSet_Gen.json + */ + /** + * Sample code: AvailabilitySet_Update_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void availabilitySetUpdateMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + AvailabilitySet resource = + manager + .availabilitySets() + .getByResourceGroupWithResponse("rgcompute", "aaaaaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().apply(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/availabilitySetExamples/AvailabilitySet_Update_MaximumSet_Gen.json + */ + /** + * Sample code: AvailabilitySet_Update_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void availabilitySetUpdateMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + AvailabilitySet resource = + manager + .availabilitySets() + .getByResourceGroupWithResponse("rgcompute", "aaaaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("key2574", "aaaaaaaa")) + .withSku(new Sku().withName("DSv3-Type1").withTier("aaa").withCapacity(7L)) + .withPlatformUpdateDomainCount(20) + .withPlatformFaultDomainCount(2) + .withVirtualMachines( + Arrays + .asList( + new SubResource() + .withId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"))) + .withProximityPlacementGroup( + new SubResource() + .withId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}")) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CapacityReservationGroupsCreateOrUpdateSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CapacityReservationGroupsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..cdb5d23f31136 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CapacityReservationGroupsCreateOrUpdateSamples.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.generated; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for CapacityReservationGroups CreateOrUpdate. */ +public final class CapacityReservationGroupsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/capacityReservationExamples/CapacityReservationGroup_CreateOrUpdate.json + */ + /** + * Sample code: Create or update a capacity reservation group. + * + * @param manager Entry point to ComputeManager. + */ + public static void createOrUpdateACapacityReservationGroup( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .capacityReservationGroups() + .define("myCapacityReservationGroup") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withTags(mapOf("department", "finance")) + .withZones(Arrays.asList("1", "2")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CapacityReservationGroupsDeleteSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CapacityReservationGroupsDeleteSamples.java new file mode 100644 index 0000000000000..601b55dd040d2 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CapacityReservationGroupsDeleteSamples.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.generated; + +/** Samples for CapacityReservationGroups Delete. */ +public final class CapacityReservationGroupsDeleteSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/capacityReservationExamples/CapacityReservationGroup_Delete_MinimumSet_Gen.json + */ + /** + * Sample code: CapacityReservationGroup_Delete_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void capacityReservationGroupDeleteMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .capacityReservationGroups() + .deleteByResourceGroupWithResponse( + "rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/capacityReservationExamples/CapacityReservationGroup_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: CapacityReservationGroup_Delete_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void capacityReservationGroupDeleteMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .capacityReservationGroups() + .deleteByResourceGroupWithResponse("rgcompute", "a", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CapacityReservationGroupsGetByResourceGroupSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CapacityReservationGroupsGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..d25fe0de7b320 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CapacityReservationGroupsGetByResourceGroupSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +import com.azure.resourcemanager.compute.generated.models.CapacityReservationGroupInstanceViewTypes; + +/** Samples for CapacityReservationGroups GetByResourceGroup. */ +public final class CapacityReservationGroupsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/capacityReservationExamples/CapacityReservationGroup_Get.json + */ + /** + * Sample code: Get a capacity reservation Group. + * + * @param manager Entry point to ComputeManager. + */ + public static void getACapacityReservationGroup( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .capacityReservationGroups() + .getByResourceGroupWithResponse( + "myResourceGroup", + "myCapacityReservationGroup", + CapacityReservationGroupInstanceViewTypes.INSTANCE_VIEW, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CapacityReservationGroupsListByResourceGroupSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CapacityReservationGroupsListByResourceGroupSamples.java new file mode 100644 index 0000000000000..0b390f75ef66d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CapacityReservationGroupsListByResourceGroupSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +import com.azure.resourcemanager.compute.generated.models.ExpandTypesForGetCapacityReservationGroups; + +/** Samples for CapacityReservationGroups ListByResourceGroup. */ +public final class CapacityReservationGroupsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/capacityReservationExamples/CapacityReservationGroup_ListByResourceGroup.json + */ + /** + * Sample code: List capacity reservation groups in resource group. + * + * @param manager Entry point to ComputeManager. + */ + public static void listCapacityReservationGroupsInResourceGroup( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .capacityReservationGroups() + .listByResourceGroup( + "myResourceGroup", + ExpandTypesForGetCapacityReservationGroups.VIRTUAL_MACHINES_REF, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CapacityReservationGroupsListSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CapacityReservationGroupsListSamples.java new file mode 100644 index 0000000000000..d569d3d9e2b20 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CapacityReservationGroupsListSamples.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.generated; + +import com.azure.resourcemanager.compute.generated.models.ExpandTypesForGetCapacityReservationGroups; + +/** Samples for CapacityReservationGroups List. */ +public final class CapacityReservationGroupsListSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/capacityReservationExamples/CapacityReservationGroup_ListBySubscription.json + */ + /** + * Sample code: List capacity reservation groups in subscription. + * + * @param manager Entry point to ComputeManager. + */ + public static void listCapacityReservationGroupsInSubscription( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .capacityReservationGroups() + .list(ExpandTypesForGetCapacityReservationGroups.VIRTUAL_MACHINES_REF, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CapacityReservationGroupsUpdateSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CapacityReservationGroupsUpdateSamples.java new file mode 100644 index 0000000000000..541f88eb12194 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CapacityReservationGroupsUpdateSamples.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.generated; + +import com.azure.resourcemanager.compute.generated.models.CapacityReservationGroup; +import java.util.HashMap; +import java.util.Map; + +/** Samples for CapacityReservationGroups Update. */ +public final class CapacityReservationGroupsUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/capacityReservationExamples/CapacityReservationGroup_Update_MinimumSet_Gen.json + */ + /** + * Sample code: CapacityReservationGroup_Update_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void capacityReservationGroupUpdateMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + CapacityReservationGroup resource = + manager + .capacityReservationGroups() + .getByResourceGroupWithResponse( + "rgcompute", "aaaaaaaaaaaaaaaaaaaaaa", null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update().apply(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/capacityReservationExamples/CapacityReservationGroup_Update_MaximumSet_Gen.json + */ + /** + * Sample code: CapacityReservationGroup_Update_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void capacityReservationGroupUpdateMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + CapacityReservationGroup resource = + manager + .capacityReservationGroups() + .getByResourceGroupWithResponse( + "rgcompute", "aaaaaaaaaaaaaaaaaaaaaa", null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key5355", "aaa")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CapacityReservationsCreateOrUpdateSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CapacityReservationsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..afc8ac7c3c436 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CapacityReservationsCreateOrUpdateSamples.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.generated; + +import com.azure.resourcemanager.compute.generated.models.Sku; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for CapacityReservations CreateOrUpdate. */ +public final class CapacityReservationsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/capacityReservationExamples/CapacityReservation_CreateOrUpdate.json + */ + /** + * Sample code: Create or update a capacity reservation . + * + * @param manager Entry point to ComputeManager. + */ + public static void createOrUpdateACapacityReservation( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .capacityReservations() + .define("myCapacityReservation") + .withRegion("westus") + .withExistingCapacityReservationGroup("myResourceGroup", "myCapacityReservationGroup") + .withSku(new Sku().withName("Standard_DS1_v2").withCapacity(4L)) + .withTags(mapOf("department", "HR")) + .withZones(Arrays.asList("1")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CapacityReservationsDeleteSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CapacityReservationsDeleteSamples.java new file mode 100644 index 0000000000000..d94bd262f985e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CapacityReservationsDeleteSamples.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.generated; + +/** Samples for CapacityReservations Delete. */ +public final class CapacityReservationsDeleteSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/capacityReservationExamples/CapacityReservation_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: CapacityReservation_Delete_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void capacityReservationDeleteMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .capacityReservations() + .delete("rgcompute", "aaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/capacityReservationExamples/CapacityReservation_Delete_MinimumSet_Gen.json + */ + /** + * Sample code: CapacityReservation_Delete_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void capacityReservationDeleteMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.capacityReservations().delete("rgcompute", "aaa", "aaaaaa", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CapacityReservationsGetSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CapacityReservationsGetSamples.java new file mode 100644 index 0000000000000..602a9b70d4acb --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CapacityReservationsGetSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +import com.azure.resourcemanager.compute.generated.models.CapacityReservationInstanceViewTypes; + +/** Samples for CapacityReservations Get. */ +public final class CapacityReservationsGetSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/capacityReservationExamples/CapacityReservation_Get.json + */ + /** + * Sample code: Get a capacity reservation. + * + * @param manager Entry point to ComputeManager. + */ + public static void getACapacityReservation(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .capacityReservations() + .getWithResponse( + "myResourceGroup", + "myCapacityReservationGroup", + "myCapacityReservation", + CapacityReservationInstanceViewTypes.INSTANCE_VIEW, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CapacityReservationsListByCapacityReservationGroupSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CapacityReservationsListByCapacityReservationGroupSamples.java new file mode 100644 index 0000000000000..4c1ac36e1b345 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CapacityReservationsListByCapacityReservationGroupSamples.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.generated; + +/** Samples for CapacityReservations ListByCapacityReservationGroup. */ +public final class CapacityReservationsListByCapacityReservationGroupSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/capacityReservationExamples/CapacityReservation_ListByReservationGroup.json + */ + /** + * Sample code: List capacity reservations in reservation group. + * + * @param manager Entry point to ComputeManager. + */ + public static void listCapacityReservationsInReservationGroup( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .capacityReservations() + .listByCapacityReservationGroup( + "myResourceGroup", "myCapacityReservationGroup", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CapacityReservationsUpdateSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CapacityReservationsUpdateSamples.java new file mode 100644 index 0000000000000..0d879c313cd29 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CapacityReservationsUpdateSamples.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.generated; + +import com.azure.resourcemanager.compute.generated.models.CapacityReservation; +import com.azure.resourcemanager.compute.generated.models.Sku; +import java.util.HashMap; +import java.util.Map; + +/** Samples for CapacityReservations Update. */ +public final class CapacityReservationsUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/capacityReservationExamples/CapacityReservation_Update_MinimumSet_Gen.json + */ + /** + * Sample code: CapacityReservation_Update_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void capacityReservationUpdateMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + CapacityReservation resource = + manager + .capacityReservations() + .getWithResponse( + "rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaa", "aaa", null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update().apply(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/capacityReservationExamples/CapacityReservation_Update_MaximumSet_Gen.json + */ + /** + * Sample code: CapacityReservation_Update_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void capacityReservationUpdateMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + CapacityReservation resource = + manager + .capacityReservations() + .getWithResponse( + "rgcompute", "aaaaaaaaaa", "aaaaaaaaaaaaaaaaaaa", null, com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("key4974", "aaaaaaaaaaaaaaaa")) + .withSku(new Sku().withName("Standard_DS1_v2").withTier("aaa").withCapacity(7L)) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServiceOperatingSystemsGetOSFamilySamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServiceOperatingSystemsGetOSFamilySamples.java new file mode 100644 index 0000000000000..1dac5eea5a753 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServiceOperatingSystemsGetOSFamilySamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for CloudServiceOperatingSystems GetOSFamily. */ +public final class CloudServiceOperatingSystemsGetOSFamilySamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudServiceOSFamily_Get.json + */ + /** + * Sample code: Get Cloud Service OS Family. + * + * @param manager Entry point to ComputeManager. + */ + public static void getCloudServiceOSFamily(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .cloudServiceOperatingSystems() + .getOSFamilyWithResponse("westus2", "3", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServiceOperatingSystemsGetOSVersionSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServiceOperatingSystemsGetOSVersionSamples.java new file mode 100644 index 0000000000000..d36510b282c30 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServiceOperatingSystemsGetOSVersionSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for CloudServiceOperatingSystems GetOSVersion. */ +public final class CloudServiceOperatingSystemsGetOSVersionSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudServiceOSVersion_Get.json + */ + /** + * Sample code: Get Cloud Service OS Version. + * + * @param manager Entry point to ComputeManager. + */ + public static void getCloudServiceOSVersion(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .cloudServiceOperatingSystems() + .getOSVersionWithResponse("westus2", "WA-GUEST-OS-3.90_202010-02", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServiceOperatingSystemsListOSFamiliesSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServiceOperatingSystemsListOSFamiliesSamples.java new file mode 100644 index 0000000000000..8988d6a185850 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServiceOperatingSystemsListOSFamiliesSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for CloudServiceOperatingSystems ListOSFamilies. */ +public final class CloudServiceOperatingSystemsListOSFamiliesSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudServiceOSFamilies_List.json + */ + /** + * Sample code: List Cloud Service OS Families in a subscription. + * + * @param manager Entry point to ComputeManager. + */ + public static void listCloudServiceOSFamiliesInASubscription( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.cloudServiceOperatingSystems().listOSFamilies("westus2", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServiceOperatingSystemsListOSVersionsSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServiceOperatingSystemsListOSVersionsSamples.java new file mode 100644 index 0000000000000..6cda95017cb57 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServiceOperatingSystemsListOSVersionsSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for CloudServiceOperatingSystems ListOSVersions. */ +public final class CloudServiceOperatingSystemsListOSVersionsSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudServiceOSVersion_List.json + */ + /** + * Sample code: List Cloud Service OS Versions in a subscription. + * + * @param manager Entry point to ComputeManager. + */ + public static void listCloudServiceOSVersionsInASubscription( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.cloudServiceOperatingSystems().listOSVersions("westus2", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServiceRoleInstancesDeleteSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServiceRoleInstancesDeleteSamples.java new file mode 100644 index 0000000000000..8de3c6b931e84 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServiceRoleInstancesDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for CloudServiceRoleInstances Delete. */ +public final class CloudServiceRoleInstancesDeleteSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudServiceRoleInstance_Delete.json + */ + /** + * Sample code: Delete Cloud Service Role Instance. + * + * @param manager Entry point to ComputeManager. + */ + public static void deleteCloudServiceRoleInstance( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .cloudServiceRoleInstances() + .delete("{roleInstance-name}", "ConstosoRG", "{cs-name}", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServiceRoleInstancesGetInstanceViewSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServiceRoleInstancesGetInstanceViewSamples.java new file mode 100644 index 0000000000000..21e647f406492 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServiceRoleInstancesGetInstanceViewSamples.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.generated; + +/** Samples for CloudServiceRoleInstances GetInstanceView. */ +public final class CloudServiceRoleInstancesGetInstanceViewSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudServiceRoleInstance_Get_InstanceView.json + */ + /** + * Sample code: Get Instance View of Cloud Service Role Instance. + * + * @param manager Entry point to ComputeManager. + */ + public static void getInstanceViewOfCloudServiceRoleInstance( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .cloudServiceRoleInstances() + .getInstanceViewWithResponse( + "{roleInstance-name}", "ConstosoRG", "{cs-name}", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServiceRoleInstancesGetRemoteDesktopFileSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServiceRoleInstancesGetRemoteDesktopFileSamples.java new file mode 100644 index 0000000000000..37205ec081663 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServiceRoleInstancesGetRemoteDesktopFileSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for CloudServiceRoleInstances GetRemoteDesktopFile. */ +public final class CloudServiceRoleInstancesGetRemoteDesktopFileSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudServiceRoleInstance_Get_RemoteDesktopFile.json + */ + /** + * Sample code: Get Cloud Service Role. + * + * @param manager Entry point to ComputeManager. + */ + public static void getCloudServiceRole(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .cloudServiceRoleInstances() + .getRemoteDesktopFileWithResponse( + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "rgcloudService", "aaaa", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServiceRoleInstancesGetSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServiceRoleInstancesGetSamples.java new file mode 100644 index 0000000000000..d54b9e57318f8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServiceRoleInstancesGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for CloudServiceRoleInstances Get. */ +public final class CloudServiceRoleInstancesGetSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudServiceRoleInstance_Get.json + */ + /** + * Sample code: Get Cloud Service Role Instance. + * + * @param manager Entry point to ComputeManager. + */ + public static void getCloudServiceRoleInstance(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .cloudServiceRoleInstances() + .getWithResponse("{roleInstance-name}", "ConstosoRG", "{cs-name}", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServiceRoleInstancesListSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServiceRoleInstancesListSamples.java new file mode 100644 index 0000000000000..f3e53f682b202 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServiceRoleInstancesListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for CloudServiceRoleInstances List. */ +public final class CloudServiceRoleInstancesListSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudServiceRolesInstance_List.json + */ + /** + * Sample code: List Role Instances in a Cloud Service. + * + * @param manager Entry point to ComputeManager. + */ + public static void listRoleInstancesInACloudService( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.cloudServiceRoleInstances().list("ConstosoRG", "{cs-name}", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServiceRoleInstancesRebuildSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServiceRoleInstancesRebuildSamples.java new file mode 100644 index 0000000000000..77a85bc12db85 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServiceRoleInstancesRebuildSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for CloudServiceRoleInstances Rebuild. */ +public final class CloudServiceRoleInstancesRebuildSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudServiceRoleInstance_Rebuild.json + */ + /** + * Sample code: Rebuild Cloud Service Role Instance. + * + * @param manager Entry point to ComputeManager. + */ + public static void rebuildCloudServiceRoleInstance( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .cloudServiceRoleInstances() + .rebuild("{roleInstance-name}", "ConstosoRG", "{cs-name}", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServiceRoleInstancesReimageSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServiceRoleInstancesReimageSamples.java new file mode 100644 index 0000000000000..e63da076b7b87 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServiceRoleInstancesReimageSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for CloudServiceRoleInstances Reimage. */ +public final class CloudServiceRoleInstancesReimageSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudServiceRoleInstance_Reimage.json + */ + /** + * Sample code: Reimage Cloud Service Role Instance. + * + * @param manager Entry point to ComputeManager. + */ + public static void reimageCloudServiceRoleInstance( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .cloudServiceRoleInstances() + .reimage("{roleInstance-name}", "ConstosoRG", "{cs-name}", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServiceRoleInstancesRestartSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServiceRoleInstancesRestartSamples.java new file mode 100644 index 0000000000000..86114ef7ce08e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServiceRoleInstancesRestartSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for CloudServiceRoleInstances Restart. */ +public final class CloudServiceRoleInstancesRestartSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudServiceRoleInstance_Restart.json + */ + /** + * Sample code: Restart Cloud Service Role Instance. + * + * @param manager Entry point to ComputeManager. + */ + public static void restartCloudServiceRoleInstance( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .cloudServiceRoleInstances() + .restart("{roleInstance-name}", "ConstosoRG", "{cs-name}", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServiceRolesGetSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServiceRolesGetSamples.java new file mode 100644 index 0000000000000..0d68c33aaaf17 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServiceRolesGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for CloudServiceRoles Get. */ +public final class CloudServiceRolesGetSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudServiceRole_Get.json + */ + /** + * Sample code: Get Cloud Service Role. + * + * @param manager Entry point to ComputeManager. + */ + public static void getCloudServiceRole(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .cloudServiceRoles() + .getWithResponse("{role-name}", "ConstosoRG", "{cs-name}", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServiceRolesListSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServiceRolesListSamples.java new file mode 100644 index 0000000000000..5267f94dde70f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServiceRolesListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for CloudServiceRoles List. */ +public final class CloudServiceRolesListSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudServiceRole_List.json + */ + /** + * Sample code: List Roles in a Cloud Service. + * + * @param manager Entry point to ComputeManager. + */ + public static void listRolesInACloudService(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.cloudServiceRoles().list("ConstosoRG", "{cs-name}", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServicesCreateOrUpdateSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServicesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..c74fbc6d8de64 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServicesCreateOrUpdateSamples.java @@ -0,0 +1,351 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.compute.generated.models.CloudServiceExtensionProfile; +import com.azure.resourcemanager.compute.generated.models.CloudServiceExtensionProperties; +import com.azure.resourcemanager.compute.generated.models.CloudServiceNetworkProfile; +import com.azure.resourcemanager.compute.generated.models.CloudServiceOsProfile; +import com.azure.resourcemanager.compute.generated.models.CloudServiceProperties; +import com.azure.resourcemanager.compute.generated.models.CloudServiceRoleProfile; +import com.azure.resourcemanager.compute.generated.models.CloudServiceRoleProfileProperties; +import com.azure.resourcemanager.compute.generated.models.CloudServiceRoleSku; +import com.azure.resourcemanager.compute.generated.models.CloudServiceUpgradeMode; +import com.azure.resourcemanager.compute.generated.models.CloudServiceVaultCertificate; +import com.azure.resourcemanager.compute.generated.models.CloudServiceVaultSecretGroup; +import com.azure.resourcemanager.compute.generated.models.Extension; +import com.azure.resourcemanager.compute.generated.models.LoadBalancerConfiguration; +import com.azure.resourcemanager.compute.generated.models.LoadBalancerConfigurationProperties; +import com.azure.resourcemanager.compute.generated.models.LoadBalancerFrontendIpConfiguration; +import com.azure.resourcemanager.compute.generated.models.LoadBalancerFrontendIpConfigurationProperties; +import java.util.Arrays; + +/** Samples for CloudServices CreateOrUpdate. */ +public final class CloudServicesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudService_Create_WithSingleRole.json + */ + /** + * Sample code: Create New Cloud Service with Single Role. + * + * @param manager Entry point to ComputeManager. + */ + public static void createNewCloudServiceWithSingleRole( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .cloudServices() + .define("{cs-name}") + .withRegion("westus") + .withExistingResourceGroup("ConstosoRG") + .withProperties( + new CloudServiceProperties() + .withPackageUrl("{PackageUrl}") + .withConfiguration("{ServiceConfiguration}") + .withUpgradeMode(CloudServiceUpgradeMode.AUTO) + .withRoleProfile( + new CloudServiceRoleProfile() + .withRoles( + Arrays + .asList( + new CloudServiceRoleProfileProperties() + .withName("ContosoFrontend") + .withSku( + new CloudServiceRoleSku() + .withName("Standard_D1_v2") + .withTier("Standard") + .withCapacity(1L))))) + .withNetworkProfile( + new CloudServiceNetworkProfile() + .withLoadBalancerConfigurations( + Arrays + .asList( + new LoadBalancerConfiguration() + .withName("myLoadBalancer") + .withProperties( + new LoadBalancerConfigurationProperties() + .withFrontendIpConfigurations( + Arrays + .asList( + new LoadBalancerFrontendIpConfiguration() + .withName("myfe") + .withProperties( + new LoadBalancerFrontendIpConfigurationProperties() + .withPublicIpAddress( + new SubResource() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/myPublicIP")))))))))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudService_Create_WithSingleRoleAndCertificate.json + */ + /** + * Sample code: Create New Cloud Service with Single Role and Certificate from Key Vault. + * + * @param manager Entry point to ComputeManager. + */ + public static void createNewCloudServiceWithSingleRoleAndCertificateFromKeyVault( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .cloudServices() + .define("{cs-name}") + .withRegion("westus") + .withExistingResourceGroup("ConstosoRG") + .withProperties( + new CloudServiceProperties() + .withPackageUrl("{PackageUrl}") + .withConfiguration("{ServiceConfiguration}") + .withUpgradeMode(CloudServiceUpgradeMode.AUTO) + .withRoleProfile( + new CloudServiceRoleProfile() + .withRoles( + Arrays + .asList( + new CloudServiceRoleProfileProperties() + .withName("ContosoFrontend") + .withSku( + new CloudServiceRoleSku() + .withName("Standard_D1_v2") + .withTier("Standard") + .withCapacity(1L))))) + .withOsProfile( + new CloudServiceOsProfile() + .withSecrets( + Arrays + .asList( + new CloudServiceVaultSecretGroup() + .withSourceVault( + new SubResource() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.KeyVault/vaults/{keyvault-name}")) + .withVaultCertificates( + Arrays + .asList( + new CloudServiceVaultCertificate() + .withCertificateUrl( + "https://{keyvault-name}.vault.azure.net:443/secrets/ContosoCertificate/{secret-id}")))))) + .withNetworkProfile( + new CloudServiceNetworkProfile() + .withLoadBalancerConfigurations( + Arrays + .asList( + new LoadBalancerConfiguration() + .withName("contosolb") + .withProperties( + new LoadBalancerConfigurationProperties() + .withFrontendIpConfigurations( + Arrays + .asList( + new LoadBalancerFrontendIpConfiguration() + .withName("contosofe") + .withProperties( + new LoadBalancerFrontendIpConfigurationProperties() + .withPublicIpAddress( + new SubResource() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip")))))))))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudService_Create_WithSingleRoleAndRDP.json + */ + /** + * Sample code: Create New Cloud Service with Single Role and RDP Extension. + * + * @param manager Entry point to ComputeManager. + */ + public static void createNewCloudServiceWithSingleRoleAndRDPExtension( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .cloudServices() + .define("{cs-name}") + .withRegion("westus") + .withExistingResourceGroup("ConstosoRG") + .withProperties( + new CloudServiceProperties() + .withPackageUrl("{PackageUrl}") + .withConfiguration("{ServiceConfiguration}") + .withUpgradeMode(CloudServiceUpgradeMode.AUTO) + .withRoleProfile( + new CloudServiceRoleProfile() + .withRoles( + Arrays + .asList( + new CloudServiceRoleProfileProperties() + .withName("ContosoFrontend") + .withSku( + new CloudServiceRoleSku() + .withName("Standard_D1_v2") + .withTier("Standard") + .withCapacity(1L))))) + .withNetworkProfile( + new CloudServiceNetworkProfile() + .withLoadBalancerConfigurations( + Arrays + .asList( + new LoadBalancerConfiguration() + .withName("contosolb") + .withProperties( + new LoadBalancerConfigurationProperties() + .withFrontendIpConfigurations( + Arrays + .asList( + new LoadBalancerFrontendIpConfiguration() + .withName("contosofe") + .withProperties( + new LoadBalancerFrontendIpConfigurationProperties() + .withPublicIpAddress( + new SubResource() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip"))))))))) + .withExtensionProfile( + new CloudServiceExtensionProfile() + .withExtensions( + Arrays + .asList( + new Extension() + .withName("RDPExtension") + .withProperties( + new CloudServiceExtensionProperties() + .withPublisher("Microsoft.Windows.Azure.Extensions") + .withType("RDP") + .withTypeHandlerVersion("1.2") + .withAutoUpgradeMinorVersion(false) + .withSettings( + "UserAzure10/22/2021" + + " 15:05:45") + .withProtectedSettings( + "{password}")))))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudService_Create_WithMultiRole.json + */ + /** + * Sample code: Create New Cloud Service with Multiple Roles. + * + * @param manager Entry point to ComputeManager. + */ + public static void createNewCloudServiceWithMultipleRoles( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .cloudServices() + .define("{cs-name}") + .withRegion("westus") + .withExistingResourceGroup("ConstosoRG") + .withProperties( + new CloudServiceProperties() + .withPackageUrl("{PackageUrl}") + .withConfiguration("{ServiceConfiguration}") + .withUpgradeMode(CloudServiceUpgradeMode.AUTO) + .withRoleProfile( + new CloudServiceRoleProfile() + .withRoles( + Arrays + .asList( + new CloudServiceRoleProfileProperties() + .withName("ContosoFrontend") + .withSku( + new CloudServiceRoleSku() + .withName("Standard_D1_v2") + .withTier("Standard") + .withCapacity(1L)), + new CloudServiceRoleProfileProperties() + .withName("ContosoBackend") + .withSku( + new CloudServiceRoleSku() + .withName("Standard_D1_v2") + .withTier("Standard") + .withCapacity(1L))))) + .withNetworkProfile( + new CloudServiceNetworkProfile() + .withLoadBalancerConfigurations( + Arrays + .asList( + new LoadBalancerConfiguration() + .withName("contosolb") + .withProperties( + new LoadBalancerConfigurationProperties() + .withFrontendIpConfigurations( + Arrays + .asList( + new LoadBalancerFrontendIpConfiguration() + .withName("contosofe") + .withProperties( + new LoadBalancerFrontendIpConfigurationProperties() + .withPublicIpAddress( + new SubResource() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip")))))))))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudService_Create_WithMultiRole_WithZones.json + */ + /** + * Sample code: Create New Cloud Service with Multiple Roles in a specific availability zone. + * + * @param manager Entry point to ComputeManager. + */ + public static void createNewCloudServiceWithMultipleRolesInASpecificAvailabilityZone( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .cloudServices() + .define("{cs-name}") + .withRegion("westus") + .withExistingResourceGroup("ConstosoRG") + .withProperties( + new CloudServiceProperties() + .withPackageUrl("{PackageUrl}") + .withConfiguration("{ServiceConfiguration}") + .withUpgradeMode(CloudServiceUpgradeMode.AUTO) + .withRoleProfile( + new CloudServiceRoleProfile() + .withRoles( + Arrays + .asList( + new CloudServiceRoleProfileProperties() + .withName("ContosoFrontend") + .withSku( + new CloudServiceRoleSku() + .withName("Standard_D1_v2") + .withTier("Standard") + .withCapacity(1L)), + new CloudServiceRoleProfileProperties() + .withName("ContosoBackend") + .withSku( + new CloudServiceRoleSku() + .withName("Standard_D1_v2") + .withTier("Standard") + .withCapacity(1L))))) + .withNetworkProfile( + new CloudServiceNetworkProfile() + .withLoadBalancerConfigurations( + Arrays + .asList( + new LoadBalancerConfiguration() + .withName("contosolb") + .withProperties( + new LoadBalancerConfigurationProperties() + .withFrontendIpConfigurations( + Arrays + .asList( + new LoadBalancerFrontendIpConfiguration() + .withName("contosofe") + .withProperties( + new LoadBalancerFrontendIpConfigurationProperties() + .withPublicIpAddress( + new SubResource() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip")))))))))) + .withZones(Arrays.asList("1")) + .create(); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServicesDeleteInstancesSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServicesDeleteInstancesSamples.java new file mode 100644 index 0000000000000..97584078f5562 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServicesDeleteInstancesSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +import com.azure.resourcemanager.compute.generated.models.RoleInstances; +import java.util.Arrays; + +/** Samples for CloudServices DeleteInstances. */ +public final class CloudServicesDeleteInstancesSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudServiceRoleInstance_Delete_ByCloudService.json + */ + /** + * Sample code: Delete Cloud Service Role Instances in a Cloud Service. + * + * @param manager Entry point to ComputeManager. + */ + public static void deleteCloudServiceRoleInstancesInACloudService( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .cloudServices() + .deleteInstances( + "ConstosoRG", + "{cs-name}", + new RoleInstances().withRoleInstances(Arrays.asList("ContosoFrontend_IN_0", "ContosoBackend_IN_1")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServicesDeleteSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServicesDeleteSamples.java new file mode 100644 index 0000000000000..d7396c203baf3 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServicesDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for CloudServices Delete. */ +public final class CloudServicesDeleteSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudService_Delete.json + */ + /** + * Sample code: Delete Cloud Service. + * + * @param manager Entry point to ComputeManager. + */ + public static void deleteCloudService(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.cloudServices().delete("ConstosoRG", "{cs-name}", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServicesGetByResourceGroupSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServicesGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..1dadca83cb97c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServicesGetByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for CloudServices GetByResourceGroup. */ +public final class CloudServicesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudService_Get_WithMultiRoleAndRDP.json + */ + /** + * Sample code: Get Cloud Service with Multiple Roles and RDP Extension. + * + * @param manager Entry point to ComputeManager. + */ + public static void getCloudServiceWithMultipleRolesAndRDPExtension( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .cloudServices() + .getByResourceGroupWithResponse("ConstosoRG", "{cs-name}", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServicesGetInstanceViewSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServicesGetInstanceViewSamples.java new file mode 100644 index 0000000000000..2928d0f04df92 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServicesGetInstanceViewSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for CloudServices GetInstanceView. */ +public final class CloudServicesGetInstanceViewSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudService_Get_InstanceViewWithMultiRole.json + */ + /** + * Sample code: Get Cloud Service Instance View with Multiple Roles. + * + * @param manager Entry point to ComputeManager. + */ + public static void getCloudServiceInstanceViewWithMultipleRoles( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .cloudServices() + .getInstanceViewWithResponse("ConstosoRG", "{cs-name}", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServicesListByResourceGroupSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServicesListByResourceGroupSamples.java new file mode 100644 index 0000000000000..e6840fbfe0dfe --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServicesListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for CloudServices ListByResourceGroup. */ +public final class CloudServicesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudService_List_ByResourceGroup.json + */ + /** + * Sample code: List Cloud Services in a Resource Group. + * + * @param manager Entry point to ComputeManager. + */ + public static void listCloudServicesInAResourceGroup( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.cloudServices().listByResourceGroup("ConstosoRG", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServicesListSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServicesListSamples.java new file mode 100644 index 0000000000000..e5d89fad3d246 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServicesListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for CloudServices List. */ +public final class CloudServicesListSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudService_List_BySubscription.json + */ + /** + * Sample code: List Cloud Services in a Subscription. + * + * @param manager Entry point to ComputeManager. + */ + public static void listCloudServicesInASubscription( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.cloudServices().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServicesPowerOffSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServicesPowerOffSamples.java new file mode 100644 index 0000000000000..1a6c4e722e454 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServicesPowerOffSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for CloudServices PowerOff. */ +public final class CloudServicesPowerOffSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudService_PowerOff.json + */ + /** + * Sample code: Stop or PowerOff Cloud Service. + * + * @param manager Entry point to ComputeManager. + */ + public static void stopOrPowerOffCloudService(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.cloudServices().powerOff("ConstosoRG", "{cs-name}", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServicesRebuildSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServicesRebuildSamples.java new file mode 100644 index 0000000000000..aa392fcacd18a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServicesRebuildSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +import com.azure.resourcemanager.compute.generated.models.RoleInstances; +import java.util.Arrays; + +/** Samples for CloudServices Rebuild. */ +public final class CloudServicesRebuildSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudServiceRoleInstance_Rebuild_ByCloudService.json + */ + /** + * Sample code: Rebuild Cloud Service Role Instances in a Cloud Service. + * + * @param manager Entry point to ComputeManager. + */ + public static void rebuildCloudServiceRoleInstancesInACloudService( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .cloudServices() + .rebuild( + "ConstosoRG", + "{cs-name}", + new RoleInstances().withRoleInstances(Arrays.asList("ContosoFrontend_IN_0", "ContosoBackend_IN_1")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServicesReimageSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServicesReimageSamples.java new file mode 100644 index 0000000000000..34092099e939e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServicesReimageSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +import com.azure.resourcemanager.compute.generated.models.RoleInstances; +import java.util.Arrays; + +/** Samples for CloudServices Reimage. */ +public final class CloudServicesReimageSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudServiceRoleInstance_Reimage_ByCloudService.json + */ + /** + * Sample code: Reimage Cloud Service Role Instances in a Cloud Service. + * + * @param manager Entry point to ComputeManager. + */ + public static void reimageCloudServiceRoleInstancesInACloudService( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .cloudServices() + .reimage( + "ConstosoRG", + "{cs-name}", + new RoleInstances().withRoleInstances(Arrays.asList("ContosoFrontend_IN_0", "ContosoBackend_IN_1")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServicesRestartSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServicesRestartSamples.java new file mode 100644 index 0000000000000..87fa3beb47d81 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServicesRestartSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +import com.azure.resourcemanager.compute.generated.models.RoleInstances; +import java.util.Arrays; + +/** Samples for CloudServices Restart. */ +public final class CloudServicesRestartSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudServiceRoleInstance_Restart_ByCloudService.json + */ + /** + * Sample code: Restart Cloud Service Role Instances in a Cloud Service. + * + * @param manager Entry point to ComputeManager. + */ + public static void restartCloudServiceRoleInstancesInACloudService( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .cloudServices() + .restart( + "ConstosoRG", + "{cs-name}", + new RoleInstances().withRoleInstances(Arrays.asList("ContosoFrontend_IN_0", "ContosoBackend_IN_1")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServicesStartSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServicesStartSamples.java new file mode 100644 index 0000000000000..12dddf858aae9 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServicesStartSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for CloudServices Start. */ +public final class CloudServicesStartSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudService_Start.json + */ + /** + * Sample code: Start Cloud Service. + * + * @param manager Entry point to ComputeManager. + */ + public static void startCloudService(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.cloudServices().start("ConstosoRG", "{cs-name}", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServicesUpdateDomainGetUpdateDomainSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServicesUpdateDomainGetUpdateDomainSamples.java new file mode 100644 index 0000000000000..a463267fd17ad --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServicesUpdateDomainGetUpdateDomainSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for CloudServicesUpdateDomain GetUpdateDomain. */ +public final class CloudServicesUpdateDomainGetUpdateDomainSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudServiceUpdateDomain_Get.json + */ + /** + * Sample code: Get Cloud Service Update Domain. + * + * @param manager Entry point to ComputeManager. + */ + public static void getCloudServiceUpdateDomain(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .cloudServicesUpdateDomains() + .getUpdateDomainWithResponse("ConstosoRG", "{cs-name}", 1, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServicesUpdateDomainListUpdateDomainsSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServicesUpdateDomainListUpdateDomainsSamples.java new file mode 100644 index 0000000000000..0ab19ad9bcb76 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServicesUpdateDomainListUpdateDomainsSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for CloudServicesUpdateDomain ListUpdateDomains. */ +public final class CloudServicesUpdateDomainListUpdateDomainsSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudServiceUpdateDomain_List.json + */ + /** + * Sample code: List Update Domains in Cloud Service. + * + * @param manager Entry point to ComputeManager. + */ + public static void listUpdateDomainsInCloudService( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .cloudServicesUpdateDomains() + .listUpdateDomains("ConstosoRG", "{cs-name}", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServicesUpdateDomainWalkUpdateDomainSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServicesUpdateDomainWalkUpdateDomainSamples.java new file mode 100644 index 0000000000000..e180bbce5c6cc --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServicesUpdateDomainWalkUpdateDomainSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for CloudServicesUpdateDomain WalkUpdateDomain. */ +public final class CloudServicesUpdateDomainWalkUpdateDomainSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudServiceUpdateDomain_Update.json + */ + /** + * Sample code: Update Cloud Service to specified Domain. + * + * @param manager Entry point to ComputeManager. + */ + public static void updateCloudServiceToSpecifiedDomain( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .cloudServicesUpdateDomains() + .walkUpdateDomain("ConstosoRG", "{cs-name}", 1, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServicesUpdateSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServicesUpdateSamples.java new file mode 100644 index 0000000000000..6211eb0ec96c5 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CloudServicesUpdateSamples.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.generated; + +import com.azure.resourcemanager.compute.generated.models.CloudService; +import java.util.HashMap; +import java.util.Map; + +/** Samples for CloudServices Update. */ +public final class CloudServicesUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudService_Update_ToIncludeTags.json + */ + /** + * Sample code: Update existing Cloud Service to add tags. + * + * @param manager Entry point to ComputeManager. + */ + public static void updateExistingCloudServiceToAddTags( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + CloudService resource = + manager + .cloudServices() + .getByResourceGroupWithResponse("ConstosoRG", "{cs-name}", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("Documentation", "RestAPI")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CommunityGalleriesGetSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CommunityGalleriesGetSamples.java new file mode 100644 index 0000000000000..5a0cf19041e0d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CommunityGalleriesGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for CommunityGalleries Get. */ +public final class CommunityGalleriesGetSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/communityGalleryExamples/CommunityGallery_Get.json + */ + /** + * Sample code: Get a community gallery. + * + * @param manager Entry point to ComputeManager. + */ + public static void getACommunityGallery(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .communityGalleries() + .getWithResponse("myLocation", "publicGalleryName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CommunityGalleryImageVersionsGetSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CommunityGalleryImageVersionsGetSamples.java new file mode 100644 index 0000000000000..c568bc47de38d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CommunityGalleryImageVersionsGetSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for CommunityGalleryImageVersions Get. */ +public final class CommunityGalleryImageVersionsGetSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/communityGalleryExamples/CommunityGalleryImageVersion_Get.json + */ + /** + * Sample code: Get a community gallery image version. + * + * @param manager Entry point to ComputeManager. + */ + public static void getACommunityGalleryImageVersion( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .communityGalleryImageVersions() + .getWithResponse( + "myLocation", + "publicGalleryName", + "myGalleryImageName", + "myGalleryImageVersionName", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CommunityGalleryImageVersionsListSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CommunityGalleryImageVersionsListSamples.java new file mode 100644 index 0000000000000..06f8a3afb75a1 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CommunityGalleryImageVersionsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for CommunityGalleryImageVersions List. */ +public final class CommunityGalleryImageVersionsListSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/communityGalleryExamples/CommunityGalleryImageVersion_List.json + */ + /** + * Sample code: List community gallery image versions. + * + * @param manager Entry point to ComputeManager. + */ + public static void listCommunityGalleryImageVersions( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .communityGalleryImageVersions() + .list("myLocation", "publicGalleryName", "myGalleryImageName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CommunityGalleryImagesGetSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CommunityGalleryImagesGetSamples.java new file mode 100644 index 0000000000000..39fc6bad9ffa4 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CommunityGalleryImagesGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for CommunityGalleryImages Get. */ +public final class CommunityGalleryImagesGetSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/communityGalleryExamples/CommunityGalleryImage_Get.json + */ + /** + * Sample code: Get a community gallery image. + * + * @param manager Entry point to ComputeManager. + */ + public static void getACommunityGalleryImage(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .communityGalleryImages() + .getWithResponse("myLocation", "publicGalleryName", "myGalleryImageName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CommunityGalleryImagesListSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CommunityGalleryImagesListSamples.java new file mode 100644 index 0000000000000..50bd5f7420c2f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/CommunityGalleryImagesListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for CommunityGalleryImages List. */ +public final class CommunityGalleryImagesListSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/communityGalleryExamples/CommunityGalleryImage_List.json + */ + /** + * Sample code: List community gallery images. + * + * @param manager Entry point to ComputeManager. + */ + public static void listCommunityGalleryImages(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.communityGalleryImages().list("myLocation", "publicGalleryName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DedicatedHostGroupsCreateOrUpdateSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DedicatedHostGroupsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..b7761eb45375e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DedicatedHostGroupsCreateOrUpdateSamples.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.generated; + +import com.azure.resourcemanager.compute.generated.models.DedicatedHostGroupPropertiesAdditionalCapabilities; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for DedicatedHostGroups CreateOrUpdate. */ +public final class DedicatedHostGroupsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_CreateOrUpdate.json + */ + /** + * Sample code: Create or update a dedicated host group. + * + * @param manager Entry point to ComputeManager. + */ + public static void createOrUpdateADedicatedHostGroup( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .dedicatedHostGroups() + .define("myDedicatedHostGroup") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withTags(mapOf("department", "finance")) + .withZones(Arrays.asList("1")) + .withPlatformFaultDomainCount(3) + .withSupportAutomaticPlacement(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_CreateOrUpdate_WithUltraSSD.json + */ + /** + * Sample code: Create or update a dedicated host group with Ultra SSD support. + * + * @param manager Entry point to ComputeManager. + */ + public static void createOrUpdateADedicatedHostGroupWithUltraSSDSupport( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .dedicatedHostGroups() + .define("myDedicatedHostGroup") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withTags(mapOf("department", "finance")) + .withZones(Arrays.asList("1")) + .withPlatformFaultDomainCount(3) + .withSupportAutomaticPlacement(true) + .withAdditionalCapabilities( + new DedicatedHostGroupPropertiesAdditionalCapabilities().withUltraSsdEnabled(true)) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DedicatedHostGroupsDeleteSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DedicatedHostGroupsDeleteSamples.java new file mode 100644 index 0000000000000..a6cc2a28105a1 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DedicatedHostGroupsDeleteSamples.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.generated; + +/** Samples for DedicatedHostGroups Delete. */ +public final class DedicatedHostGroupsDeleteSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: DedicatedHostGroup_Delete_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void dedicatedHostGroupDeleteMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .dedicatedHostGroups() + .deleteByResourceGroupWithResponse("rgcompute", "a", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_Delete_MinimumSet_Gen.json + */ + /** + * Sample code: DedicatedHostGroup_Delete_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void dedicatedHostGroupDeleteMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .dedicatedHostGroups() + .deleteByResourceGroupWithResponse("rgcompute", "aaaa", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DedicatedHostGroupsGetByResourceGroupSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DedicatedHostGroupsGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..166a0c6356acc --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DedicatedHostGroupsGetByResourceGroupSamples.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.generated; + +/** Samples for DedicatedHostGroups GetByResourceGroup. */ +public final class DedicatedHostGroupsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_Get_UltraSSDEnabledDedicatedHostGroup.json + */ + /** + * Sample code: Create an ultraSSDEnabled dedicated host group. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAnUltraSSDEnabledDedicatedHostGroup( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .dedicatedHostGroups() + .getByResourceGroupWithResponse( + "myResourceGroup", "myDedicatedHostGroup", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_Get.json + */ + /** + * Sample code: Create a dedicated host group. + * + * @param manager Entry point to ComputeManager. + */ + public static void createADedicatedHostGroup(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .dedicatedHostGroups() + .getByResourceGroupWithResponse( + "myResourceGroup", "myDedicatedHostGroup", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DedicatedHostGroupsListByResourceGroupSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DedicatedHostGroupsListByResourceGroupSamples.java new file mode 100644 index 0000000000000..cd157f7e81685 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DedicatedHostGroupsListByResourceGroupSamples.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.generated; + +/** Samples for DedicatedHostGroups ListByResourceGroup. */ +public final class DedicatedHostGroupsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_ListByResourceGroup_MaximumSet_Gen.json + */ + /** + * Sample code: DedicatedHostGroup_ListByResourceGroup_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void dedicatedHostGroupListByResourceGroupMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.dedicatedHostGroups().listByResourceGroup("rgcompute", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_ListByResourceGroup_MinimumSet_Gen.json + */ + /** + * Sample code: DedicatedHostGroup_ListByResourceGroup_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void dedicatedHostGroupListByResourceGroupMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.dedicatedHostGroups().listByResourceGroup("rgcompute", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DedicatedHostGroupsListSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DedicatedHostGroupsListSamples.java new file mode 100644 index 0000000000000..b5ff374e7c84c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DedicatedHostGroupsListSamples.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.generated; + +/** Samples for DedicatedHostGroups List. */ +public final class DedicatedHostGroupsListSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_ListBySubscription_MaximumSet_Gen.json + */ + /** + * Sample code: DedicatedHostGroup_ListBySubscription_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void dedicatedHostGroupListBySubscriptionMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.dedicatedHostGroups().list(com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_ListBySubscription_MinimumSet_Gen.json + */ + /** + * Sample code: DedicatedHostGroup_ListBySubscription_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void dedicatedHostGroupListBySubscriptionMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.dedicatedHostGroups().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DedicatedHostGroupsUpdateSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DedicatedHostGroupsUpdateSamples.java new file mode 100644 index 0000000000000..ed992edac3c22 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DedicatedHostGroupsUpdateSamples.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.generated; + +import com.azure.resourcemanager.compute.generated.models.DedicatedHostGroup; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for DedicatedHostGroups Update. */ +public final class DedicatedHostGroupsUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_Update_MaximumSet_Gen.json + */ + /** + * Sample code: DedicatedHostGroup_Update_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void dedicatedHostGroupUpdateMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + DedicatedHostGroup resource = + manager + .dedicatedHostGroups() + .getByResourceGroupWithResponse("rgcompute", "aaaa", null, com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("key9921", "aaaaaaaaaa")) + .withZones(Arrays.asList("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa")) + .withPlatformFaultDomainCount(3) + .withSupportAutomaticPlacement(true) + .apply(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_Update_MinimumSet_Gen.json + */ + /** + * Sample code: DedicatedHostGroup_Update_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void dedicatedHostGroupUpdateMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + DedicatedHostGroup resource = + manager + .dedicatedHostGroups() + .getByResourceGroupWithResponse("rgcompute", "aaaaaaaaaaa", null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update().apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DedicatedHostsCreateOrUpdateSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DedicatedHostsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..b8229cde2ddf1 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DedicatedHostsCreateOrUpdateSamples.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.generated; + +import com.azure.resourcemanager.compute.generated.models.Sku; +import java.util.HashMap; +import java.util.Map; + +/** Samples for DedicatedHosts CreateOrUpdate. */ +public final class DedicatedHostsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/dedicatedHostExamples/DedicatedHost_CreateOrUpdate.json + */ + /** + * Sample code: Create or update a dedicated host . + * + * @param manager Entry point to ComputeManager. + */ + public static void createOrUpdateADedicatedHost( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .dedicatedHosts() + .define("myDedicatedHost") + .withRegion("westus") + .withExistingHostGroup("myResourceGroup", "myDedicatedHostGroup") + .withSku(new Sku().withName("DSv3-Type1")) + .withTags(mapOf("department", "HR")) + .withPlatformFaultDomain(1) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DedicatedHostsDeleteSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DedicatedHostsDeleteSamples.java new file mode 100644 index 0000000000000..61259a396838e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DedicatedHostsDeleteSamples.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.generated; + +/** Samples for DedicatedHosts Delete. */ +public final class DedicatedHostsDeleteSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/dedicatedHostExamples/DedicatedHost_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: DedicatedHost_Delete_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void dedicatedHostDeleteMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.dedicatedHosts().delete("rgcompute", "aaaaaa", "aaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/dedicatedHostExamples/DedicatedHost_Delete_MinimumSet_Gen.json + */ + /** + * Sample code: DedicatedHost_Delete_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void dedicatedHostDeleteMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.dedicatedHosts().delete("rgcompute", "aaaaaaaaaaaaaaa", "aaaaa", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DedicatedHostsGetSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DedicatedHostsGetSamples.java new file mode 100644 index 0000000000000..572318c63d60c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DedicatedHostsGetSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +import com.azure.resourcemanager.compute.generated.models.InstanceViewTypes; + +/** Samples for DedicatedHosts Get. */ +public final class DedicatedHostsGetSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/dedicatedHostExamples/DedicatedHost_Get.json + */ + /** + * Sample code: Get a dedicated host. + * + * @param manager Entry point to ComputeManager. + */ + public static void getADedicatedHost(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .dedicatedHosts() + .getWithResponse( + "myResourceGroup", + "myDedicatedHostGroup", + "myHost", + InstanceViewTypes.INSTANCE_VIEW, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DedicatedHostsListAvailableSizesSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DedicatedHostsListAvailableSizesSamples.java new file mode 100644 index 0000000000000..60f0f28449eea --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DedicatedHostsListAvailableSizesSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for DedicatedHosts ListAvailableSizes. */ +public final class DedicatedHostsListAvailableSizesSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/dedicatedHostExamples/DedicatedHost_ListAvailableSizes.json + */ + /** + * Sample code: Get Available Dedicated Host Sizes. + * + * @param manager Entry point to ComputeManager. + */ + public static void getAvailableDedicatedHostSizes( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .dedicatedHosts() + .listAvailableSizes("myResourceGroup", "myDedicatedHostGroup", "myHost", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DedicatedHostsListByHostGroupSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DedicatedHostsListByHostGroupSamples.java new file mode 100644 index 0000000000000..5b67601e4c194 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DedicatedHostsListByHostGroupSamples.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.generated; + +/** Samples for DedicatedHosts ListByHostGroup. */ +public final class DedicatedHostsListByHostGroupSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/dedicatedHostExamples/DedicatedHost_ListByHostGroup_MaximumSet_Gen.json + */ + /** + * Sample code: DedicatedHost_ListByHostGroup_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void dedicatedHostListByHostGroupMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .dedicatedHosts() + .listByHostGroup("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/dedicatedHostExamples/DedicatedHost_ListByHostGroup_MinimumSet_Gen.json + */ + /** + * Sample code: DedicatedHost_ListByHostGroup_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void dedicatedHostListByHostGroupMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.dedicatedHosts().listByHostGroup("rgcompute", "aaaa", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DedicatedHostsRestartSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DedicatedHostsRestartSamples.java new file mode 100644 index 0000000000000..4632d871ab6dc --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DedicatedHostsRestartSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for DedicatedHosts Restart. */ +public final class DedicatedHostsRestartSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/dedicatedHostExamples/DedicatedHost_Restart.json + */ + /** + * Sample code: Restart Dedicated Host. + * + * @param manager Entry point to ComputeManager. + */ + public static void restartDedicatedHost(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .dedicatedHosts() + .restart("myResourceGroup", "myDedicatedHostGroup", "myHost", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DedicatedHostsUpdateSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DedicatedHostsUpdateSamples.java new file mode 100644 index 0000000000000..56d87c1b2c765 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DedicatedHostsUpdateSamples.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.generated; + +import com.azure.resourcemanager.compute.generated.models.DedicatedHost; +import com.azure.resourcemanager.compute.generated.models.DedicatedHostLicenseTypes; +import com.azure.resourcemanager.compute.generated.models.Sku; +import java.util.HashMap; +import java.util.Map; + +/** Samples for DedicatedHosts Update. */ +public final class DedicatedHostsUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/dedicatedHostExamples/DedicatedHost_Update_Resize.json + */ + /** + * Sample code: DedicatedHost_Update_Resize. + * + * @param manager Entry point to ComputeManager. + */ + public static void dedicatedHostUpdateResize(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + DedicatedHost resource = + manager + .dedicatedHosts() + .getWithResponse( + "rgcompute", "aaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaa", null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withSku(new Sku().withName("DSv3-Type1")).apply(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/dedicatedHostExamples/DedicatedHost_Update_MaximumSet_Gen.json + */ + /** + * Sample code: DedicatedHost_Update_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void dedicatedHostUpdateMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + DedicatedHost resource = + manager + .dedicatedHosts() + .getWithResponse( + "rgcompute", "aaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaa", null, com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("key8813", "aaaaaaaaaaaaaaaaaaaaaaaaaaa")) + .withPlatformFaultDomain(1) + .withAutoReplaceOnFailure(true) + .withLicenseType(DedicatedHostLicenseTypes.WINDOWS_SERVER_HYBRID) + .apply(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/dedicatedHostExamples/DedicatedHost_Update_MinimumSet_Gen.json + */ + /** + * Sample code: DedicatedHost_Update_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void dedicatedHostUpdateMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + DedicatedHost resource = + manager + .dedicatedHosts() + .getWithResponse( + "rgcompute", "aa", "aaaaaaaaaaaaaaaaaaaaaaaaaa", null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update().apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskAccessesCreateOrUpdateSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskAccessesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..4a6d286ddad44 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskAccessesCreateOrUpdateSamples.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.generated; + +/** Samples for DiskAccesses CreateOrUpdate. */ +public final class DiskAccessesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskAccessExamples/DiskAccess_Create.json + */ + /** + * Sample code: Create a disk access resource. + * + * @param manager Entry point to ComputeManager. + */ + public static void createADiskAccessResource(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .diskAccesses() + .define("myDiskAccess") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .create(); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskAccessesDeleteAPrivateEndpointConnectionSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskAccessesDeleteAPrivateEndpointConnectionSamples.java new file mode 100644 index 0000000000000..bd7e8e8e1c4a9 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskAccessesDeleteAPrivateEndpointConnectionSamples.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.generated; + +/** Samples for DiskAccesses DeleteAPrivateEndpointConnection. */ +public final class DiskAccessesDeleteAPrivateEndpointConnectionSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskAccessExamples/DiskAccessPrivateEndpointConnection_Delete.json + */ + /** + * Sample code: Delete a private endpoint connection under a disk access resource. + * + * @param manager Entry point to ComputeManager. + */ + public static void deleteAPrivateEndpointConnectionUnderADiskAccessResource( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .diskAccesses() + .deleteAPrivateEndpointConnection( + "myResourceGroup", "myDiskAccess", "myPrivateEndpointConnection", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskAccessesDeleteSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskAccessesDeleteSamples.java new file mode 100644 index 0000000000000..ffbae560cdcb1 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskAccessesDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for DiskAccesses Delete. */ +public final class DiskAccessesDeleteSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskAccessExamples/DiskAccess_Delete.json + */ + /** + * Sample code: Delete a disk access resource. + * + * @param manager Entry point to ComputeManager. + */ + public static void deleteADiskAccessResource(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.diskAccesses().delete("myResourceGroup", "myDiskAccess", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskAccessesGetAPrivateEndpointConnectionSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskAccessesGetAPrivateEndpointConnectionSamples.java new file mode 100644 index 0000000000000..1ec9a96490634 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskAccessesGetAPrivateEndpointConnectionSamples.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.generated; + +/** Samples for DiskAccesses GetAPrivateEndpointConnection. */ +public final class DiskAccessesGetAPrivateEndpointConnectionSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskAccessExamples/DiskAccessPrivateEndpointConnection_Get.json + */ + /** + * Sample code: Get information about a private endpoint connection under a disk access resource. + * + * @param manager Entry point to ComputeManager. + */ + public static void getInformationAboutAPrivateEndpointConnectionUnderADiskAccessResource( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .diskAccesses() + .getAPrivateEndpointConnectionWithResponse( + "myResourceGroup", "myDiskAccess", "myPrivateEndpointConnection", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskAccessesGetByResourceGroupSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskAccessesGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..62a444ee1c3a5 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskAccessesGetByResourceGroupSamples.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.generated; + +/** Samples for DiskAccesses GetByResourceGroup. */ +public final class DiskAccessesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskAccessExamples/DiskAccess_Get.json + */ + /** + * Sample code: Get information about a disk access resource. + * + * @param manager Entry point to ComputeManager. + */ + public static void getInformationAboutADiskAccessResource( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .diskAccesses() + .getByResourceGroupWithResponse("myResourceGroup", "myDiskAccess", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskAccessExamples/DiskAccess_Get_WithPrivateEndpoints.json + */ + /** + * Sample code: Get information about a disk access resource with private endpoints. + * + * @param manager Entry point to ComputeManager. + */ + public static void getInformationAboutADiskAccessResourceWithPrivateEndpoints( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .diskAccesses() + .getByResourceGroupWithResponse("myResourceGroup", "myDiskAccess", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskAccessesGetPrivateLinkResourcesSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskAccessesGetPrivateLinkResourcesSamples.java new file mode 100644 index 0000000000000..30b5cc3ec095a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskAccessesGetPrivateLinkResourcesSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for DiskAccesses GetPrivateLinkResources. */ +public final class DiskAccessesGetPrivateLinkResourcesSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskAccessExamples/DiskAccessPrivateLinkResources_Get.json + */ + /** + * Sample code: List all possible private link resources under disk access resource. + * + * @param manager Entry point to ComputeManager. + */ + public static void listAllPossiblePrivateLinkResourcesUnderDiskAccessResource( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .diskAccesses() + .getPrivateLinkResourcesWithResponse("myResourceGroup", "myDiskAccess", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskAccessesListByResourceGroupSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskAccessesListByResourceGroupSamples.java new file mode 100644 index 0000000000000..c98bb76410a9c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskAccessesListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for DiskAccesses ListByResourceGroup. */ +public final class DiskAccessesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskAccessExamples/DiskAccess_ListByResourceGroup.json + */ + /** + * Sample code: List all disk access resources in a resource group. + * + * @param manager Entry point to ComputeManager. + */ + public static void listAllDiskAccessResourcesInAResourceGroup( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.diskAccesses().listByResourceGroup("myResourceGroup", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskAccessesListPrivateEndpointConnectionsSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskAccessesListPrivateEndpointConnectionsSamples.java new file mode 100644 index 0000000000000..3ddc0fa3003e3 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskAccessesListPrivateEndpointConnectionsSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for DiskAccesses ListPrivateEndpointConnections. */ +public final class DiskAccessesListPrivateEndpointConnectionsSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskAccessExamples/DiskAccessPrivateEndpointConnection_ListByDiskAccess.json + */ + /** + * Sample code: Get information about a private endpoint connection under a disk access resource. + * + * @param manager Entry point to ComputeManager. + */ + public static void getInformationAboutAPrivateEndpointConnectionUnderADiskAccessResource( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .diskAccesses() + .listPrivateEndpointConnections("myResourceGroup", "myDiskAccess", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskAccessesListSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskAccessesListSamples.java new file mode 100644 index 0000000000000..aae0ad3ed1d06 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskAccessesListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for DiskAccesses List. */ +public final class DiskAccessesListSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskAccessExamples/DiskAccess_ListBySubscription.json + */ + /** + * Sample code: List all disk access resources in a subscription. + * + * @param manager Entry point to ComputeManager. + */ + public static void listAllDiskAccessResourcesInASubscription( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.diskAccesses().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskAccessesUpdateAPrivateEndpointConnectionSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskAccessesUpdateAPrivateEndpointConnectionSamples.java new file mode 100644 index 0000000000000..0924c9c30598b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskAccessesUpdateAPrivateEndpointConnectionSamples.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.generated; + +import com.azure.resourcemanager.compute.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.compute.generated.models.PrivateEndpointServiceConnectionStatus; +import com.azure.resourcemanager.compute.generated.models.PrivateLinkServiceConnectionState; + +/** Samples for DiskAccesses UpdateAPrivateEndpointConnection. */ +public final class DiskAccessesUpdateAPrivateEndpointConnectionSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskAccessExamples/DiskAccessPrivateEndpointConnection_Approve.json + */ + /** + * Sample code: Approve a Private Endpoint Connection under a disk access resource. + * + * @param manager Entry point to ComputeManager. + */ + public static void approveAPrivateEndpointConnectionUnderADiskAccessResource( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .diskAccesses() + .updateAPrivateEndpointConnection( + "myResourceGroup", + "myDiskAccess", + "myPrivateEndpointConnection", + new PrivateEndpointConnectionInner() + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState() + .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withDescription("Approving myPrivateEndpointConnection")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskAccessesUpdateSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskAccessesUpdateSamples.java new file mode 100644 index 0000000000000..59af7877ebf54 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskAccessesUpdateSamples.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.generated; + +import com.azure.resourcemanager.compute.generated.models.DiskAccess; +import java.util.HashMap; +import java.util.Map; + +/** Samples for DiskAccesses Update. */ +public final class DiskAccessesUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskAccessExamples/DiskAccess_Update.json + */ + /** + * Sample code: Update a disk access resource. + * + * @param manager Entry point to ComputeManager. + */ + public static void updateADiskAccessResource(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + DiskAccess resource = + manager + .diskAccesses() + .getByResourceGroupWithResponse("myResourceGroup", "myDiskAccess", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("department", "Development", "project", "PrivateEndpoints")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskEncryptionSetsCreateOrUpdateSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskEncryptionSetsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..34f502f7d94aa --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskEncryptionSetsCreateOrUpdateSamples.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.generated; + +import com.azure.resourcemanager.compute.generated.models.DiskEncryptionSetIdentityType; +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.azure.resourcemanager.compute.generated.models.SourceVault; +import com.azure.resourcemanager.compute.generated.models.UserAssignedIdentitiesValue; +import java.util.HashMap; +import java.util.Map; + +/** Samples for DiskEncryptionSets CreateOrUpdate. */ +public final class DiskEncryptionSetsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Create_WithKeyVaultFromADifferentTenant.json + */ + /** + * Sample code: Create a disk encryption set with key vault from a different tenant. + * + * @param manager Entry point to ComputeManager. + */ + public static void createADiskEncryptionSetWithKeyVaultFromADifferentTenant( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .diskEncryptionSets() + .define("myDiskEncryptionSet") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withIdentity( + new EncryptionSetIdentity() + .withType(DiskEncryptionSetIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}", + new UserAssignedIdentitiesValue()))) + .withEncryptionType(DiskEncryptionSetType.ENCRYPTION_AT_REST_WITH_CUSTOMER_KEY) + .withActiveKey(new KeyForDiskEncryptionSet().withKeyUrl("fakeTokenPlaceholder")) + .withFederatedClientId("00000000-0000-0000-0000-000000000000") + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Create.json + */ + /** + * Sample code: Create a disk encryption set. + * + * @param manager Entry point to ComputeManager. + */ + public static void createADiskEncryptionSet(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .diskEncryptionSets() + .define("myDiskEncryptionSet") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withIdentity(new EncryptionSetIdentity().withType(DiskEncryptionSetIdentityType.SYSTEM_ASSIGNED)) + .withEncryptionType(DiskEncryptionSetType.ENCRYPTION_AT_REST_WITH_CUSTOMER_KEY) + .withActiveKey( + new KeyForDiskEncryptionSet() + .withSourceVault( + new SourceVault() + .withId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault")) + .withKeyUrl("fakeTokenPlaceholder")) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Create_WithKeyVaultFromADifferentSubscription.json + */ + /** + * Sample code: Create a disk encryption set with key vault from a different subscription. + * + * @param manager Entry point to ComputeManager. + */ + public static void createADiskEncryptionSetWithKeyVaultFromADifferentSubscription( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .diskEncryptionSets() + .define("myDiskEncryptionSet") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withIdentity(new EncryptionSetIdentity().withType(DiskEncryptionSetIdentityType.SYSTEM_ASSIGNED)) + .withEncryptionType(DiskEncryptionSetType.ENCRYPTION_AT_REST_WITH_CUSTOMER_KEY) + .withActiveKey(new KeyForDiskEncryptionSet().withKeyUrl("fakeTokenPlaceholder")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskEncryptionSetsDeleteSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskEncryptionSetsDeleteSamples.java new file mode 100644 index 0000000000000..f7d2cc517240c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskEncryptionSetsDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for DiskEncryptionSets Delete. */ +public final class DiskEncryptionSetsDeleteSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Delete.json + */ + /** + * Sample code: Delete a disk encryption set. + * + * @param manager Entry point to ComputeManager. + */ + public static void deleteADiskEncryptionSet(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.diskEncryptionSets().delete("myResourceGroup", "myDiskEncryptionSet", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskEncryptionSetsGetByResourceGroupSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskEncryptionSetsGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..35cc80b81d240 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskEncryptionSetsGetByResourceGroupSamples.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.generated; + +/** Samples for DiskEncryptionSets GetByResourceGroup. */ +public final class DiskEncryptionSetsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Get.json + */ + /** + * Sample code: Get information about a disk encryption set. + * + * @param manager Entry point to ComputeManager. + */ + public static void getInformationAboutADiskEncryptionSet( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .diskEncryptionSets() + .getByResourceGroupWithResponse("myResourceGroup", "myDiskEncryptionSet", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Get_WithAutoKeyRotationError.json + */ + /** + * Sample code: Get information about a disk encryption set when auto-key rotation failed. + * + * @param manager Entry point to ComputeManager. + */ + public static void getInformationAboutADiskEncryptionSetWhenAutoKeyRotationFailed( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .diskEncryptionSets() + .getByResourceGroupWithResponse("myResourceGroup", "myDiskEncryptionSet", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskEncryptionSetsListAssociatedResourcesSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskEncryptionSetsListAssociatedResourcesSamples.java new file mode 100644 index 0000000000000..477e239458f5d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskEncryptionSetsListAssociatedResourcesSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for DiskEncryptionSets ListAssociatedResources. */ +public final class DiskEncryptionSetsListAssociatedResourcesSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_ListAssociatedResources.json + */ + /** + * Sample code: List all resources that are encrypted with this disk encryption set. + * + * @param manager Entry point to ComputeManager. + */ + public static void listAllResourcesThatAreEncryptedWithThisDiskEncryptionSet( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .diskEncryptionSets() + .listAssociatedResources("myResourceGroup", "myDiskEncryptionSet", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskEncryptionSetsListByResourceGroupSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskEncryptionSetsListByResourceGroupSamples.java new file mode 100644 index 0000000000000..4baefac2134b4 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskEncryptionSetsListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for DiskEncryptionSets ListByResourceGroup. */ +public final class DiskEncryptionSetsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_ListByResourceGroup.json + */ + /** + * Sample code: List all disk encryption sets in a resource group. + * + * @param manager Entry point to ComputeManager. + */ + public static void listAllDiskEncryptionSetsInAResourceGroup( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.diskEncryptionSets().listByResourceGroup("myResourceGroup", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskEncryptionSetsListSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskEncryptionSetsListSamples.java new file mode 100644 index 0000000000000..eb14496883732 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskEncryptionSetsListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for DiskEncryptionSets List. */ +public final class DiskEncryptionSetsListSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_ListBySubscription.json + */ + /** + * Sample code: List all disk encryption sets in a subscription. + * + * @param manager Entry point to ComputeManager. + */ + public static void listAllDiskEncryptionSetsInASubscription( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.diskEncryptionSets().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskEncryptionSetsUpdateSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskEncryptionSetsUpdateSamples.java new file mode 100644 index 0000000000000..1696d924a02c2 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskEncryptionSetsUpdateSamples.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.generated; + +import com.azure.resourcemanager.compute.generated.models.DiskEncryptionSet; +import com.azure.resourcemanager.compute.generated.models.DiskEncryptionSetIdentityType; +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.azure.resourcemanager.compute.generated.models.SourceVault; +import java.util.HashMap; +import java.util.Map; + +/** Samples for DiskEncryptionSets Update. */ +public final class DiskEncryptionSetsUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Update_WithRotationToLatestKeyVersionEnabled.json + */ + /** + * Sample code: Update a disk encryption set with rotationToLatestKeyVersionEnabled set to true - Succeeded. + * + * @param manager Entry point to ComputeManager. + */ + public static void updateADiskEncryptionSetWithRotationToLatestKeyVersionEnabledSetToTrueSucceeded( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + DiskEncryptionSet resource = + manager + .diskEncryptionSets() + .getByResourceGroupWithResponse( + "myResourceGroup", "myDiskEncryptionSet", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withIdentity(new EncryptionSetIdentity().withType(DiskEncryptionSetIdentityType.SYSTEM_ASSIGNED)) + .withEncryptionType(DiskEncryptionSetType.ENCRYPTION_AT_REST_WITH_CUSTOMER_KEY) + .withActiveKey(new KeyForDiskEncryptionSet().withKeyUrl("fakeTokenPlaceholder")) + .withRotationToLatestKeyVersionEnabled(true) + .apply(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Update_WithRotationToLatestKeyVersionEnabledInProgress.json + */ + /** + * Sample code: Update a disk encryption set with rotationToLatestKeyVersionEnabled set to true - Updating. + * + * @param manager Entry point to ComputeManager. + */ + public static void updateADiskEncryptionSetWithRotationToLatestKeyVersionEnabledSetToTrueUpdating( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + DiskEncryptionSet resource = + manager + .diskEncryptionSets() + .getByResourceGroupWithResponse( + "myResourceGroup", "myDiskEncryptionSet", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withIdentity(new EncryptionSetIdentity().withType(DiskEncryptionSetIdentityType.SYSTEM_ASSIGNED)) + .withEncryptionType(DiskEncryptionSetType.ENCRYPTION_AT_REST_WITH_CUSTOMER_KEY) + .withActiveKey(new KeyForDiskEncryptionSet().withKeyUrl("fakeTokenPlaceholder")) + .withRotationToLatestKeyVersionEnabled(true) + .apply(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Update.json + */ + /** + * Sample code: Update a disk encryption set. + * + * @param manager Entry point to ComputeManager. + */ + public static void updateADiskEncryptionSet(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + DiskEncryptionSet resource = + manager + .diskEncryptionSets() + .getByResourceGroupWithResponse( + "myResourceGroup", "myDiskEncryptionSet", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("department", "Development", "project", "Encryption")) + .withEncryptionType(DiskEncryptionSetType.ENCRYPTION_AT_REST_WITH_CUSTOMER_KEY) + .withActiveKey( + new KeyForDiskEncryptionSet() + .withSourceVault( + new SourceVault() + .withId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault")) + .withKeyUrl("fakeTokenPlaceholder")) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskRestorePointGetSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskRestorePointGetSamples.java new file mode 100644 index 0000000000000..1824b4ff9b6f9 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskRestorePointGetSamples.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.generated; + +/** Samples for DiskRestorePoint Get. */ +public final class DiskRestorePointGetSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskRestorePointExamples/DiskRestorePoint_Get_WhenSourceResourceIsFromDifferentRegion.json + */ + /** + * Sample code: Get an incremental disk restorePoint when source resource is from a different region. + * + * @param manager Entry point to ComputeManager. + */ + public static void getAnIncrementalDiskRestorePointWhenSourceResourceIsFromADifferentRegion( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .diskRestorePoints() + .getWithResponse( + "myResourceGroup", + "rpc", + "vmrp", + "TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskRestorePointExamples/DiskRestorePoint_Get.json + */ + /** + * Sample code: Get an incremental disk restorePoint resource. + * + * @param manager Entry point to ComputeManager. + */ + public static void getAnIncrementalDiskRestorePointResource( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .diskRestorePoints() + .getWithResponse( + "myResourceGroup", + "rpc", + "vmrp", + "TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskRestorePointGrantAccessSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskRestorePointGrantAccessSamples.java new file mode 100644 index 0000000000000..0affa8597a866 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskRestorePointGrantAccessSamples.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.generated; + +import com.azure.resourcemanager.compute.generated.models.AccessLevel; +import com.azure.resourcemanager.compute.generated.models.GrantAccessData; + +/** Samples for DiskRestorePoint GrantAccess. */ +public final class DiskRestorePointGrantAccessSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskRestorePointExamples/DiskRestorePoint_BeginGetAccess.json + */ + /** + * Sample code: Grants access to a diskRestorePoint. + * + * @param manager Entry point to ComputeManager. + */ + public static void grantsAccessToADiskRestorePoint( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .diskRestorePoints() + .grantAccess( + "myResourceGroup", + "rpc", + "vmrp", + "TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745", + new GrantAccessData().withAccess(AccessLevel.READ).withDurationInSeconds(300), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskRestorePointListByRestorePointSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskRestorePointListByRestorePointSamples.java new file mode 100644 index 0000000000000..5910f56e6b640 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskRestorePointListByRestorePointSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for DiskRestorePoint ListByRestorePoint. */ +public final class DiskRestorePointListByRestorePointSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskRestorePointExamples/DiskRestorePoint_ListByVmRestorePoint.json + */ + /** + * Sample code: Get an incremental disk restorePoint resource. + * + * @param manager Entry point to ComputeManager. + */ + public static void getAnIncrementalDiskRestorePointResource( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .diskRestorePoints() + .listByRestorePoint("myResourceGroup", "rpc", "vmrp", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskRestorePointRevokeAccessSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskRestorePointRevokeAccessSamples.java new file mode 100644 index 0000000000000..a148c402061f9 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DiskRestorePointRevokeAccessSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for DiskRestorePoint RevokeAccess. */ +public final class DiskRestorePointRevokeAccessSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskRestorePointExamples/DiskRestorePoint_EndGetAccess.json + */ + /** + * Sample code: Revokes access to a diskRestorePoint. + * + * @param manager Entry point to ComputeManager. + */ + public static void revokesAccessToADiskRestorePoint( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .diskRestorePoints() + .revokeAccess( + "myResourceGroup", + "rpc", + "vmrp", + "TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DisksCreateOrUpdateSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DisksCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..d579e0c06d038 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DisksCreateOrUpdateSamples.java @@ -0,0 +1,587 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +import com.azure.resourcemanager.compute.generated.models.CreationData; +import com.azure.resourcemanager.compute.generated.models.DataAccessAuthMode; +import com.azure.resourcemanager.compute.generated.models.DiskCreateOption; +import com.azure.resourcemanager.compute.generated.models.DiskSecurityProfile; +import com.azure.resourcemanager.compute.generated.models.DiskSecurityTypes; +import com.azure.resourcemanager.compute.generated.models.DiskSku; +import com.azure.resourcemanager.compute.generated.models.DiskStorageAccountTypes; +import com.azure.resourcemanager.compute.generated.models.Encryption; +import com.azure.resourcemanager.compute.generated.models.EncryptionType; +import com.azure.resourcemanager.compute.generated.models.ExtendedLocation; +import com.azure.resourcemanager.compute.generated.models.ExtendedLocationTypes; +import com.azure.resourcemanager.compute.generated.models.ImageDiskReference; +import com.azure.resourcemanager.compute.generated.models.NetworkAccessPolicy; +import com.azure.resourcemanager.compute.generated.models.OperatingSystemTypes; + +/** Samples for Disks CreateOrUpdate. */ +public final class DisksCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_Create_ByImportingBlobFromADifferentSubscription.json + */ + /** + * Sample code: Create a managed disk by importing an unmanaged blob from a different subscription. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAManagedDiskByImportingAnUnmanagedBlobFromADifferentSubscription( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .disks() + .define("myDisk") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withCreationData( + new CreationData() + .withCreateOption(DiskCreateOption.IMPORT) + .withStorageAccountId( + "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount") + .withSourceUri("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd")) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_Create_FromImportSecure.json + */ + /** + * Sample code: Create a managed disk from ImportSecure create option. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAManagedDiskFromImportSecureCreateOption( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .disks() + .define("myDisk") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withOsType(OperatingSystemTypes.WINDOWS) + .withCreationData( + new CreationData() + .withCreateOption(DiskCreateOption.IMPORT_SECURE) + .withStorageAccountId( + "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount") + .withSourceUri("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd") + .withSecurityDataUri("https://mystorageaccount.blob.core.windows.net/osimages/vmgs.vhd")) + .withSecurityProfile( + new DiskSecurityProfile() + .withSecurityType(DiskSecurityTypes.CONFIDENTIAL_VM_VMGUEST_STATE_ONLY_ENCRYPTED_WITH_PLATFORM_KEY)) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_Create_WithDiskAccess.json + */ + /** + * Sample code: Create a managed disk and associate with disk access resource. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAManagedDiskAndAssociateWithDiskAccessResource( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .disks() + .define("myDisk") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withCreationData(new CreationData().withCreateOption(DiskCreateOption.EMPTY)) + .withDiskSizeGB(200) + .withNetworkAccessPolicy(NetworkAccessPolicy.ALLOW_PRIVATE) + .withDiskAccessId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskAccesses/{existing-diskAccess-name}") + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_Create_WithDiskEncryptionSet.json + */ + /** + * Sample code: Create a managed disk and associate with disk encryption set. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAManagedDiskAndAssociateWithDiskEncryptionSet( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .disks() + .define("myDisk") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withCreationData(new CreationData().withCreateOption(DiskCreateOption.EMPTY)) + .withDiskSizeGB(200) + .withEncryption( + new Encryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}")) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_Create_FromAnExistingManagedDisk.json + */ + /** + * Sample code: Create a managed disk from an existing managed disk in the same or different subscription. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAManagedDiskFromAnExistingManagedDiskInTheSameOrDifferentSubscription( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .disks() + .define("myDisk2") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withCreationData( + new CreationData() + .withCreateOption(DiskCreateOption.COPY) + .withSourceResourceId( + "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk1")) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_Create_PerformancePlus.json + */ + /** + * Sample code: Create a managed disk with performancePlus. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAManagedDiskWithPerformancePlus( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .disks() + .define("myDisk") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withCreationData(new CreationData().withCreateOption(DiskCreateOption.UPLOAD).withPerformancePlus(true)) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_Create_WithPremiumV2_LRSAccountType.json + */ + /** + * Sample code: Create a managed disk with premium v2 account type. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAManagedDiskWithPremiumV2AccountType( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .disks() + .define("myPremiumV2Disk") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withSku(new DiskSku().withName(DiskStorageAccountTypes.PREMIUM_V2_LRS)) + .withCreationData(new CreationData().withCreateOption(DiskCreateOption.EMPTY)) + .withDiskSizeGB(200) + .withDiskIopsReadWrite(125L) + .withDiskMBpsReadWrite(3000L) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_Create_WithSecurityProfile.json + */ + /** + * Sample code: Create a managed disk with security profile. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAManagedDiskWithSecurityProfile( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .disks() + .define("myDisk") + .withRegion("North Central US") + .withExistingResourceGroup("myResourceGroup") + .withOsType(OperatingSystemTypes.WINDOWS) + .withCreationData( + new CreationData() + .withCreateOption(DiskCreateOption.FROM_IMAGE) + .withImageReference( + new ImageDiskReference() + .withId( + "/Subscriptions/{subscriptionId}/Providers/Microsoft.Compute/Locations/uswest/Publishers/Microsoft/ArtifactTypes/VMImage/Offers/{offer}"))) + .withSecurityProfile(new DiskSecurityProfile().withSecurityType(DiskSecurityTypes.TRUSTED_LAUNCH)) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_Create_WithLogicalSectorSize.json + */ + /** + * Sample code: Create an ultra managed disk with logicalSectorSize 512E. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAnUltraManagedDiskWithLogicalSectorSize512E( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .disks() + .define("myDisk") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withSku(new DiskSku().withName(DiskStorageAccountTypes.ULTRA_SSD_LRS)) + .withCreationData(new CreationData().withCreateOption(DiskCreateOption.EMPTY).withLogicalSectorSize(512)) + .withDiskSizeGB(200) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_Create_FromAPlatformImage.json + */ + /** + * Sample code: Create a managed disk from a platform image. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAManagedDiskFromAPlatformImage( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .disks() + .define("myDisk") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withOsType(OperatingSystemTypes.WINDOWS) + .withCreationData( + new CreationData() + .withCreateOption(DiskCreateOption.FROM_IMAGE) + .withImageReference( + new ImageDiskReference() + .withId( + "/Subscriptions/{subscriptionId}/Providers/Microsoft.Compute/Locations/westus/Publishers/{publisher}/ArtifactTypes/VMImage/Offers/{offer}/Skus/{sku}/Versions/1.0.0"))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_Create_FromAnAzureComputeGalleryDirectSharedImage.json + */ + /** + * Sample code: Create a managed disk from an Azure Compute Gallery direct shared image. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAManagedDiskFromAnAzureComputeGalleryDirectSharedImage( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .disks() + .define("myDisk") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withOsType(OperatingSystemTypes.WINDOWS) + .withCreationData( + new CreationData() + .withCreateOption(DiskCreateOption.FROM_IMAGE) + .withGalleryImageReference( + new ImageDiskReference() + .withSharedGalleryImageId( + "/SharedGalleries/{sharedGalleryUniqueName}/Images/{imageName}/Versions/1.0.0"))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_Create_Empty.json + */ + /** + * Sample code: Create an empty managed disk. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAnEmptyManagedDisk(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .disks() + .define("myDisk") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withCreationData(new CreationData().withCreateOption(DiskCreateOption.EMPTY)) + .withDiskSizeGB(200) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_Create_ByImportingBlobFromTheSameSubscription.json + */ + /** + * Sample code: Create a managed disk by importing an unmanaged blob from the same subscription. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAManagedDiskByImportingAnUnmanagedBlobFromTheSameSubscription( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .disks() + .define("myDisk") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withCreationData( + new CreationData() + .withCreateOption(DiskCreateOption.IMPORT) + .withSourceUri("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd")) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_Create_FromUploadPreparedSecure.json + */ + /** + * Sample code: Create a managed disk from UploadPreparedSecure create option. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAManagedDiskFromUploadPreparedSecureCreateOption( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .disks() + .define("myDisk") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withOsType(OperatingSystemTypes.WINDOWS) + .withCreationData( + new CreationData() + .withCreateOption(DiskCreateOption.UPLOAD_PREPARED_SECURE) + .withUploadSizeBytes(10737418752L)) + .withSecurityProfile(new DiskSecurityProfile().withSecurityType(DiskSecurityTypes.TRUSTED_LAUNCH)) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_Create_WithOptimizedForFrequentAttach.json + */ + /** + * Sample code: Create a managed disk with optimizedForFrequentAttach. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAManagedDiskWithOptimizedForFrequentAttach( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .disks() + .define("myDisk") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withCreationData(new CreationData().withCreateOption(DiskCreateOption.EMPTY)) + .withDiskSizeGB(200) + .withOptimizedForFrequentAttach(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_Create_ByCopyingASnapshot.json + */ + /** + * Sample code: Create a managed disk by copying a snapshot. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAManagedDiskByCopyingASnapshot( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .disks() + .define("myDisk") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withCreationData( + new CreationData() + .withCreateOption(DiskCreateOption.COPY) + .withSourceResourceId( + "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot")) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_Create_WithUltraSSD_ReadOnly.json + */ + /** + * Sample code: Create a managed disk with ultra account type with readOnly property set. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAManagedDiskWithUltraAccountTypeWithReadOnlyPropertySet( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .disks() + .define("myUltraReadOnlyDisk") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withSku(new DiskSku().withName(DiskStorageAccountTypes.ULTRA_SSD_LRS)) + .withCreationData(new CreationData().withCreateOption(DiskCreateOption.EMPTY).withLogicalSectorSize(4096)) + .withDiskSizeGB(200) + .withDiskIopsReadWrite(125L) + .withDiskMBpsReadWrite(3000L) + .withEncryption(new Encryption().withType(EncryptionType.ENCRYPTION_AT_REST_WITH_PLATFORM_KEY)) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_Create_ConfidentialVMSupportedDiskEncryptedWithCMK.json + */ + /** + * Sample code: Create a confidential VM supported disk encrypted with customer managed key. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAConfidentialVMSupportedDiskEncryptedWithCustomerManagedKey( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .disks() + .define("myDisk") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withOsType(OperatingSystemTypes.WINDOWS) + .withCreationData( + new CreationData() + .withCreateOption(DiskCreateOption.FROM_IMAGE) + .withImageReference( + new ImageDiskReference() + .withId( + "/Subscriptions/{subscriptionId}/Providers/Microsoft.Compute/Locations/westus/Publishers/{publisher}/ArtifactTypes/VMImage/Offers/{offer}/Skus/{sku}/Versions/1.0.0"))) + .withSecurityProfile( + new DiskSecurityProfile() + .withSecurityType(DiskSecurityTypes.CONFIDENTIAL_VM_DISK_ENCRYPTED_WITH_CUSTOMER_KEY) + .withSecureVMDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}")) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_Create_WithSSDZRSAccountType.json + */ + /** + * Sample code: Create a managed disk with ssd zrs account type. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAManagedDiskWithSsdZrsAccountType( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .disks() + .define("myDisk") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withSku(new DiskSku().withName(DiskStorageAccountTypes.PREMIUM_ZRS)) + .withCreationData(new CreationData().withCreateOption(DiskCreateOption.EMPTY)) + .withDiskSizeGB(200) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_Create_InExtendedLocation.json + */ + /** + * Sample code: Create an empty managed disk in extended location. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAnEmptyManagedDiskInExtendedLocation( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .disks() + .define("myDisk") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withExtendedLocation( + new ExtendedLocation().withName("{edge-zone-id}").withType(ExtendedLocationTypes.EDGE_ZONE)) + .withCreationData(new CreationData().withCreateOption(DiskCreateOption.EMPTY)) + .withDiskSizeGB(200) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_Create_FromAnAzureComputeGalleryCommunityImage.json + */ + /** + * Sample code: Create a managed disk from an Azure Compute Gallery community image. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAManagedDiskFromAnAzureComputeGalleryCommunityImage( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .disks() + .define("myDisk") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withOsType(OperatingSystemTypes.WINDOWS) + .withCreationData( + new CreationData() + .withCreateOption(DiskCreateOption.FROM_IMAGE) + .withGalleryImageReference( + new ImageDiskReference() + .withCommunityGalleryImageId( + "/CommunityGalleries/{communityGalleryPublicGalleryName}/Images/{imageName}/Versions/1.0.0"))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_Create_UploadDisk.json + */ + /** + * Sample code: Create a managed upload disk. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAManagedUploadDisk(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .disks() + .define("myDisk") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withCreationData( + new CreationData().withCreateOption(DiskCreateOption.UPLOAD).withUploadSizeBytes(10737418752L)) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_Create_FromAnAzureComputeGalleryImage.json + */ + /** + * Sample code: Create a managed disk from an Azure Compute Gallery image. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAManagedDiskFromAnAzureComputeGalleryImage( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .disks() + .define("myDisk") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withOsType(OperatingSystemTypes.WINDOWS) + .withCreationData( + new CreationData() + .withCreateOption(DiskCreateOption.FROM_IMAGE) + .withGalleryImageReference( + new ImageDiskReference() + .withId( + "/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/Providers/Microsoft.Compute/Galleries/{galleryName}/Images/{imageName}/Versions/1.0.0"))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_Create_WithDataAccessAuthMode.json + */ + /** + * Sample code: Create a managed disk with dataAccessAuthMode. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAManagedDiskWithDataAccessAuthMode( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .disks() + .define("myDisk") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withCreationData(new CreationData().withCreateOption(DiskCreateOption.EMPTY)) + .withDiskSizeGB(200) + .withDataAccessAuthMode(DataAccessAuthMode.AZURE_ACTIVE_DIRECTORY) + .create(); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DisksDeleteSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DisksDeleteSamples.java new file mode 100644 index 0000000000000..4455db87cfb4d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DisksDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for Disks Delete. */ +public final class DisksDeleteSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_Delete.json + */ + /** + * Sample code: Delete a managed disk. + * + * @param manager Entry point to ComputeManager. + */ + public static void deleteAManagedDisk(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.disks().delete("myResourceGroup", "myDisk", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DisksGetByResourceGroupSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DisksGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..3c3005cd3e3fc --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DisksGetByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for Disks GetByResourceGroup. */ +public final class DisksGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_Get.json + */ + /** + * Sample code: Get information about a managed disk. + * + * @param manager Entry point to ComputeManager. + */ + public static void getInformationAboutAManagedDisk( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .disks() + .getByResourceGroupWithResponse("myResourceGroup", "myManagedDisk", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DisksGrantAccessSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DisksGrantAccessSamples.java new file mode 100644 index 0000000000000..b6ccb3243b342 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DisksGrantAccessSamples.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.generated; + +import com.azure.resourcemanager.compute.generated.models.AccessLevel; +import com.azure.resourcemanager.compute.generated.models.GrantAccessData; + +/** Samples for Disks GrantAccess. */ +public final class DisksGrantAccessSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_BeginGetAccess.json + */ + /** + * Sample code: Get a sas on a managed disk. + * + * @param manager Entry point to ComputeManager. + */ + public static void getASasOnAManagedDisk(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .disks() + .grantAccess( + "myResourceGroup", + "myDisk", + new GrantAccessData().withAccess(AccessLevel.READ).withDurationInSeconds(300), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_BeginGetAccess_WithVMGuestState.json + */ + /** + * Sample code: Get sas on managed disk and VM guest state. + * + * @param manager Entry point to ComputeManager. + */ + public static void getSasOnManagedDiskAndVMGuestState( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .disks() + .grantAccess( + "myResourceGroup", + "myDisk", + new GrantAccessData() + .withAccess(AccessLevel.READ) + .withDurationInSeconds(300) + .withGetSecureVMGuestStateSas(true), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DisksListByResourceGroupSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DisksListByResourceGroupSamples.java new file mode 100644 index 0000000000000..a0c4332dbd189 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DisksListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for Disks ListByResourceGroup. */ +public final class DisksListByResourceGroupSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_ListByResourceGroup.json + */ + /** + * Sample code: List all managed disks in a resource group. + * + * @param manager Entry point to ComputeManager. + */ + public static void listAllManagedDisksInAResourceGroup( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.disks().listByResourceGroup("myResourceGroup", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DisksListSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DisksListSamples.java new file mode 100644 index 0000000000000..dcbc831af58ae --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DisksListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for Disks List. */ +public final class DisksListSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_ListBySubscription.json + */ + /** + * Sample code: List all managed disks in a subscription. + * + * @param manager Entry point to ComputeManager. + */ + public static void listAllManagedDisksInASubscription( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.disks().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DisksRevokeAccessSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DisksRevokeAccessSamples.java new file mode 100644 index 0000000000000..4ff35a1a47035 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DisksRevokeAccessSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for Disks RevokeAccess. */ +public final class DisksRevokeAccessSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_EndGetAccess.json + */ + /** + * Sample code: Revoke access to a managed disk. + * + * @param manager Entry point to ComputeManager. + */ + public static void revokeAccessToAManagedDisk(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.disks().revokeAccess("myResourceGroup", "myDisk", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DisksUpdateSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DisksUpdateSamples.java new file mode 100644 index 0000000000000..977afba69c309 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/DisksUpdateSamples.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.generated; + +import com.azure.resourcemanager.compute.generated.models.Architecture; +import com.azure.resourcemanager.compute.generated.models.Disk; +import com.azure.resourcemanager.compute.generated.models.NetworkAccessPolicy; +import com.azure.resourcemanager.compute.generated.models.PurchasePlanAutoGenerated; +import com.azure.resourcemanager.compute.generated.models.SupportedCapabilities; + +/** Samples for Disks Update. */ +public final class DisksUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_Update_ToAddArchitecture.json + */ + /** + * Sample code: Update a managed disk to add architecture. + * + * @param manager Entry point to ComputeManager. + */ + public static void updateAManagedDiskToAddArchitecture( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + Disk resource = + manager + .disks() + .getByResourceGroupWithResponse("myResourceGroup", "myDisk", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withSupportedCapabilities(new SupportedCapabilities().withArchitecture(Architecture.ARM64)) + .apply(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_Update_DisableBursting.json + */ + /** + * Sample code: Update a managed disk to disable bursting. + * + * @param manager Entry point to ComputeManager. + */ + public static void updateAManagedDiskToDisableBursting( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + Disk resource = + manager + .disks() + .getByResourceGroupWithResponse("myResourceGroup", "myDisk", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withBurstingEnabled(false).apply(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_Update_AddPurchasePlan.json + */ + /** + * Sample code: Update a managed disk to add purchase plan. + * + * @param manager Entry point to ComputeManager. + */ + public static void updateAManagedDiskToAddPurchasePlan( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + Disk resource = + manager + .disks() + .getByResourceGroupWithResponse("myResourceGroup", "myDisk", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withPurchasePlan( + new PurchasePlanAutoGenerated() + .withName("myPurchasePlanName") + .withPublisher("myPurchasePlanPublisher") + .withProduct("myPurchasePlanProduct") + .withPromotionCode("fakeTokenPlaceholder")) + .apply(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_Update_ChangeTier.json + */ + /** + * Sample code: Update a managed disk to change tier. + * + * @param manager Entry point to ComputeManager. + */ + public static void updateAManagedDiskToChangeTier( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + Disk resource = + manager + .disks() + .getByResourceGroupWithResponse("myResourceGroup", "myDisk", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTier("P30").apply(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_CreateOrUpdate_BurstingEnabled.json + */ + /** + * Sample code: Create or update a bursting enabled managed disk. + * + * @param manager Entry point to ComputeManager. + */ + public static void createOrUpdateABurstingEnabledManagedDisk( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + Disk resource = + manager + .disks() + .getByResourceGroupWithResponse("myResourceGroup", "myDisk", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withDiskSizeGB(1024).withBurstingEnabled(true).apply(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_Update_AddSupportsHibernation.json + */ + /** + * Sample code: Update a managed disk to add supportsHibernation. + * + * @param manager Entry point to ComputeManager. + */ + public static void updateAManagedDiskToAddSupportsHibernation( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + Disk resource = + manager + .disks() + .getByResourceGroupWithResponse("myResourceGroup", "myDisk", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withSupportsHibernation(true).apply(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_Update_RemoveDiskAccess.json + */ + /** + * Sample code: Update managed disk to remove disk access resource association. + * + * @param manager Entry point to ComputeManager. + */ + public static void updateManagedDiskToRemoveDiskAccessResourceAssociation( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + Disk resource = + manager + .disks() + .getByResourceGroupWithResponse("myResourceGroup", "myDisk", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withNetworkAccessPolicy(NetworkAccessPolicy.ALLOW_ALL).apply(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_Update_AddDiskControllerTypes.json + */ + /** + * Sample code: Update a managed disk with diskControllerTypes. + * + * @param manager Entry point to ComputeManager. + */ + public static void updateAManagedDiskWithDiskControllerTypes( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + Disk resource = + manager + .disks() + .getByResourceGroupWithResponse("myResourceGroup", "myDisk", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withSupportedCapabilities(new SupportedCapabilities().withDiskControllerTypes("SCSI")) + .apply(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_Update_AddAcceleratedNetworking.json + */ + /** + * Sample code: Update a managed disk to add accelerated networking. + * + * @param manager Entry point to ComputeManager. + */ + public static void updateAManagedDiskToAddAcceleratedNetworking( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + Disk resource = + manager + .disks() + .getByResourceGroupWithResponse("myResourceGroup", "myDisk", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withSupportedCapabilities(new SupportedCapabilities().withAcceleratedNetwork(false)).apply(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/diskExamples/Disk_Update_DisableOptimizedForFrequentAttach.json + */ + /** + * Sample code: Update a managed disk to disable optimizedForFrequentAttach. + * + * @param manager Entry point to ComputeManager. + */ + public static void updateAManagedDiskToDisableOptimizedForFrequentAttach( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + Disk resource = + manager + .disks() + .getByResourceGroupWithResponse("myResourceGroup", "myDisk", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withOptimizedForFrequentAttach(false).apply(); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleriesCreateOrUpdateSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleriesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..1879b4584be84 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleriesCreateOrUpdateSamples.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.generated; + +import com.azure.resourcemanager.compute.generated.models.CommunityGalleryInfo; +import com.azure.resourcemanager.compute.generated.models.GallerySharingPermissionTypes; +import com.azure.resourcemanager.compute.generated.models.SharingProfile; +import com.azure.resourcemanager.compute.generated.models.SoftDeletePolicy; + +/** Samples for Galleries CreateOrUpdate. */ +public final class GalleriesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/CommunityGallery_Create.json + */ + /** + * Sample code: Create a community gallery. + * + * @param manager Entry point to ComputeManager. + */ + public static void createACommunityGallery(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .galleries() + .define("myGalleryName") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withDescription("This is the gallery description.") + .withSharingProfile( + new SharingProfile() + .withPermissions(GallerySharingPermissionTypes.COMMUNITY) + .withCommunityGalleryInfo( + new CommunityGalleryInfo() + .withPublisherUri("uri") + .withPublisherContact("pir@microsoft.com") + .withEula("eula") + .withPublicNamePrefix("PirPublic"))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/Gallery_Create_WithSharingProfile.json + */ + /** + * Sample code: Create or update a simple gallery with sharing profile. + * + * @param manager Entry point to ComputeManager. + */ + public static void createOrUpdateASimpleGalleryWithSharingProfile( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .galleries() + .define("myGalleryName") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withDescription("This is the gallery description.") + .withSharingProfile(new SharingProfile().withPermissions(GallerySharingPermissionTypes.GROUPS)) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/Gallery_Create.json + */ + /** + * Sample code: Create or update a simple gallery. + * + * @param manager Entry point to ComputeManager. + */ + public static void createOrUpdateASimpleGallery( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .galleries() + .define("myGalleryName") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withDescription("This is the gallery description.") + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/Gallery_Create_SoftDeletionEnabled.json + */ + /** + * Sample code: Create or update a simple gallery with soft deletion enabled. + * + * @param manager Entry point to ComputeManager. + */ + public static void createOrUpdateASimpleGalleryWithSoftDeletionEnabled( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .galleries() + .define("myGalleryName") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withDescription("This is the gallery description.") + .withSoftDeletePolicy(new SoftDeletePolicy().withIsSoftDeleteEnabled(true)) + .create(); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleriesDeleteSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleriesDeleteSamples.java new file mode 100644 index 0000000000000..a2f9efda78dab --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleriesDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for Galleries Delete. */ +public final class GalleriesDeleteSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/Gallery_Delete.json + */ + /** + * Sample code: Delete a gallery. + * + * @param manager Entry point to ComputeManager. + */ + public static void deleteAGallery(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.galleries().delete("myResourceGroup", "myGalleryName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleriesGetByResourceGroupSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleriesGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..516e5a9527ade --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleriesGetByResourceGroupSamples.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.generated; + +import com.azure.resourcemanager.compute.generated.models.GalleryExpandParams; +import com.azure.resourcemanager.compute.generated.models.SelectPermissions; + +/** Samples for Galleries GetByResourceGroup. */ +public final class GalleriesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/CommunityGallery_Get.json + */ + /** + * Sample code: Get a community gallery. + * + * @param manager Entry point to ComputeManager. + */ + public static void getACommunityGallery(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .galleries() + .getByResourceGroupWithResponse( + "myResourceGroup", "myGalleryName", null, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/Gallery_Get_WithSelectPermissions.json + */ + /** + * Sample code: Get a gallery with select permissions. + * + * @param manager Entry point to ComputeManager. + */ + public static void getAGalleryWithSelectPermissions( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .galleries() + .getByResourceGroupWithResponse( + "myResourceGroup", + "myGalleryName", + SelectPermissions.PERMISSIONS, + null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/Gallery_Get.json + */ + /** + * Sample code: Get a gallery. + * + * @param manager Entry point to ComputeManager. + */ + public static void getAGallery(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .galleries() + .getByResourceGroupWithResponse( + "myResourceGroup", "myGalleryName", null, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/Gallery_Get_WithExpandSharingProfileGroups.json + */ + /** + * Sample code: Get a gallery with expand sharingProfile groups. + * + * @param manager Entry point to ComputeManager. + */ + public static void getAGalleryWithExpandSharingProfileGroups( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .galleries() + .getByResourceGroupWithResponse( + "myResourceGroup", + "myGalleryName", + null, + GalleryExpandParams.SHARING_PROFILE_GROUPS, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleriesListByResourceGroupSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleriesListByResourceGroupSamples.java new file mode 100644 index 0000000000000..845ef507ef6ed --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleriesListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for Galleries ListByResourceGroup. */ +public final class GalleriesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/Gallery_ListByResourceGroup.json + */ + /** + * Sample code: List galleries in a resource group. + * + * @param manager Entry point to ComputeManager. + */ + public static void listGalleriesInAResourceGroup( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.galleries().listByResourceGroup("myResourceGroup", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleriesListSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleriesListSamples.java new file mode 100644 index 0000000000000..c4d47cf07a671 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleriesListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for Galleries List. */ +public final class GalleriesListSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/Gallery_ListBySubscription.json + */ + /** + * Sample code: List galleries in a subscription. + * + * @param manager Entry point to ComputeManager. + */ + public static void listGalleriesInASubscription( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.galleries().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleriesUpdateSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleriesUpdateSamples.java new file mode 100644 index 0000000000000..b7489408159a5 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleriesUpdateSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +import com.azure.resourcemanager.compute.generated.models.Gallery; + +/** Samples for Galleries Update. */ +public final class GalleriesUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/Gallery_Update.json + */ + /** + * Sample code: Update a simple gallery. + * + * @param manager Entry point to ComputeManager. + */ + public static void updateASimpleGallery(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + Gallery resource = + manager + .galleries() + .getByResourceGroupWithResponse( + "myResourceGroup", "myGalleryName", null, null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withDescription("This is the gallery description.").apply(); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryApplicationVersionsCreateOrUpdateSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryApplicationVersionsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..0d4142be9823e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryApplicationVersionsCreateOrUpdateSamples.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.generated; + +import com.azure.resourcemanager.compute.generated.models.GalleryApplicationCustomAction; +import com.azure.resourcemanager.compute.generated.models.GalleryApplicationCustomActionParameter; +import com.azure.resourcemanager.compute.generated.models.GalleryApplicationCustomActionParameterType; +import com.azure.resourcemanager.compute.generated.models.GalleryApplicationVersionPublishingProfile; +import com.azure.resourcemanager.compute.generated.models.GalleryApplicationVersionSafetyProfile; +import com.azure.resourcemanager.compute.generated.models.StorageAccountType; +import com.azure.resourcemanager.compute.generated.models.TargetRegion; +import com.azure.resourcemanager.compute.generated.models.UserArtifactManage; +import com.azure.resourcemanager.compute.generated.models.UserArtifactSource; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** Samples for GalleryApplicationVersions CreateOrUpdate. */ +public final class GalleryApplicationVersionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/GalleryApplicationVersion_Create.json + */ + /** + * Sample code: Create or update a simple gallery Application Version. + * + * @param manager Entry point to ComputeManager. + */ + public static void createOrUpdateASimpleGalleryApplicationVersion( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .galleryApplicationVersions() + .define("1.0.0") + .withRegion("West US") + .withExistingApplication("myResourceGroup", "myGalleryName", "myGalleryApplicationName") + .withPublishingProfile( + new GalleryApplicationVersionPublishingProfile() + .withTargetRegions( + Arrays + .asList( + new TargetRegion() + .withName("West US") + .withRegionalReplicaCount(1) + .withStorageAccountType(StorageAccountType.STANDARD_LRS) + .withExcludeFromLatest(false))) + .withReplicaCount(1) + .withEndOfLifeDate(OffsetDateTime.parse("2019-07-01T07:00:00Z")) + .withStorageAccountType(StorageAccountType.STANDARD_LRS) + .withSource( + new UserArtifactSource() + .withMediaLink( + "https://mystorageaccount.blob.core.windows.net/mycontainer/package.zip?{sasKey}")) + .withManageActions( + new UserArtifactManage() + .withInstall( + "powershell -command \"Expand-Archive -Path package.zip -DestinationPath C:\\package\"") + .withRemove("del C:\\package ")) + .withCustomActions( + Arrays + .asList( + new GalleryApplicationCustomAction() + .withName("myCustomAction") + .withScript("myCustomActionScript") + .withDescription("This is the custom action description.") + .withParameters( + Arrays + .asList( + new GalleryApplicationCustomActionParameter() + .withName("myCustomActionParameter") + .withRequired(false) + .withType(GalleryApplicationCustomActionParameterType.STRING) + .withDefaultValue("default value of parameter.") + .withDescription("This is the description of the parameter")))))) + .withSafetyProfile( + new GalleryApplicationVersionSafetyProfile().withAllowDeletionOfReplicatedLocations(false)) + .create(); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryApplicationVersionsDeleteSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryApplicationVersionsDeleteSamples.java new file mode 100644 index 0000000000000..4729a95599f56 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryApplicationVersionsDeleteSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for GalleryApplicationVersions Delete. */ +public final class GalleryApplicationVersionsDeleteSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/GalleryApplicationVersion_Delete.json + */ + /** + * Sample code: Delete a gallery Application Version. + * + * @param manager Entry point to ComputeManager. + */ + public static void deleteAGalleryApplicationVersion( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .galleryApplicationVersions() + .delete( + "myResourceGroup", + "myGalleryName", + "myGalleryApplicationName", + "1.0.0", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryApplicationVersionsGetSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryApplicationVersionsGetSamples.java new file mode 100644 index 0000000000000..fb1e6569d7368 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryApplicationVersionsGetSamples.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.generated; + +import com.azure.resourcemanager.compute.generated.models.ReplicationStatusTypes; + +/** Samples for GalleryApplicationVersions Get. */ +public final class GalleryApplicationVersionsGetSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/GalleryApplicationVersion_Get.json + */ + /** + * Sample code: Get a gallery Application Version. + * + * @param manager Entry point to ComputeManager. + */ + public static void getAGalleryApplicationVersion( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .galleryApplicationVersions() + .getWithResponse( + "myResourceGroup", + "myGalleryName", + "myGalleryApplicationName", + "1.0.0", + null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/GalleryApplicationVersion_Get_WithReplicationStatus.json + */ + /** + * Sample code: Get a gallery Application Version with replication status. + * + * @param manager Entry point to ComputeManager. + */ + public static void getAGalleryApplicationVersionWithReplicationStatus( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .galleryApplicationVersions() + .getWithResponse( + "myResourceGroup", + "myGalleryName", + "myGalleryApplicationName", + "1.0.0", + ReplicationStatusTypes.REPLICATION_STATUS, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryApplicationVersionsListByGalleryApplicationSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryApplicationVersionsListByGalleryApplicationSamples.java new file mode 100644 index 0000000000000..add7a09cd7b30 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryApplicationVersionsListByGalleryApplicationSamples.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.generated; + +/** Samples for GalleryApplicationVersions ListByGalleryApplication. */ +public final class GalleryApplicationVersionsListByGalleryApplicationSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/GalleryApplicationVersion_ListByGalleryApplication.json + */ + /** + * Sample code: List gallery Application Versions in a gallery Application Definition. + * + * @param manager Entry point to ComputeManager. + */ + public static void listGalleryApplicationVersionsInAGalleryApplicationDefinition( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .galleryApplicationVersions() + .listByGalleryApplication( + "myResourceGroup", "myGalleryName", "myGalleryApplicationName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryApplicationVersionsUpdateSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryApplicationVersionsUpdateSamples.java new file mode 100644 index 0000000000000..8e59823e5c30b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryApplicationVersionsUpdateSamples.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.generated; + +import com.azure.resourcemanager.compute.generated.models.GalleryApplicationVersion; +import com.azure.resourcemanager.compute.generated.models.GalleryApplicationVersionPublishingProfile; +import com.azure.resourcemanager.compute.generated.models.GalleryApplicationVersionSafetyProfile; +import com.azure.resourcemanager.compute.generated.models.StorageAccountType; +import com.azure.resourcemanager.compute.generated.models.TargetRegion; +import com.azure.resourcemanager.compute.generated.models.UserArtifactManage; +import com.azure.resourcemanager.compute.generated.models.UserArtifactSource; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** Samples for GalleryApplicationVersions Update. */ +public final class GalleryApplicationVersionsUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/GalleryApplicationVersion_Update.json + */ + /** + * Sample code: Update a simple gallery Application Version. + * + * @param manager Entry point to ComputeManager. + */ + public static void updateASimpleGalleryApplicationVersion( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + GalleryApplicationVersion resource = + manager + .galleryApplicationVersions() + .getWithResponse( + "myResourceGroup", + "myGalleryName", + "myGalleryApplicationName", + "1.0.0", + null, + com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withPublishingProfile( + new GalleryApplicationVersionPublishingProfile() + .withTargetRegions( + Arrays + .asList( + new TargetRegion() + .withName("West US") + .withRegionalReplicaCount(1) + .withStorageAccountType(StorageAccountType.STANDARD_LRS) + .withExcludeFromLatest(false))) + .withReplicaCount(1) + .withEndOfLifeDate(OffsetDateTime.parse("2019-07-01T07:00:00Z")) + .withStorageAccountType(StorageAccountType.STANDARD_LRS) + .withSource( + new UserArtifactSource() + .withMediaLink( + "https://mystorageaccount.blob.core.windows.net/mycontainer/package.zip?{sasKey}")) + .withManageActions( + new UserArtifactManage() + .withInstall( + "powershell -command \"Expand-Archive -Path package.zip -DestinationPath C:\\package\"") + .withRemove("del C:\\package "))) + .withSafetyProfile( + new GalleryApplicationVersionSafetyProfile().withAllowDeletionOfReplicatedLocations(false)) + .apply(); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryApplicationsCreateOrUpdateSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryApplicationsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..20d27bece3c87 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryApplicationsCreateOrUpdateSamples.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.generated; + +import com.azure.resourcemanager.compute.generated.models.GalleryApplicationCustomAction; +import com.azure.resourcemanager.compute.generated.models.GalleryApplicationCustomActionParameter; +import com.azure.resourcemanager.compute.generated.models.GalleryApplicationCustomActionParameterType; +import com.azure.resourcemanager.compute.generated.models.OperatingSystemTypes; +import java.util.Arrays; + +/** Samples for GalleryApplications CreateOrUpdate. */ +public final class GalleryApplicationsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/GalleryApplication_Create.json + */ + /** + * Sample code: Create or update a simple gallery Application. + * + * @param manager Entry point to ComputeManager. + */ + public static void createOrUpdateASimpleGalleryApplication( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .galleryApplications() + .define("myGalleryApplicationName") + .withRegion("West US") + .withExistingGallery("myResourceGroup", "myGalleryName") + .withDescription("This is the gallery application description.") + .withEula("This is the gallery application EULA.") + .withPrivacyStatementUri("myPrivacyStatementUri}") + .withReleaseNoteUri("myReleaseNoteUri") + .withSupportedOSType(OperatingSystemTypes.WINDOWS) + .withCustomActions( + Arrays + .asList( + new GalleryApplicationCustomAction() + .withName("myCustomAction") + .withScript("myCustomActionScript") + .withDescription("This is the custom action description.") + .withParameters( + Arrays + .asList( + new GalleryApplicationCustomActionParameter() + .withName("myCustomActionParameter") + .withRequired(false) + .withType(GalleryApplicationCustomActionParameterType.STRING) + .withDefaultValue("default value of parameter.") + .withDescription("This is the description of the parameter"))))) + .create(); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryApplicationsDeleteSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryApplicationsDeleteSamples.java new file mode 100644 index 0000000000000..f55f2e9154de8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryApplicationsDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for GalleryApplications Delete. */ +public final class GalleryApplicationsDeleteSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/GalleryApplication_Delete.json + */ + /** + * Sample code: Delete a gallery Application. + * + * @param manager Entry point to ComputeManager. + */ + public static void deleteAGalleryApplication(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .galleryApplications() + .delete("myResourceGroup", "myGalleryName", "myGalleryApplicationName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryApplicationsGetSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryApplicationsGetSamples.java new file mode 100644 index 0000000000000..ee8d2c41138ad --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryApplicationsGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for GalleryApplications Get. */ +public final class GalleryApplicationsGetSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/GalleryApplication_Get.json + */ + /** + * Sample code: Get a gallery Application. + * + * @param manager Entry point to ComputeManager. + */ + public static void getAGalleryApplication(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .galleryApplications() + .getWithResponse( + "myResourceGroup", "myGalleryName", "myGalleryApplicationName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryApplicationsListByGallerySamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryApplicationsListByGallerySamples.java new file mode 100644 index 0000000000000..e5c1b44005d51 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryApplicationsListByGallerySamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for GalleryApplications ListByGallery. */ +public final class GalleryApplicationsListByGallerySamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/GalleryApplication_ListByGallery.json + */ + /** + * Sample code: List gallery Applications in a gallery. + * + * @param manager Entry point to ComputeManager. + */ + public static void listGalleryApplicationsInAGallery( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .galleryApplications() + .listByGallery("myResourceGroup", "myGalleryName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryApplicationsUpdateSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryApplicationsUpdateSamples.java new file mode 100644 index 0000000000000..806755f8b6157 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryApplicationsUpdateSamples.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.generated; + +import com.azure.resourcemanager.compute.generated.models.GalleryApplication; +import com.azure.resourcemanager.compute.generated.models.GalleryApplicationCustomAction; +import com.azure.resourcemanager.compute.generated.models.GalleryApplicationCustomActionParameter; +import com.azure.resourcemanager.compute.generated.models.GalleryApplicationCustomActionParameterType; +import com.azure.resourcemanager.compute.generated.models.OperatingSystemTypes; +import java.util.Arrays; + +/** Samples for GalleryApplications Update. */ +public final class GalleryApplicationsUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/GalleryApplication_Update.json + */ + /** + * Sample code: Update a simple gallery Application. + * + * @param manager Entry point to ComputeManager. + */ + public static void updateASimpleGalleryApplication( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + GalleryApplication resource = + manager + .galleryApplications() + .getWithResponse( + "myResourceGroup", "myGalleryName", "myGalleryApplicationName", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withDescription("This is the gallery application description.") + .withEula("This is the gallery application EULA.") + .withPrivacyStatementUri("myPrivacyStatementUri}") + .withReleaseNoteUri("myReleaseNoteUri") + .withSupportedOSType(OperatingSystemTypes.WINDOWS) + .withCustomActions( + Arrays + .asList( + new GalleryApplicationCustomAction() + .withName("myCustomAction") + .withScript("myCustomActionScript") + .withDescription("This is the custom action description.") + .withParameters( + Arrays + .asList( + new GalleryApplicationCustomActionParameter() + .withName("myCustomActionParameter") + .withRequired(false) + .withType(GalleryApplicationCustomActionParameterType.STRING) + .withDefaultValue("default value of parameter.") + .withDescription("This is the description of the parameter"))))) + .apply(); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryImageVersionsCreateOrUpdateSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryImageVersionsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..8f56935a6b1d3 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryImageVersionsCreateOrUpdateSamples.java @@ -0,0 +1,649 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +import com.azure.resourcemanager.compute.generated.models.DataDiskImageEncryption; +import com.azure.resourcemanager.compute.generated.models.EncryptionImages; +import com.azure.resourcemanager.compute.generated.models.GalleryArtifactVersionFullSource; +import com.azure.resourcemanager.compute.generated.models.GalleryDataDiskImage; +import com.azure.resourcemanager.compute.generated.models.GalleryDiskImageSource; +import com.azure.resourcemanager.compute.generated.models.GalleryImageVersionPublishingProfile; +import com.azure.resourcemanager.compute.generated.models.GalleryImageVersionSafetyProfile; +import com.azure.resourcemanager.compute.generated.models.GalleryImageVersionStorageProfile; +import com.azure.resourcemanager.compute.generated.models.GalleryOSDiskImage; +import com.azure.resourcemanager.compute.generated.models.HostCaching; +import com.azure.resourcemanager.compute.generated.models.OSDiskImageEncryption; +import com.azure.resourcemanager.compute.generated.models.ReplicationMode; +import com.azure.resourcemanager.compute.generated.models.StorageAccountType; +import com.azure.resourcemanager.compute.generated.models.TargetRegion; +import java.util.Arrays; + +/** Samples for GalleryImageVersions CreateOrUpdate. */ +public final class GalleryImageVersionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/GalleryImageVersion_Create_WithShallowReplicationMode.json + */ + /** + * Sample code: Create or update a simple Gallery Image Version using shallow replication mode. + * + * @param manager Entry point to ComputeManager. + */ + public static void createOrUpdateASimpleGalleryImageVersionUsingShallowReplicationMode( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .galleryImageVersions() + .define("1.0.0") + .withRegion("West US") + .withExistingImage("myResourceGroup", "myGalleryName", "myGalleryImageName") + .withPublishingProfile( + new GalleryImageVersionPublishingProfile() + .withTargetRegions( + Arrays + .asList( + new TargetRegion() + .withName("West US") + .withRegionalReplicaCount(1) + .withExcludeFromLatest(false))) + .withReplicationMode(ReplicationMode.SHALLOW)) + .withStorageProfile( + new GalleryImageVersionStorageProfile() + .withSource( + new GalleryArtifactVersionFullSource() + .withId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}"))) + .withSafetyProfile(new GalleryImageVersionSafetyProfile().withAllowDeletionOfReplicatedLocations(false)) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/GalleryImageVersion_Create_WithVHD.json + */ + /** + * Sample code: Create or update a simple Gallery Image Version using vhd as a source. + * + * @param manager Entry point to ComputeManager. + */ + public static void createOrUpdateASimpleGalleryImageVersionUsingVhdAsASource( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .galleryImageVersions() + .define("1.0.0") + .withRegion("West US") + .withExistingImage("myResourceGroup", "myGalleryName", "myGalleryImageName") + .withPublishingProfile( + new GalleryImageVersionPublishingProfile() + .withTargetRegions( + Arrays + .asList( + new TargetRegion() + .withName("West US") + .withRegionalReplicaCount(1) + .withEncryption( + new EncryptionImages() + .withOsDiskImage( + new OSDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myDiskEncryptionSet")) + .withDataDiskImages( + Arrays + .asList( + new DataDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherDiskEncryptionSet") + .withLun(1)))) + .withExcludeFromLatest(false), + new TargetRegion() + .withName("East US") + .withRegionalReplicaCount(2) + .withStorageAccountType(StorageAccountType.STANDARD_ZRS) + .withExcludeFromLatest(false)))) + .withStorageProfile( + new GalleryImageVersionStorageProfile() + .withOsDiskImage( + new GalleryOSDiskImage() + .withHostCaching(HostCaching.READ_ONLY) + .withSource( + new GalleryDiskImageSource() + .withId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/{storageAccount}") + .withUri( + "https://gallerysourcencus.blob.core.windows.net/myvhds/Windows-Server-2012-R2-20171216-en.us-128GB.vhd"))) + .withDataDiskImages( + Arrays + .asList( + new GalleryDataDiskImage() + .withHostCaching(HostCaching.NONE) + .withSource( + new GalleryDiskImageSource() + .withId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/{storageAccount}") + .withUri( + "https://gallerysourcencus.blob.core.windows.net/myvhds/Windows-Server-2012-R2-20171216-en.us-128GB.vhd")) + .withLun(1)))) + .withSafetyProfile(new GalleryImageVersionSafetyProfile().withAllowDeletionOfReplicatedLocations(false)) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/GalleryImageVersion_Create_WithVmAsSource.json + */ + /** + * Sample code: Create or update a simple Gallery Image Version using VM as source. + * + * @param manager Entry point to ComputeManager. + */ + public static void createOrUpdateASimpleGalleryImageVersionUsingVMAsSource( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .galleryImageVersions() + .define("1.0.0") + .withRegion("West US") + .withExistingImage("myResourceGroup", "myGalleryName", "myGalleryImageName") + .withPublishingProfile( + new GalleryImageVersionPublishingProfile() + .withTargetRegions( + Arrays + .asList( + new TargetRegion() + .withName("West US") + .withRegionalReplicaCount(2) + .withEncryption( + new EncryptionImages() + .withOsDiskImage( + new OSDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet")) + .withDataDiskImages( + Arrays + .asList( + new DataDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet") + .withLun(0), + new DataDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet") + .withLun(1)))) + .withExcludeFromLatest(false), + new TargetRegion() + .withName("East US") + .withRegionalReplicaCount(2) + .withStorageAccountType(StorageAccountType.STANDARD_ZRS) + .withEncryption( + new EncryptionImages() + .withOsDiskImage( + new OSDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet")) + .withDataDiskImages( + Arrays + .asList( + new DataDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet") + .withLun(0), + new DataDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet") + .withLun(1)))) + .withExcludeFromLatest(false)))) + .withStorageProfile( + new GalleryImageVersionStorageProfile() + .withSource( + new GalleryArtifactVersionFullSource() + .withId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/virtualMachines/{vmName}"))) + .withSafetyProfile(new GalleryImageVersionSafetyProfile().withAllowDeletionOfReplicatedLocations(false)) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/GalleryImageVersion_Create_WithImageVersionAsSource.json + */ + /** + * Sample code: Create or update a simple Gallery Image Version using shared image as source. + * + * @param manager Entry point to ComputeManager. + */ + public static void createOrUpdateASimpleGalleryImageVersionUsingSharedImageAsSource( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .galleryImageVersions() + .define("1.0.0") + .withRegion("West US") + .withExistingImage("myResourceGroup", "myGalleryName", "myGalleryImageName") + .withPublishingProfile( + new GalleryImageVersionPublishingProfile() + .withTargetRegions( + Arrays + .asList( + new TargetRegion() + .withName("West US") + .withRegionalReplicaCount(1) + .withEncryption( + new EncryptionImages() + .withOsDiskImage( + new OSDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet")) + .withDataDiskImages( + Arrays + .asList( + new DataDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet") + .withLun(0), + new DataDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet") + .withLun(1)))) + .withExcludeFromLatest(false), + new TargetRegion() + .withName("East US") + .withRegionalReplicaCount(2) + .withStorageAccountType(StorageAccountType.STANDARD_ZRS) + .withEncryption( + new EncryptionImages() + .withOsDiskImage( + new OSDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet")) + .withDataDiskImages( + Arrays + .asList( + new DataDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet") + .withLun(0), + new DataDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet") + .withLun(1)))) + .withExcludeFromLatest(false)))) + .withStorageProfile( + new GalleryImageVersionStorageProfile() + .withSource( + new GalleryArtifactVersionFullSource() + .withId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageDefinitionName}/versions/{versionName}"))) + .withSafetyProfile(new GalleryImageVersionSafetyProfile().withAllowDeletionOfReplicatedLocations(false)) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/GalleryImageVersion_Create_WithSnapshotsAsSource.json + */ + /** + * Sample code: Create or update a simple Gallery Image Version using mix of disks and snapshots as a source. + * + * @param manager Entry point to ComputeManager. + */ + public static void createOrUpdateASimpleGalleryImageVersionUsingMixOfDisksAndSnapshotsAsASource( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .galleryImageVersions() + .define("1.0.0") + .withRegion("West US") + .withExistingImage("myResourceGroup", "myGalleryName", "myGalleryImageName") + .withPublishingProfile( + new GalleryImageVersionPublishingProfile() + .withTargetRegions( + Arrays + .asList( + new TargetRegion() + .withName("West US") + .withRegionalReplicaCount(1) + .withEncryption( + new EncryptionImages() + .withOsDiskImage( + new OSDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet")) + .withDataDiskImages( + Arrays + .asList( + new DataDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet") + .withLun(1)))) + .withExcludeFromLatest(false), + new TargetRegion() + .withName("East US") + .withRegionalReplicaCount(2) + .withStorageAccountType(StorageAccountType.STANDARD_ZRS) + .withEncryption( + new EncryptionImages() + .withOsDiskImage( + new OSDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet")) + .withDataDiskImages( + Arrays + .asList( + new DataDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet") + .withLun(1)))) + .withExcludeFromLatest(false)))) + .withStorageProfile( + new GalleryImageVersionStorageProfile() + .withOsDiskImage( + new GalleryOSDiskImage() + .withHostCaching(HostCaching.READ_ONLY) + .withSource( + new GalleryDiskImageSource() + .withId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/snapshots/{osSnapshotName}"))) + .withDataDiskImages( + Arrays + .asList( + new GalleryDataDiskImage() + .withHostCaching(HostCaching.NONE) + .withSource( + new GalleryDiskImageSource() + .withId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/disks/{dataDiskName}")) + .withLun(1)))) + .withSafetyProfile(new GalleryImageVersionSafetyProfile().withAllowDeletionOfReplicatedLocations(false)) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/GalleryImageVersion_Create_WithSnapshotsAsSource.json + */ + /** + * Sample code: Create or update a simple Gallery Image Version using snapshots as a source. + * + * @param manager Entry point to ComputeManager. + */ + public static void createOrUpdateASimpleGalleryImageVersionUsingSnapshotsAsASource( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .galleryImageVersions() + .define("1.0.0") + .withRegion("West US") + .withExistingImage("myResourceGroup", "myGalleryName", "myGalleryImageName") + .withPublishingProfile( + new GalleryImageVersionPublishingProfile() + .withTargetRegions( + Arrays + .asList( + new TargetRegion() + .withName("West US") + .withRegionalReplicaCount(1) + .withEncryption( + new EncryptionImages() + .withOsDiskImage( + new OSDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet")) + .withDataDiskImages( + Arrays + .asList( + new DataDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet") + .withLun(1)))) + .withExcludeFromLatest(false), + new TargetRegion() + .withName("East US") + .withRegionalReplicaCount(2) + .withStorageAccountType(StorageAccountType.STANDARD_ZRS) + .withEncryption( + new EncryptionImages() + .withOsDiskImage( + new OSDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet")) + .withDataDiskImages( + Arrays + .asList( + new DataDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet") + .withLun(1)))) + .withExcludeFromLatest(false)))) + .withStorageProfile( + new GalleryImageVersionStorageProfile() + .withOsDiskImage( + new GalleryOSDiskImage() + .withHostCaching(HostCaching.READ_ONLY) + .withSource( + new GalleryDiskImageSource() + .withId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/snapshots/{osSnapshotName}"))) + .withDataDiskImages( + Arrays + .asList( + new GalleryDataDiskImage() + .withHostCaching(HostCaching.NONE) + .withSource( + new GalleryDiskImageSource() + .withId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/disks/{dataDiskName}")) + .withLun(1)))) + .withSafetyProfile(new GalleryImageVersionSafetyProfile().withAllowDeletionOfReplicatedLocations(false)) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/GalleryImageVersion_Create_WithTargetExtendedLocations.json + */ + /** + * Sample code: Create or update a simple gallery image version with target extended locations specified. + * + * @param manager Entry point to ComputeManager. + */ + public static void createOrUpdateASimpleGalleryImageVersionWithTargetExtendedLocationsSpecified( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .galleryImageVersions() + .define("1.0.0") + .withRegion("West US") + .withExistingImage("myResourceGroup", "myGalleryName", "myGalleryImageName") + .withPublishingProfile( + new GalleryImageVersionPublishingProfile() + .withTargetRegions( + Arrays + .asList( + new TargetRegion() + .withName("West US") + .withRegionalReplicaCount(1) + .withEncryption( + new EncryptionImages() + .withOsDiskImage( + new OSDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet")) + .withDataDiskImages( + Arrays + .asList( + new DataDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet") + .withLun(0), + new DataDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet") + .withLun(1)))) + .withExcludeFromLatest(false), + new TargetRegion() + .withName("East US") + .withRegionalReplicaCount(2) + .withStorageAccountType(StorageAccountType.STANDARD_ZRS) + .withEncryption( + new EncryptionImages() + .withOsDiskImage( + new OSDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet")) + .withDataDiskImages( + Arrays + .asList( + new DataDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet") + .withLun(0), + new DataDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet") + .withLun(1)))) + .withExcludeFromLatest(false)))) + .withStorageProfile( + new GalleryImageVersionStorageProfile() + .withSource( + new GalleryArtifactVersionFullSource() + .withId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}"))) + .withSafetyProfile(new GalleryImageVersionSafetyProfile().withAllowDeletionOfReplicatedLocations(false)) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/GalleryImageVersion_Create_WithCommunityImageVersionAsSource.json + */ + /** + * Sample code: Create or update a simple Gallery Image Version using community gallery image as source. + * + * @param manager Entry point to ComputeManager. + */ + public static void createOrUpdateASimpleGalleryImageVersionUsingCommunityGalleryImageAsSource( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .galleryImageVersions() + .define("1.0.0") + .withRegion("West US") + .withExistingImage("myResourceGroup", "myGalleryName", "myGalleryImageName") + .withPublishingProfile( + new GalleryImageVersionPublishingProfile() + .withTargetRegions( + Arrays + .asList( + new TargetRegion() + .withName("West US") + .withRegionalReplicaCount(1) + .withEncryption( + new EncryptionImages() + .withOsDiskImage( + new OSDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet")) + .withDataDiskImages( + Arrays + .asList( + new DataDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet") + .withLun(0), + new DataDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet") + .withLun(1)))) + .withExcludeFromLatest(false), + new TargetRegion() + .withName("East US") + .withRegionalReplicaCount(2) + .withStorageAccountType(StorageAccountType.STANDARD_ZRS) + .withEncryption( + new EncryptionImages() + .withOsDiskImage( + new OSDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet")) + .withDataDiskImages( + Arrays + .asList( + new DataDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet") + .withLun(0), + new DataDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet") + .withLun(1)))) + .withExcludeFromLatest(false)))) + .withStorageProfile( + new GalleryImageVersionStorageProfile() + .withSource( + new GalleryArtifactVersionFullSource() + .withCommunityGalleryImageId( + "/communityGalleries/{communityGalleryName}/images/{communityGalleryImageName}"))) + .withSafetyProfile(new GalleryImageVersionSafetyProfile().withAllowDeletionOfReplicatedLocations(false)) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/GalleryImageVersion_Create.json + */ + /** + * Sample code: Create or update a simple Gallery Image Version using managed image as source. + * + * @param manager Entry point to ComputeManager. + */ + public static void createOrUpdateASimpleGalleryImageVersionUsingManagedImageAsSource( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .galleryImageVersions() + .define("1.0.0") + .withRegion("West US") + .withExistingImage("myResourceGroup", "myGalleryName", "myGalleryImageName") + .withPublishingProfile( + new GalleryImageVersionPublishingProfile() + .withTargetRegions( + Arrays + .asList( + new TargetRegion() + .withName("West US") + .withRegionalReplicaCount(1) + .withEncryption( + new EncryptionImages() + .withOsDiskImage( + new OSDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet")) + .withDataDiskImages( + Arrays + .asList( + new DataDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet") + .withLun(0), + new DataDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet") + .withLun(1)))) + .withExcludeFromLatest(false), + new TargetRegion() + .withName("East US") + .withRegionalReplicaCount(2) + .withStorageAccountType(StorageAccountType.STANDARD_ZRS) + .withEncryption( + new EncryptionImages() + .withOsDiskImage( + new OSDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet")) + .withDataDiskImages( + Arrays + .asList( + new DataDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet") + .withLun(0), + new DataDiskImageEncryption() + .withDiskEncryptionSetId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet") + .withLun(1)))) + .withExcludeFromLatest(false)))) + .withStorageProfile( + new GalleryImageVersionStorageProfile() + .withSource( + new GalleryArtifactVersionFullSource() + .withId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}"))) + .withSafetyProfile(new GalleryImageVersionSafetyProfile().withAllowDeletionOfReplicatedLocations(false)) + .create(); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryImageVersionsDeleteSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryImageVersionsDeleteSamples.java new file mode 100644 index 0000000000000..b2c371ea41d60 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryImageVersionsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for GalleryImageVersions Delete. */ +public final class GalleryImageVersionsDeleteSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/GalleryImageVersion_Delete.json + */ + /** + * Sample code: Delete a gallery image version. + * + * @param manager Entry point to ComputeManager. + */ + public static void deleteAGalleryImageVersion(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .galleryImageVersions() + .delete( + "myResourceGroup", "myGalleryName", "myGalleryImageName", "1.0.0", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryImageVersionsGetSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryImageVersionsGetSamples.java new file mode 100644 index 0000000000000..68bbfec899664 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryImageVersionsGetSamples.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.generated; + +import com.azure.resourcemanager.compute.generated.models.ReplicationStatusTypes; + +/** Samples for GalleryImageVersions Get. */ +public final class GalleryImageVersionsGetSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/GalleryImageVersion_Get_WithVhdAsSource.json + */ + /** + * Sample code: Get a gallery image version with vhd as a source. + * + * @param manager Entry point to ComputeManager. + */ + public static void getAGalleryImageVersionWithVhdAsASource( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .galleryImageVersions() + .getWithResponse( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/GalleryImageVersion_Get.json + */ + /** + * Sample code: Get a gallery image version. + * + * @param manager Entry point to ComputeManager. + */ + public static void getAGalleryImageVersion(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .galleryImageVersions() + .getWithResponse( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/GalleryImageVersion_Get_WithReplicationStatus.json + */ + /** + * Sample code: Get a gallery image version with replication status. + * + * @param manager Entry point to ComputeManager. + */ + public static void getAGalleryImageVersionWithReplicationStatus( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .galleryImageVersions() + .getWithResponse( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + ReplicationStatusTypes.REPLICATION_STATUS, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/GalleryImageVersion_Get_WithSnapshotsAsSource.json + */ + /** + * Sample code: Get a gallery image version with snapshots as a source. + * + * @param manager Entry point to ComputeManager. + */ + public static void getAGalleryImageVersionWithSnapshotsAsASource( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .galleryImageVersions() + .getWithResponse( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + null, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryImageVersionsListByGalleryImageSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryImageVersionsListByGalleryImageSamples.java new file mode 100644 index 0000000000000..0eaef48aa0262 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryImageVersionsListByGalleryImageSamples.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.generated; + +/** Samples for GalleryImageVersions ListByGalleryImage. */ +public final class GalleryImageVersionsListByGalleryImageSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/GalleryImageVersion_ListByGalleryImage.json + */ + /** + * Sample code: List gallery image versions in a gallery image definition. + * + * @param manager Entry point to ComputeManager. + */ + public static void listGalleryImageVersionsInAGalleryImageDefinition( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .galleryImageVersions() + .listByGalleryImage( + "myResourceGroup", "myGalleryName", "myGalleryImageName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryImageVersionsUpdateSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryImageVersionsUpdateSamples.java new file mode 100644 index 0000000000000..30d47e88f28c5 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryImageVersionsUpdateSamples.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.generated; + +import com.azure.resourcemanager.compute.generated.models.GalleryArtifactVersionFullSource; +import com.azure.resourcemanager.compute.generated.models.GalleryImageVersion; +import com.azure.resourcemanager.compute.generated.models.GalleryImageVersionPublishingProfile; +import com.azure.resourcemanager.compute.generated.models.GalleryImageVersionStorageProfile; +import com.azure.resourcemanager.compute.generated.models.StorageAccountType; +import com.azure.resourcemanager.compute.generated.models.TargetRegion; +import java.util.Arrays; + +/** Samples for GalleryImageVersions Update. */ +public final class GalleryImageVersionsUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/GalleryImageVersion_Update.json + */ + /** + * Sample code: Update a simple Gallery Image Version (Managed Image as source). + * + * @param manager Entry point to ComputeManager. + */ + public static void updateASimpleGalleryImageVersionManagedImageAsSource( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + GalleryImageVersion resource = + manager + .galleryImageVersions() + .getWithResponse( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + null, + com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withPublishingProfile( + new GalleryImageVersionPublishingProfile() + .withTargetRegions( + Arrays + .asList( + new TargetRegion().withName("West US").withRegionalReplicaCount(1), + new TargetRegion() + .withName("East US") + .withRegionalReplicaCount(2) + .withStorageAccountType(StorageAccountType.STANDARD_ZRS)))) + .withStorageProfile( + new GalleryImageVersionStorageProfile() + .withSource( + new GalleryArtifactVersionFullSource() + .withId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}"))) + .apply(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/GalleryImageVersion_Update_WithoutSourceId.json + */ + /** + * Sample code: Update a simple Gallery Image Version without source id. + * + * @param manager Entry point to ComputeManager. + */ + public static void updateASimpleGalleryImageVersionWithoutSourceId( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + GalleryImageVersion resource = + manager + .galleryImageVersions() + .getWithResponse( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + null, + com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withPublishingProfile( + new GalleryImageVersionPublishingProfile() + .withTargetRegions( + Arrays + .asList( + new TargetRegion().withName("West US").withRegionalReplicaCount(1), + new TargetRegion() + .withName("East US") + .withRegionalReplicaCount(2) + .withStorageAccountType(StorageAccountType.STANDARD_ZRS)))) + .withStorageProfile(new GalleryImageVersionStorageProfile()) + .apply(); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryImagesCreateOrUpdateSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryImagesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..68d3adf02330a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryImagesCreateOrUpdateSamples.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.generated; + +import com.azure.resourcemanager.compute.generated.models.GalleryImageIdentifier; +import com.azure.resourcemanager.compute.generated.models.HyperVGeneration; +import com.azure.resourcemanager.compute.generated.models.OperatingSystemStateTypes; +import com.azure.resourcemanager.compute.generated.models.OperatingSystemTypes; + +/** Samples for GalleryImages CreateOrUpdate. */ +public final class GalleryImagesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/GalleryImage_Create.json + */ + /** + * Sample code: Create or update a simple gallery image. + * + * @param manager Entry point to ComputeManager. + */ + public static void createOrUpdateASimpleGalleryImage( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .galleryImages() + .define("myGalleryImageName") + .withRegion("West US") + .withExistingGallery("myResourceGroup", "myGalleryName") + .withOsType(OperatingSystemTypes.WINDOWS) + .withOsState(OperatingSystemStateTypes.GENERALIZED) + .withHyperVGeneration(HyperVGeneration.V1) + .withIdentifier( + new GalleryImageIdentifier() + .withPublisher("myPublisherName") + .withOffer("myOfferName") + .withSku("mySkuName")) + .create(); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryImagesDeleteSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryImagesDeleteSamples.java new file mode 100644 index 0000000000000..b92459cf39140 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryImagesDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for GalleryImages Delete. */ +public final class GalleryImagesDeleteSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/GalleryImage_Delete.json + */ + /** + * Sample code: Delete a gallery image. + * + * @param manager Entry point to ComputeManager. + */ + public static void deleteAGalleryImage(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .galleryImages() + .delete("myResourceGroup", "myGalleryName", "myGalleryImageName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryImagesGetSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryImagesGetSamples.java new file mode 100644 index 0000000000000..cb38471c5e2da --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryImagesGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for GalleryImages Get. */ +public final class GalleryImagesGetSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/GalleryImage_Get.json + */ + /** + * Sample code: Get a gallery image. + * + * @param manager Entry point to ComputeManager. + */ + public static void getAGalleryImage(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .galleryImages() + .getWithResponse( + "myResourceGroup", "myGalleryName", "myGalleryImageName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryImagesListByGallerySamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryImagesListByGallerySamples.java new file mode 100644 index 0000000000000..89100fbd8453a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryImagesListByGallerySamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for GalleryImages ListByGallery. */ +public final class GalleryImagesListByGallerySamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/GalleryImage_ListByGallery.json + */ + /** + * Sample code: List gallery images in a gallery. + * + * @param manager Entry point to ComputeManager. + */ + public static void listGalleryImagesInAGallery(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.galleryImages().listByGallery("myResourceGroup", "myGalleryName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryImagesUpdateSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryImagesUpdateSamples.java new file mode 100644 index 0000000000000..adf7412b52194 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GalleryImagesUpdateSamples.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.generated; + +import com.azure.resourcemanager.compute.generated.models.GalleryImage; +import com.azure.resourcemanager.compute.generated.models.GalleryImageIdentifier; +import com.azure.resourcemanager.compute.generated.models.HyperVGeneration; +import com.azure.resourcemanager.compute.generated.models.OperatingSystemStateTypes; +import com.azure.resourcemanager.compute.generated.models.OperatingSystemTypes; + +/** Samples for GalleryImages Update. */ +public final class GalleryImagesUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/GalleryImage_Update.json + */ + /** + * Sample code: Update a simple gallery image. + * + * @param manager Entry point to ComputeManager. + */ + public static void updateASimpleGalleryImage(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + GalleryImage resource = + manager + .galleryImages() + .getWithResponse( + "myResourceGroup", "myGalleryName", "myGalleryImageName", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withOsType(OperatingSystemTypes.WINDOWS) + .withOsState(OperatingSystemStateTypes.GENERALIZED) + .withHyperVGeneration(HyperVGeneration.V1) + .withIdentifier( + new GalleryImageIdentifier() + .withPublisher("myPublisherName") + .withOffer("myOfferName") + .withSku("mySkuName")) + .apply(); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GallerySharingProfileUpdateSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GallerySharingProfileUpdateSamples.java new file mode 100644 index 0000000000000..f544c2ad565e5 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/GallerySharingProfileUpdateSamples.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.generated; + +import com.azure.resourcemanager.compute.generated.fluent.models.SharingUpdateInner; +import com.azure.resourcemanager.compute.generated.models.SharingProfileGroup; +import com.azure.resourcemanager.compute.generated.models.SharingProfileGroupTypes; +import com.azure.resourcemanager.compute.generated.models.SharingUpdateOperationTypes; +import java.util.Arrays; + +/** Samples for GallerySharingProfile Update. */ +public final class GallerySharingProfileUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/Gallery_EnableCommunityGallery.json + */ + /** + * Sample code: share a gallery to community. + * + * @param manager Entry point to ComputeManager. + */ + public static void shareAGalleryToCommunity(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .gallerySharingProfiles() + .update( + "myResourceGroup", + "myGalleryName", + new SharingUpdateInner().withOperationType(SharingUpdateOperationTypes.ENABLE_COMMUNITY), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/Gallery_ResetSharingProfile.json + */ + /** + * Sample code: reset sharing profile of a gallery. + * + * @param manager Entry point to ComputeManager. + */ + public static void resetSharingProfileOfAGallery( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .gallerySharingProfiles() + .update( + "myResourceGroup", + "myGalleryName", + new SharingUpdateInner().withOperationType(SharingUpdateOperationTypes.RESET), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/Gallery_AddToSharingProfile.json + */ + /** + * Sample code: Add sharing id to the sharing profile of a gallery. + * + * @param manager Entry point to ComputeManager. + */ + public static void addSharingIdToTheSharingProfileOfAGallery( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .gallerySharingProfiles() + .update( + "myResourceGroup", + "myGalleryName", + new SharingUpdateInner() + .withOperationType(SharingUpdateOperationTypes.ADD) + .withGroups( + Arrays + .asList( + new SharingProfileGroup() + .withType(SharingProfileGroupTypes.SUBSCRIPTIONS) + .withIds( + Arrays + .asList( + "34a4ab42-0d72-47d9-bd1a-aed207386dac", + "380fd389-260b-41aa-bad9-0a83108c370b")), + new SharingProfileGroup() + .withType(SharingProfileGroupTypes.AADTENANTS) + .withIds(Arrays.asList("c24c76aa-8897-4027-9b03-8f7928b54ff6")))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/ImagesCreateOrUpdateSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/ImagesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..5f74e310bb42f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/ImagesCreateOrUpdateSamples.java @@ -0,0 +1,325 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.compute.generated.models.DiskEncryptionSetParameters; +import com.azure.resourcemanager.compute.generated.models.ImageDataDisk; +import com.azure.resourcemanager.compute.generated.models.ImageOSDisk; +import com.azure.resourcemanager.compute.generated.models.ImageStorageProfile; +import com.azure.resourcemanager.compute.generated.models.OperatingSystemStateTypes; +import com.azure.resourcemanager.compute.generated.models.OperatingSystemTypes; +import java.util.Arrays; + +/** Samples for Images CreateOrUpdate. */ +public final class ImagesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/imageExamples/Image_CreateFromASnapshot.json + */ + /** + * Sample code: Create a virtual machine image from a snapshot. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVirtualMachineImageFromASnapshot( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .images() + .define("myImage") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withStorageProfile( + new ImageStorageProfile() + .withOsDisk( + new ImageOSDisk() + .withSnapshot( + new SubResource() + .withId( + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot")) + .withOsType(OperatingSystemTypes.LINUX) + .withOsState(OperatingSystemStateTypes.GENERALIZED)) + .withZoneResilient(false)) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/imageExamples/Image_CreateFromAManagedDisk.json + */ + /** + * Sample code: Create a virtual machine image from a managed disk. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVirtualMachineImageFromAManagedDisk( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .images() + .define("myImage") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withStorageProfile( + new ImageStorageProfile() + .withOsDisk( + new ImageOSDisk() + .withManagedDisk( + new SubResource() + .withId( + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk")) + .withOsType(OperatingSystemTypes.LINUX) + .withOsState(OperatingSystemStateTypes.GENERALIZED)) + .withZoneResilient(true)) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/imageExamples/Image_CreateFromABlobWithDiskEncryptionSet.json + */ + /** + * Sample code: Create a virtual machine image from a blob with DiskEncryptionSet resource. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVirtualMachineImageFromABlobWithDiskEncryptionSetResource( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .images() + .define("myImage") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withStorageProfile( + new ImageStorageProfile() + .withOsDisk( + new ImageOSDisk() + .withBlobUri("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd") + .withDiskEncryptionSet( + new DiskEncryptionSetParameters() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}")) + .withOsType(OperatingSystemTypes.LINUX) + .withOsState(OperatingSystemStateTypes.GENERALIZED))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/imageExamples/Image_CreateFromAManagedDiskWithDiskEncryptionSet.json + */ + /** + * Sample code: Create a virtual machine image from a managed disk with DiskEncryptionSet resource. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVirtualMachineImageFromAManagedDiskWithDiskEncryptionSetResource( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .images() + .define("myImage") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withStorageProfile( + new ImageStorageProfile() + .withOsDisk( + new ImageOSDisk() + .withSnapshot( + new SubResource() + .withId( + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot")) + .withDiskEncryptionSet( + new DiskEncryptionSetParameters() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}")) + .withOsType(OperatingSystemTypes.LINUX) + .withOsState(OperatingSystemStateTypes.GENERALIZED))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/imageExamples/Image_Create_DataDiskFromABlobIncluded.json + */ + /** + * Sample code: Create a virtual machine image that includes a data disk from a blob. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVirtualMachineImageThatIncludesADataDiskFromABlob( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .images() + .define("myImage") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withStorageProfile( + new ImageStorageProfile() + .withOsDisk( + new ImageOSDisk() + .withBlobUri("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd") + .withOsType(OperatingSystemTypes.LINUX) + .withOsState(OperatingSystemStateTypes.GENERALIZED)) + .withDataDisks( + Arrays + .asList( + new ImageDataDisk() + .withBlobUri( + "https://mystorageaccount.blob.core.windows.net/dataimages/dataimage.vhd") + .withLun(1))) + .withZoneResilient(false)) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/imageExamples/Image_CreateFromASnapshotWithDiskEncryptionSet.json + */ + /** + * Sample code: Create a virtual machine image from a snapshot with DiskEncryptionSet resource. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVirtualMachineImageFromASnapshotWithDiskEncryptionSetResource( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .images() + .define("myImage") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withStorageProfile( + new ImageStorageProfile() + .withOsDisk( + new ImageOSDisk() + .withManagedDisk( + new SubResource() + .withId( + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk")) + .withDiskEncryptionSet( + new DiskEncryptionSetParameters() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}")) + .withOsType(OperatingSystemTypes.LINUX) + .withOsState(OperatingSystemStateTypes.GENERALIZED))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/imageExamples/Image_Create_DataDiskFromASnapshotIncluded.json + */ + /** + * Sample code: Create a virtual machine image that includes a data disk from a snapshot. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVirtualMachineImageThatIncludesADataDiskFromASnapshot( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .images() + .define("myImage") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withStorageProfile( + new ImageStorageProfile() + .withOsDisk( + new ImageOSDisk() + .withSnapshot( + new SubResource() + .withId( + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot")) + .withOsType(OperatingSystemTypes.LINUX) + .withOsState(OperatingSystemStateTypes.GENERALIZED)) + .withDataDisks( + Arrays + .asList( + new ImageDataDisk() + .withSnapshot( + new SubResource() + .withId( + "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot2")) + .withLun(1))) + .withZoneResilient(true)) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/imageExamples/Image_CreateFromABlob.json + */ + /** + * Sample code: Create a virtual machine image from a blob. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVirtualMachineImageFromABlob( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .images() + .define("myImage") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withStorageProfile( + new ImageStorageProfile() + .withOsDisk( + new ImageOSDisk() + .withBlobUri("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd") + .withOsType(OperatingSystemTypes.LINUX) + .withOsState(OperatingSystemStateTypes.GENERALIZED)) + .withZoneResilient(true)) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/imageExamples/Image_CreateFromAVM.json + */ + /** + * Sample code: Create a virtual machine image from an existing virtual machine. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVirtualMachineImageFromAnExistingVirtualMachine( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .images() + .define("myImage") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withSourceVirtualMachine( + new SubResource() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM")) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/imageExamples/Image_Create_DataDiskFromAManagedDiskIncluded.json + */ + /** + * Sample code: Create a virtual machine image that includes a data disk from a managed disk. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVirtualMachineImageThatIncludesADataDiskFromAManagedDisk( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .images() + .define("myImage") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withStorageProfile( + new ImageStorageProfile() + .withOsDisk( + new ImageOSDisk() + .withManagedDisk( + new SubResource() + .withId( + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk")) + .withOsType(OperatingSystemTypes.LINUX) + .withOsState(OperatingSystemStateTypes.GENERALIZED)) + .withDataDisks( + Arrays + .asList( + new ImageDataDisk() + .withManagedDisk( + new SubResource() + .withId( + "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk2")) + .withLun(1))) + .withZoneResilient(false)) + .create(); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/ImagesDeleteSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/ImagesDeleteSamples.java new file mode 100644 index 0000000000000..23b6625110a7c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/ImagesDeleteSamples.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.generated; + +/** Samples for Images Delete. */ +public final class ImagesDeleteSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/imageExamples/Images_Delete_MinimumSet_Gen.json + */ + /** + * Sample code: Image_Delete_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void imageDeleteMinimumSetGen(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.images().delete("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/imageExamples/Images_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: Image_Delete_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void imageDeleteMaximumSetGen(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.images().delete("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/ImagesGetByResourceGroupSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/ImagesGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..7e8e05d03bd7b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/ImagesGetByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for Images GetByResourceGroup. */ +public final class ImagesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/imageExamples/Image_Get.json + */ + /** + * Sample code: Get information about a virtual machine image. + * + * @param manager Entry point to ComputeManager. + */ + public static void getInformationAboutAVirtualMachineImage( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .images() + .getByResourceGroupWithResponse("myResourceGroup", "myImage", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/ImagesListByResourceGroupSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/ImagesListByResourceGroupSamples.java new file mode 100644 index 0000000000000..c98ba10d1a587 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/ImagesListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for Images ListByResourceGroup. */ +public final class ImagesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/imageExamples/Image_ListByResourceGroup.json + */ + /** + * Sample code: List all virtual machine images in a resource group. + * + * @param manager Entry point to ComputeManager. + */ + public static void listAllVirtualMachineImagesInAResourceGroup( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.images().listByResourceGroup("myResourceGroup", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/ImagesListSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/ImagesListSamples.java new file mode 100644 index 0000000000000..07d5a1549d731 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/ImagesListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for Images List. */ +public final class ImagesListSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/imageExamples/Image_ListBySubscription.json + */ + /** + * Sample code: List all virtual machine images in a subscription. + * + * @param manager Entry point to ComputeManager. + */ + public static void listAllVirtualMachineImagesInASubscription( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.images().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/ImagesUpdateSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/ImagesUpdateSamples.java new file mode 100644 index 0000000000000..428ab3b2d6ac7 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/ImagesUpdateSamples.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.generated; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.compute.generated.models.HyperVGenerationTypes; +import com.azure.resourcemanager.compute.generated.models.Image; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Images Update. */ +public final class ImagesUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/imageExamples/Image_Update.json + */ + /** + * Sample code: Updates tags of an Image. + * + * @param manager Entry point to ComputeManager. + */ + public static void updatesTagsOfAnImage(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + Image resource = + manager + .images() + .getByResourceGroupWithResponse("myResourceGroup", "myImage", null, com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("department", "HR")) + .withSourceVirtualMachine( + new SubResource() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM")) + .withHyperVGeneration(HyperVGenerationTypes.V1) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/LogAnalyticsExportRequestRateByIntervalSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/LogAnalyticsExportRequestRateByIntervalSamples.java new file mode 100644 index 0000000000000..97ce9d8488b82 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/LogAnalyticsExportRequestRateByIntervalSamples.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.generated; + +import com.azure.resourcemanager.compute.generated.models.IntervalInMins; +import com.azure.resourcemanager.compute.generated.models.RequestRateByIntervalInput; +import java.time.OffsetDateTime; + +/** Samples for LogAnalytics ExportRequestRateByInterval. */ +public final class LogAnalyticsExportRequestRateByIntervalSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/logAnalyticExamples/LogAnalytics_RequestRateByInterval.json + */ + /** + * Sample code: Export logs which contain all Api requests made to Compute Resource Provider within the given time + * period broken down by intervals. + * + * @param manager Entry point to ComputeManager. + */ + public static void + exportLogsWhichContainAllApiRequestsMadeToComputeResourceProviderWithinTheGivenTimePeriodBrokenDownByIntervals( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .logAnalytics() + .exportRequestRateByInterval( + "westus", + new RequestRateByIntervalInput() + .withBlobContainerSasUri("https://somesasuri") + .withFromTime(OffsetDateTime.parse("2018-01-21T01:54:06.862601Z")) + .withToTime(OffsetDateTime.parse("2018-01-23T01:54:06.862601Z")) + .withGroupByResourceName(true) + .withIntervalLength(IntervalInMins.FIVE_MINS), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/LogAnalyticsExportThrottledRequestsSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/LogAnalyticsExportThrottledRequestsSamples.java new file mode 100644 index 0000000000000..cce84d98549a7 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/LogAnalyticsExportThrottledRequestsSamples.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.generated; + +import com.azure.resourcemanager.compute.generated.models.ThrottledRequestsInput; +import java.time.OffsetDateTime; + +/** Samples for LogAnalytics ExportThrottledRequests. */ +public final class LogAnalyticsExportThrottledRequestsSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/logAnalyticExamples/LogAnalytics_ThrottledRequests.json + */ + /** + * Sample code: Export logs which contain all throttled Api requests made to Compute Resource Provider within the + * given time period. + * + * @param manager Entry point to ComputeManager. + */ + public static void + exportLogsWhichContainAllThrottledApiRequestsMadeToComputeResourceProviderWithinTheGivenTimePeriod( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .logAnalytics() + .exportThrottledRequests( + "westus", + new ThrottledRequestsInput() + .withBlobContainerSasUri("https://somesasuri") + .withFromTime(OffsetDateTime.parse("2018-01-21T01:54:06.862601Z")) + .withToTime(OffsetDateTime.parse("2018-01-23T01:54:06.862601Z")) + .withGroupByOperationName(true) + .withGroupByResourceName(false) + .withGroupByClientApplicationId(false) + .withGroupByUserAgent(false), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/OperationsListSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/OperationsListSamples.java new file mode 100644 index 0000000000000..459a62ecc4bcf --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/OperationsListSamples.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.generated; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/computeRPCommonExamples/Operations_List_MinimumSet_Gen.json + */ + /** + * Sample code: Operations_List_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void operationsListMinimumSetGen(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/computeRPCommonExamples/Operations_List_MaximumSet_Gen.json + */ + /** + * Sample code: Operations_List_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void operationsListMaximumSetGen(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/ProximityPlacementGroupsCreateOrUpdateSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/ProximityPlacementGroupsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..0ecef604023ee --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/ProximityPlacementGroupsCreateOrUpdateSamples.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.generated; + +import com.azure.resourcemanager.compute.generated.models.ProximityPlacementGroupPropertiesIntent; +import com.azure.resourcemanager.compute.generated.models.ProximityPlacementGroupType; +import java.util.Arrays; + +/** Samples for ProximityPlacementGroups CreateOrUpdate. */ +public final class ProximityPlacementGroupsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_CreateOrUpdate.json + */ + /** + * Sample code: Create or Update a proximity placement group. + * + * @param manager Entry point to ComputeManager. + */ + public static void createOrUpdateAProximityPlacementGroup( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .proximityPlacementGroups() + .define("myProximityPlacementGroup") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withZones(Arrays.asList("1")) + .withProximityPlacementGroupType(ProximityPlacementGroupType.STANDARD) + .withIntent( + new ProximityPlacementGroupPropertiesIntent().withVmSizes(Arrays.asList("Basic_A0", "Basic_A2"))) + .create(); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/ProximityPlacementGroupsDeleteSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/ProximityPlacementGroupsDeleteSamples.java new file mode 100644 index 0000000000000..e051efd51b06a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/ProximityPlacementGroupsDeleteSamples.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.generated; + +/** Samples for ProximityPlacementGroups Delete. */ +public final class ProximityPlacementGroupsDeleteSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_Delete.json + */ + /** + * Sample code: Delete a proximity placement group. + * + * @param manager Entry point to ComputeManager. + */ + public static void deleteAProximityPlacementGroup( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .proximityPlacementGroups() + .deleteByResourceGroupWithResponse( + "myResourceGroup", "myProximityPlacementGroup", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/ProximityPlacementGroupsGetByResourceGroupSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/ProximityPlacementGroupsGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..80ac0d67dfb1a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/ProximityPlacementGroupsGetByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for ProximityPlacementGroups GetByResourceGroup. */ +public final class ProximityPlacementGroupsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_Get.json + */ + /** + * Sample code: Get proximity placement groups. + * + * @param manager Entry point to ComputeManager. + */ + public static void getProximityPlacementGroups(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .proximityPlacementGroups() + .getByResourceGroupWithResponse( + "myResourceGroup", "myProximityPlacementGroup", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/ProximityPlacementGroupsListByResourceGroupSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/ProximityPlacementGroupsListByResourceGroupSamples.java new file mode 100644 index 0000000000000..082d49c6d40c1 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/ProximityPlacementGroupsListByResourceGroupSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for ProximityPlacementGroups ListByResourceGroup. */ +public final class ProximityPlacementGroupsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_ListByResourceGroup.json + */ + /** + * Sample code: List proximity placement group. + * + * @param manager Entry point to ComputeManager. + */ + public static void listProximityPlacementGroup(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.proximityPlacementGroups().listByResourceGroup("myResourceGroup", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/ProximityPlacementGroupsListSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/ProximityPlacementGroupsListSamples.java new file mode 100644 index 0000000000000..8c635c407a70f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/ProximityPlacementGroupsListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for ProximityPlacementGroups List. */ +public final class ProximityPlacementGroupsListSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_ListBySubscription.json + */ + /** + * Sample code: List proximity placement groups. + * + * @param manager Entry point to ComputeManager. + */ + public static void listProximityPlacementGroups( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.proximityPlacementGroups().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/ProximityPlacementGroupsUpdateSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/ProximityPlacementGroupsUpdateSamples.java new file mode 100644 index 0000000000000..1f9d314cb0a33 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/ProximityPlacementGroupsUpdateSamples.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.generated; + +import com.azure.resourcemanager.compute.generated.models.ProximityPlacementGroup; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ProximityPlacementGroups Update. */ +public final class ProximityPlacementGroupsUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_Patch.json + */ + /** + * Sample code: Update a proximity placement group. + * + * @param manager Entry point to ComputeManager. + */ + public static void updateAProximityPlacementGroup( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + ProximityPlacementGroup resource = + manager + .proximityPlacementGroups() + .getByResourceGroupWithResponse( + "myResourceGroup", "myProximityPlacementGroup", null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("additionalProp1", "string")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/ResourceSkusListSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/ResourceSkusListSamples.java new file mode 100644 index 0000000000000..713dc3c56cf15 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/ResourceSkusListSamples.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.generated; + +/** Samples for ResourceSkus List. */ +public final class ResourceSkusListSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/Skus/stable/2021-07-01/examples/skus/ListAvailableResourceSkus.json + */ + /** + * Sample code: Lists all available Resource SKUs. + * + * @param manager Entry point to ComputeManager. + */ + public static void listsAllAvailableResourceSKUs( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.resourceSkus().list(null, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/Skus/stable/2021-07-01/examples/skus/ListAvailableResourceSkusForARegion.json + */ + /** + * Sample code: Lists all available Resource SKUs for the specified region. + * + * @param manager Entry point to ComputeManager. + */ + public static void listsAllAvailableResourceSKUsForTheSpecifiedRegion( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.resourceSkus().list("location eq 'westus'", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/Skus/stable/2021-07-01/examples/skus/ListAvailableResourceSkusWithExtendedLocations.json + */ + /** + * Sample code: Lists all available Resource SKUs with Extended Location information. + * + * @param manager Entry point to ComputeManager. + */ + public static void listsAllAvailableResourceSKUsWithExtendedLocationInformation( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.resourceSkus().list(null, "true", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/RestorePointCollectionsCreateOrUpdateSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/RestorePointCollectionsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..066a282e4dfb8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/RestorePointCollectionsCreateOrUpdateSamples.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.generated; + +import com.azure.resourcemanager.compute.generated.models.RestorePointCollectionSourceProperties; +import java.util.HashMap; +import java.util.Map; + +/** Samples for RestorePointCollections CreateOrUpdate. */ +public final class RestorePointCollectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/restorePointExamples/RestorePointCollection_CreateOrUpdate_ForCrossRegionCopy.json + */ + /** + * Sample code: Create or update a restore point collection for cross region copy. + * + * @param manager Entry point to ComputeManager. + */ + public static void createOrUpdateARestorePointCollectionForCrossRegionCopy( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .restorePointCollections() + .define("myRpc") + .withRegion("norwayeast") + .withExistingResourceGroup("myResourceGroup") + .withTags(mapOf("myTag1", "tagValue1")) + .withSource( + new RestorePointCollectionSourceProperties() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/sourceRpcName")) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/restorePointExamples/RestorePointCollection_CreateOrUpdate.json + */ + /** + * Sample code: Create or update a restore point collection. + * + * @param manager Entry point to ComputeManager. + */ + public static void createOrUpdateARestorePointCollection( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .restorePointCollections() + .define("myRpc") + .withRegion("norwayeast") + .withExistingResourceGroup("myResourceGroup") + .withTags(mapOf("myTag1", "tagValue1")) + .withSource( + new RestorePointCollectionSourceProperties() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/RestorePointCollectionsDeleteSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/RestorePointCollectionsDeleteSamples.java new file mode 100644 index 0000000000000..da1c3ff840fe7 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/RestorePointCollectionsDeleteSamples.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.generated; + +/** Samples for RestorePointCollections Delete. */ +public final class RestorePointCollectionsDeleteSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/restorePointExamples/RestorePointCollection_Delete_MinimumSet_Gen.json + */ + /** + * Sample code: RestorePointCollection_Delete_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void restorePointCollectionDeleteMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.restorePointCollections().delete("rgcompute", "aaaaaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/restorePointExamples/RestorePointCollection_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: RestorePointCollection_Delete_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void restorePointCollectionDeleteMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.restorePointCollections().delete("rgcompute", "aaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/RestorePointCollectionsGetByResourceGroupSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/RestorePointCollectionsGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..a42ae696fe378 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/RestorePointCollectionsGetByResourceGroupSamples.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.generated; + +/** Samples for RestorePointCollections GetByResourceGroup. */ +public final class RestorePointCollectionsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/restorePointExamples/RestorePointCollection_Get_WithContainedRestorePoints.json + */ + /** + * Sample code: Get a restore point collection, including the restore points contained in the restore point + * collection. + * + * @param manager Entry point to ComputeManager. + */ + public static void getARestorePointCollectionIncludingTheRestorePointsContainedInTheRestorePointCollection( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .restorePointCollections() + .getByResourceGroupWithResponse("myResourceGroup", "rpcName", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/restorePointExamples/RestorePointCollection_Get.json + */ + /** + * Sample code: Get a restore point collection (but not the restore points contained in the restore point + * collection). + * + * @param manager Entry point to ComputeManager. + */ + public static void getARestorePointCollectionButNotTheRestorePointsContainedInTheRestorePointCollection( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .restorePointCollections() + .getByResourceGroupWithResponse("myResourceGroup", "myRpc", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/RestorePointCollectionsListByResourceGroupSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/RestorePointCollectionsListByResourceGroupSamples.java new file mode 100644 index 0000000000000..78cb95819ea84 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/RestorePointCollectionsListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for RestorePointCollections ListByResourceGroup. */ +public final class RestorePointCollectionsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/restorePointExamples/RestorePointCollection_ListByResourceGroup.json + */ + /** + * Sample code: Gets the list of restore point collections in a resource group. + * + * @param manager Entry point to ComputeManager. + */ + public static void getsTheListOfRestorePointCollectionsInAResourceGroup( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.restorePointCollections().listByResourceGroup("myResourceGroup", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/RestorePointCollectionsListSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/RestorePointCollectionsListSamples.java new file mode 100644 index 0000000000000..ba69cfb0d3f7c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/RestorePointCollectionsListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for RestorePointCollections List. */ +public final class RestorePointCollectionsListSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/restorePointExamples/RestorePointCollection_ListBySubscription.json + */ + /** + * Sample code: Gets the list of restore point collections in a subscription. + * + * @param manager Entry point to ComputeManager. + */ + public static void getsTheListOfRestorePointCollectionsInASubscription( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.restorePointCollections().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/RestorePointCollectionsUpdateSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/RestorePointCollectionsUpdateSamples.java new file mode 100644 index 0000000000000..1b36455776a4b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/RestorePointCollectionsUpdateSamples.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.generated; + +import com.azure.resourcemanager.compute.generated.models.RestorePointCollection; +import com.azure.resourcemanager.compute.generated.models.RestorePointCollectionSourceProperties; +import java.util.HashMap; +import java.util.Map; + +/** Samples for RestorePointCollections Update. */ +public final class RestorePointCollectionsUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/restorePointExamples/RestorePointCollection_Update_MaximumSet_Gen.json + */ + /** + * Sample code: RestorePointCollection_Update_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void restorePointCollectionUpdateMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + RestorePointCollection resource = + manager + .restorePointCollections() + .getByResourceGroupWithResponse( + "rgcompute", "aaaaaaaaaaaaaaaaaaaa", null, com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("key8536", "aaaaaaaaaaaaaaaaaaa")) + .withSource( + new RestorePointCollectionSourceProperties() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM")) + .apply(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/restorePointExamples/RestorePointCollection_Update_MinimumSet_Gen.json + */ + /** + * Sample code: RestorePointCollection_Update_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void restorePointCollectionUpdateMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + RestorePointCollection resource = + manager + .restorePointCollections() + .getByResourceGroupWithResponse( + "rgcompute", "aaaaaaaaaaaaaaaaaa", null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update().apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/RestorePointsCreateSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/RestorePointsCreateSamples.java new file mode 100644 index 0000000000000..0d8e2360fe80c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/RestorePointsCreateSamples.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.generated; + +import com.azure.resourcemanager.compute.generated.models.ApiEntityReference; +import java.util.Arrays; + +/** Samples for RestorePoints Create. */ +public final class RestorePointsCreateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/restorePointExamples/RestorePoint_Copy_BetweenRegions.json + */ + /** + * Sample code: Copy a restore point to a different region. + * + * @param manager Entry point to ComputeManager. + */ + public static void copyARestorePointToADifferentRegion( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .restorePoints() + .define("rpName") + .withExistingRestorePointCollection("myResourceGroup", "rpcName") + .withSourceRestorePoint( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/sourceRpcName/restorePoints/sourceRpName")) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/restorePointExamples/RestorePoint_Create.json + */ + /** + * Sample code: Create a restore point. + * + * @param manager Entry point to ComputeManager. + */ + public static void createARestorePoint(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .restorePoints() + .define("rpName") + .withExistingRestorePointCollection("myResourceGroup", "rpcName") + .withExcludeDisks( + Arrays + .asList( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/disk123"))) + .create(); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/RestorePointsDeleteSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/RestorePointsDeleteSamples.java new file mode 100644 index 0000000000000..d94ceb72c3a1a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/RestorePointsDeleteSamples.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.generated; + +/** Samples for RestorePoints Delete. */ +public final class RestorePointsDeleteSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/restorePointExamples/RestorePoint_Delete_MinimumSet_Gen.json + */ + /** + * Sample code: RestorePoint_Delete_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void restorePointDeleteMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .restorePoints() + .delete("rgcompute", "aaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/restorePointExamples/RestorePoint_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: RestorePoint_Delete_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void restorePointDeleteMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.restorePoints().delete("rgcompute", "aaaaaaaaaaaaaaaaaaaaaa", "a", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/RestorePointsGetSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/RestorePointsGetSamples.java new file mode 100644 index 0000000000000..305ee64a70fa9 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/RestorePointsGetSamples.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.generated; + +/** Samples for RestorePoints Get. */ +public final class RestorePointsGetSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/restorePointExamples/RestorePoint_Get.json + */ + /** + * Sample code: Get a restore point. + * + * @param manager Entry point to ComputeManager. + */ + public static void getARestorePoint(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .restorePoints() + .getWithResponse("myResourceGroup", "rpcName", "rpName", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/restorePointExamples/RestorePoint_Get_WithInstanceView.json + */ + /** + * Sample code: Get restore point with instance view. + * + * @param manager Entry point to ComputeManager. + */ + public static void getRestorePointWithInstanceView( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .restorePoints() + .getWithResponse("myResourceGroup", "rpcName", "rpName", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SharedGalleriesGetSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SharedGalleriesGetSamples.java new file mode 100644 index 0000000000000..cd78d22fa8412 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SharedGalleriesGetSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for SharedGalleries Get. */ +public final class SharedGalleriesGetSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/sharedGalleryExamples/SharedGallery_Get.json + */ + /** + * Sample code: Get a shared gallery. + * + * @param manager Entry point to ComputeManager. + */ + public static void getASharedGallery(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.sharedGalleries().getWithResponse("myLocation", "galleryUniqueName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SharedGalleriesListSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SharedGalleriesListSamples.java new file mode 100644 index 0000000000000..2c9caec22498b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SharedGalleriesListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for SharedGalleries List. */ +public final class SharedGalleriesListSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/sharedGalleryExamples/SharedGallery_List.json + */ + /** + * Sample code: List shared galleries. + * + * @param manager Entry point to ComputeManager. + */ + public static void listSharedGalleries(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.sharedGalleries().list("myLocation", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SharedGalleryImageVersionsGetSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SharedGalleryImageVersionsGetSamples.java new file mode 100644 index 0000000000000..55c4b00dfb583 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SharedGalleryImageVersionsGetSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for SharedGalleryImageVersions Get. */ +public final class SharedGalleryImageVersionsGetSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/sharedGalleryExamples/SharedGalleryImageVersion_Get.json + */ + /** + * Sample code: Get a shared gallery image version. + * + * @param manager Entry point to ComputeManager. + */ + public static void getASharedGalleryImageVersion( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .sharedGalleryImageVersions() + .getWithResponse( + "myLocation", + "galleryUniqueName", + "myGalleryImageName", + "myGalleryImageVersionName", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SharedGalleryImageVersionsListSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SharedGalleryImageVersionsListSamples.java new file mode 100644 index 0000000000000..ae0ee05a5496a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SharedGalleryImageVersionsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for SharedGalleryImageVersions List. */ +public final class SharedGalleryImageVersionsListSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/sharedGalleryExamples/SharedGalleryImageVersions_List.json + */ + /** + * Sample code: List shared gallery image versions. + * + * @param manager Entry point to ComputeManager. + */ + public static void listSharedGalleryImageVersions( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .sharedGalleryImageVersions() + .list("myLocation", "galleryUniqueName", "myGalleryImageName", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SharedGalleryImagesGetSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SharedGalleryImagesGetSamples.java new file mode 100644 index 0000000000000..d4a1666fc1bfa --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SharedGalleryImagesGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for SharedGalleryImages Get. */ +public final class SharedGalleryImagesGetSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/sharedGalleryExamples/SharedGalleryImage_Get.json + */ + /** + * Sample code: Get a shared gallery image. + * + * @param manager Entry point to ComputeManager. + */ + public static void getASharedGalleryImage(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .sharedGalleryImages() + .getWithResponse("myLocation", "galleryUniqueName", "myGalleryImageName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SharedGalleryImagesListSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SharedGalleryImagesListSamples.java new file mode 100644 index 0000000000000..85656cfaefd29 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SharedGalleryImagesListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for SharedGalleryImages List. */ +public final class SharedGalleryImagesListSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/sharedGalleryExamples/SharedGalleryImages_List.json + */ + /** + * Sample code: List shared gallery images. + * + * @param manager Entry point to ComputeManager. + */ + public static void listSharedGalleryImages(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.sharedGalleryImages().list("myLocation", "galleryUniqueName", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SnapshotsCreateOrUpdateSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SnapshotsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..9a300fd61beb3 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SnapshotsCreateOrUpdateSamples.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +import com.azure.resourcemanager.compute.generated.models.CreationData; +import com.azure.resourcemanager.compute.generated.models.DiskCreateOption; + +/** Samples for Snapshots CreateOrUpdate. */ +public final class SnapshotsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/snapshotExamples/Snapshot_Create_FromAnExistingSnapshot.json + */ + /** + * Sample code: Create a snapshot from an existing snapshot in the same or a different subscription. + * + * @param manager Entry point to ComputeManager. + */ + public static void createASnapshotFromAnExistingSnapshotInTheSameOrADifferentSubscription( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .snapshots() + .define("mySnapshot2") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withCreationData( + new CreationData() + .withCreateOption(DiskCreateOption.COPY) + .withSourceResourceId( + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot1")) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/snapshotExamples/Snapshot_Create_FromAnExistingSnapshotInDifferentRegion.json + */ + /** + * Sample code: Create a snapshot from an existing snapshot in the same or a different subscription in a different + * region. + * + * @param manager Entry point to ComputeManager. + */ + public static void createASnapshotFromAnExistingSnapshotInTheSameOrADifferentSubscriptionInADifferentRegion( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .snapshots() + .define("mySnapshot2") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withCreationData( + new CreationData() + .withCreateOption(DiskCreateOption.COPY_START) + .withSourceResourceId( + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot1")) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/snapshotExamples/Snapshot_Create_ByImportingAnUnmanagedBlobFromTheSameSubscription.json + */ + /** + * Sample code: Create a snapshot by importing an unmanaged blob from the same subscription. + * + * @param manager Entry point to ComputeManager. + */ + public static void createASnapshotByImportingAnUnmanagedBlobFromTheSameSubscription( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .snapshots() + .define("mySnapshot1") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withCreationData( + new CreationData() + .withCreateOption(DiskCreateOption.IMPORT) + .withSourceUri("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd")) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/snapshotExamples/Snapshot_Create_ByImportingAnUnmanagedBlobFromADifferentSubscription.json + */ + /** + * Sample code: Create a snapshot by importing an unmanaged blob from a different subscription. + * + * @param manager Entry point to ComputeManager. + */ + public static void createASnapshotByImportingAnUnmanagedBlobFromADifferentSubscription( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .snapshots() + .define("mySnapshot1") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withCreationData( + new CreationData() + .withCreateOption(DiskCreateOption.IMPORT) + .withStorageAccountId( + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount") + .withSourceUri("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd")) + .create(); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SnapshotsDeleteSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SnapshotsDeleteSamples.java new file mode 100644 index 0000000000000..41627f59f38f0 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SnapshotsDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for Snapshots Delete. */ +public final class SnapshotsDeleteSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/snapshotExamples/Snapshot_Delete.json + */ + /** + * Sample code: Delete a snapshot. + * + * @param manager Entry point to ComputeManager. + */ + public static void deleteASnapshot(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.snapshots().delete("myResourceGroup", "mySnapshot", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SnapshotsGetByResourceGroupSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SnapshotsGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..1250141e9024a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SnapshotsGetByResourceGroupSamples.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.generated; + +/** Samples for Snapshots GetByResourceGroup. */ +public final class SnapshotsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/snapshotExamples/Snapshot_GetIncrementalSnapshot.json + */ + /** + * Sample code: Get information about an incremental snapshot. + * + * @param manager Entry point to ComputeManager. + */ + public static void getInformationAboutAnIncrementalSnapshot( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .snapshots() + .getByResourceGroupWithResponse( + "myResourceGroup", "myIncrementalSnapshot", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/snapshotExamples/Snapshot_Get.json + */ + /** + * Sample code: Get information about a snapshot. + * + * @param manager Entry point to ComputeManager. + */ + public static void getInformationAboutASnapshot( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .snapshots() + .getByResourceGroupWithResponse("myResourceGroup", "mySnapshot", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SnapshotsGrantAccessSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SnapshotsGrantAccessSamples.java new file mode 100644 index 0000000000000..db01285e32d94 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SnapshotsGrantAccessSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +import com.azure.resourcemanager.compute.generated.models.AccessLevel; +import com.azure.resourcemanager.compute.generated.models.GrantAccessData; + +/** Samples for Snapshots GrantAccess. */ +public final class SnapshotsGrantAccessSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/snapshotExamples/Snapshot_BeginGetAccess.json + */ + /** + * Sample code: Get a sas on a snapshot. + * + * @param manager Entry point to ComputeManager. + */ + public static void getASasOnASnapshot(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .snapshots() + .grantAccess( + "myResourceGroup", + "mySnapshot", + new GrantAccessData().withAccess(AccessLevel.READ).withDurationInSeconds(300), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SnapshotsListByResourceGroupSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SnapshotsListByResourceGroupSamples.java new file mode 100644 index 0000000000000..e3cf7750aced3 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SnapshotsListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for Snapshots ListByResourceGroup. */ +public final class SnapshotsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/snapshotExamples/Snapshot_ListByResourceGroup.json + */ + /** + * Sample code: List all snapshots in a resource group. + * + * @param manager Entry point to ComputeManager. + */ + public static void listAllSnapshotsInAResourceGroup( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.snapshots().listByResourceGroup("myResourceGroup", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SnapshotsListSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SnapshotsListSamples.java new file mode 100644 index 0000000000000..1e553c251035f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SnapshotsListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for Snapshots List. */ +public final class SnapshotsListSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/snapshotExamples/Snapshot_ListBySubscription.json + */ + /** + * Sample code: List all snapshots in a subscription. + * + * @param manager Entry point to ComputeManager. + */ + public static void listAllSnapshotsInASubscription( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.snapshots().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SnapshotsRevokeAccessSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SnapshotsRevokeAccessSamples.java new file mode 100644 index 0000000000000..d5ae25821e2f0 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SnapshotsRevokeAccessSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for Snapshots RevokeAccess. */ +public final class SnapshotsRevokeAccessSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/snapshotExamples/Snapshot_EndGetAccess.json + */ + /** + * Sample code: Revoke access to a snapshot. + * + * @param manager Entry point to ComputeManager. + */ + public static void revokeAccessToASnapshot(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.snapshots().revokeAccess("myResourceGroup", "mySnapshot", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SnapshotsUpdateSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SnapshotsUpdateSamples.java new file mode 100644 index 0000000000000..56c7556b2df8f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SnapshotsUpdateSamples.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.generated; + +import com.azure.resourcemanager.compute.generated.models.Snapshot; +import com.azure.resourcemanager.compute.generated.models.SupportedCapabilities; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Snapshots Update. */ +public final class SnapshotsUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/snapshotExamples/Snapshot_Update_WithAcceleratedNetwork.json + */ + /** + * Sample code: Update a snapshot with accelerated networking. + * + * @param manager Entry point to ComputeManager. + */ + public static void updateASnapshotWithAcceleratedNetworking( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + Snapshot resource = + manager + .snapshots() + .getByResourceGroupWithResponse("myResourceGroup", "mySnapshot", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("department", "Development", "project", "UpdateSnapshots")) + .withDiskSizeGB(20) + .withSupportedCapabilities(new SupportedCapabilities().withAcceleratedNetwork(false)) + .apply(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2022-07-02/examples/snapshotExamples/Snapshot_Update.json + */ + /** + * Sample code: Update a snapshot. + * + * @param manager Entry point to ComputeManager. + */ + public static void updateASnapshot(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + Snapshot resource = + manager + .snapshots() + .getByResourceGroupWithResponse("myResourceGroup", "mySnapshot", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("department", "Development", "project", "UpdateSnapshots")) + .withDiskSizeGB(20) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SshPublicKeysCreateSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SshPublicKeysCreateSamples.java new file mode 100644 index 0000000000000..7a5a6bf9518ac --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SshPublicKeysCreateSamples.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.generated; + +/** Samples for SshPublicKeys Create. */ +public final class SshPublicKeysCreateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/sshPublicKeyExamples/SshPublicKey_Create.json + */ + /** + * Sample code: Create a new SSH public key resource. + * + * @param manager Entry point to ComputeManager. + */ + public static void createANewSSHPublicKeyResource( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .sshPublicKeys() + .define("mySshPublicKeyName") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withPublicKey("{ssh-rsa public key}") + .create(); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SshPublicKeysDeleteSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SshPublicKeysDeleteSamples.java new file mode 100644 index 0000000000000..7c97fbd4966f5 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SshPublicKeysDeleteSamples.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.generated; + +/** Samples for SshPublicKeys Delete. */ +public final class SshPublicKeysDeleteSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/sshPublicKeyExamples/SshPublicKey_Delete_MinimumSet_Gen.json + */ + /** + * Sample code: SshPublicKey_Delete_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void sshPublicKeyDeleteMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .sshPublicKeys() + .deleteByResourceGroupWithResponse("rgcompute", "aaaaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/sshPublicKeyExamples/SshPublicKey_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: SshPublicKey_Delete_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void sshPublicKeyDeleteMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .sshPublicKeys() + .deleteByResourceGroupWithResponse("rgcompute", "aaaaaaaaaa", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SshPublicKeysGenerateKeyPairSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SshPublicKeysGenerateKeyPairSamples.java new file mode 100644 index 0000000000000..6bd72a6e37bab --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SshPublicKeysGenerateKeyPairSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for SshPublicKeys GenerateKeyPair. */ +public final class SshPublicKeysGenerateKeyPairSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/sshPublicKeyExamples/SshPublicKey_GenerateKeyPair.json + */ + /** + * Sample code: Generate an SSH key pair. + * + * @param manager Entry point to ComputeManager. + */ + public static void generateAnSSHKeyPair(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .sshPublicKeys() + .generateKeyPairWithResponse("myResourceGroup", "mySshPublicKeyName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SshPublicKeysGetByResourceGroupSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SshPublicKeysGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..1886583784646 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SshPublicKeysGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for SshPublicKeys GetByResourceGroup. */ +public final class SshPublicKeysGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/sshPublicKeyExamples/SshPublicKey_Get.json + */ + /** + * Sample code: Get an ssh public key. + * + * @param manager Entry point to ComputeManager. + */ + public static void getAnSshPublicKey(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .sshPublicKeys() + .getByResourceGroupWithResponse("myResourceGroup", "mySshPublicKeyName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SshPublicKeysListByResourceGroupSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SshPublicKeysListByResourceGroupSamples.java new file mode 100644 index 0000000000000..2866756227c11 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SshPublicKeysListByResourceGroupSamples.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.generated; + +/** Samples for SshPublicKeys ListByResourceGroup. */ +public final class SshPublicKeysListByResourceGroupSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/sshPublicKeyExamples/SshPublicKey_ListByResourceGroup_MinimumSet_Gen.json + */ + /** + * Sample code: SshPublicKey_ListByResourceGroup_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void sshPublicKeyListByResourceGroupMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.sshPublicKeys().listByResourceGroup("rgcompute", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/sshPublicKeyExamples/SshPublicKey_ListByResourceGroup_MaximumSet_Gen.json + */ + /** + * Sample code: SshPublicKey_ListByResourceGroup_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void sshPublicKeyListByResourceGroupMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.sshPublicKeys().listByResourceGroup("rgcompute", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SshPublicKeysListSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SshPublicKeysListSamples.java new file mode 100644 index 0000000000000..7ecc1560a751a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SshPublicKeysListSamples.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.generated; + +/** Samples for SshPublicKeys List. */ +public final class SshPublicKeysListSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/sshPublicKeyExamples/SshPublicKey_ListBySubscription_MinimumSet_Gen.json + */ + /** + * Sample code: SshPublicKey_ListBySubscription_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void sshPublicKeyListBySubscriptionMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.sshPublicKeys().list(com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/sshPublicKeyExamples/SshPublicKey_ListBySubscription_MaximumSet_Gen.json + */ + /** + * Sample code: SshPublicKey_ListBySubscription_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void sshPublicKeyListBySubscriptionMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.sshPublicKeys().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SshPublicKeysUpdateSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SshPublicKeysUpdateSamples.java new file mode 100644 index 0000000000000..4c253449ab79e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/SshPublicKeysUpdateSamples.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.generated; + +import com.azure.resourcemanager.compute.generated.models.SshPublicKeyResource; +import java.util.HashMap; +import java.util.Map; + +/** Samples for SshPublicKeys Update. */ +public final class SshPublicKeysUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/sshPublicKeyExamples/SshPublicKey_Update_MinimumSet_Gen.json + */ + /** + * Sample code: SshPublicKey_Update_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void sshPublicKeyUpdateMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + SshPublicKeyResource resource = + manager + .sshPublicKeys() + .getByResourceGroupWithResponse("rgcompute", "aaaaaaaaaaa", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().apply(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/sshPublicKeyExamples/SshPublicKey_Update_MaximumSet_Gen.json + */ + /** + * Sample code: SshPublicKey_Update_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void sshPublicKeyUpdateMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + SshPublicKeyResource resource = + manager + .sshPublicKeys() + .getByResourceGroupWithResponse("rgcompute", "aaaaaaaaaaaa", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key2854", "a")).withPublicKey("{ssh-rsa public key}").apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/UsageListSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/UsageListSamples.java new file mode 100644 index 0000000000000..bf55f35690855 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/UsageListSamples.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.generated; + +/** Samples for Usage List. */ +public final class UsageListSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/computeRPCommonExamples/Usage_List_MinimumSet_Gen.json + */ + /** + * Sample code: Usage_List_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void usageListMinimumSetGen(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.usages().list("_--", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/computeRPCommonExamples/Usage_List_MaximumSet_Gen.json + */ + /** + * Sample code: Usage_List_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void usageListMaximumSetGen(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.usages().list("4_.", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineExtensionImagesGetSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineExtensionImagesGetSamples.java new file mode 100644 index 0000000000000..f5550b40d3563 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineExtensionImagesGetSamples.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.generated; + +/** Samples for VirtualMachineExtensionImages Get. */ +public final class VirtualMachineExtensionImagesGetSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_Get_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineExtensionImage_Get_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineExtensionImageGetMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineExtensionImages() + .getWithResponse( + "aaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaa", "aa", "aaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_Get_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineExtensionImage_Get_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineExtensionImageGetMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineExtensionImages() + .getWithResponse( + "aaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaa", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineExtensionImagesListTypesSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineExtensionImagesListTypesSamples.java new file mode 100644 index 0000000000000..620bd66161447 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineExtensionImagesListTypesSamples.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.generated; + +/** Samples for VirtualMachineExtensionImages ListTypes. */ +public final class VirtualMachineExtensionImagesListTypesSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_ListTypes_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineExtensionImage_ListTypes_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineExtensionImageListTypesMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachineExtensionImages().listTypesWithResponse("aaaa", "aa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_ListTypes_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineExtensionImage_ListTypes_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineExtensionImageListTypesMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineExtensionImages() + .listTypesWithResponse( + "aaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineExtensionImagesListVersionsSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineExtensionImagesListVersionsSamples.java new file mode 100644 index 0000000000000..e6fd2dbd436ae --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineExtensionImagesListVersionsSamples.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.generated; + +/** Samples for VirtualMachineExtensionImages ListVersions. */ +public final class VirtualMachineExtensionImagesListVersionsSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_ListVersions_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineExtensionImage_ListVersions_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineExtensionImageListVersionsMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineExtensionImages() + .listVersionsWithResponse( + "aaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaa", + null, + null, + null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_ListVersions_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineExtensionImage_ListVersions_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineExtensionImageListVersionsMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineExtensionImages() + .listVersionsWithResponse( + "aaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaa", + 22, + "a", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineExtensionsCreateOrUpdateSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineExtensionsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..b33db2723513c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineExtensionsCreateOrUpdateSamples.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.generated; + +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.compute.generated.models.InstanceViewStatus; +import com.azure.resourcemanager.compute.generated.models.StatusLevelTypes; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineExtensionInstanceView; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for VirtualMachineExtensions CreateOrUpdate. */ +public final class VirtualMachineExtensionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachineExtension_CreateOrUpdate_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineExtension_CreateOrUpdate_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineExtensionCreateOrUpdateMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) throws IOException { + manager + .virtualMachineExtensions() + .define("aaaaaaaaaaaaa") + .withRegion("westus") + .withExistingVirtualMachine("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaa") + .withTags(mapOf("key9183", "aa")) + .withForceUpdateTag("a") + .withPublisher("extPublisher") + .withTypePropertiesType("extType") + .withTypeHandlerVersion("1.2") + .withAutoUpgradeMinorVersion(true) + .withEnableAutomaticUpgrade(true) + .withSettings( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .withProtectedSettings( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .withInstanceView( + new VirtualMachineExtensionInstanceView() + .withName("aaaaaaaaaaaaaaaaa") + .withType("aaaaaaaaa") + .withTypeHandlerVersion("aaaaaaaaaaaaaaaaaaaaaaaaaa") + .withSubstatuses( + Arrays + .asList( + new InstanceViewStatus() + .withCode("fakeTokenPlaceholder") + .withLevel(StatusLevelTypes.INFO) + .withDisplayStatus("aaaaaa") + .withMessage("a") + .withTime(OffsetDateTime.parse("2021-11-30T12:58:26.522Z")))) + .withStatuses( + Arrays + .asList( + new InstanceViewStatus() + .withCode("fakeTokenPlaceholder") + .withLevel(StatusLevelTypes.INFO) + .withDisplayStatus("aaaaaa") + .withMessage("a") + .withTime(OffsetDateTime.parse("2021-11-30T12:58:26.522Z"))))) + .withSuppressFailures(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachineExtension_CreateOrUpdate_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineExtension_CreateOrUpdate_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineExtensionCreateOrUpdateMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineExtensions() + .define("myVMExtension") + .withRegion("westus") + .withExistingVirtualMachine("rgcompute", "myVM") + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineExtensionsDeleteSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineExtensionsDeleteSamples.java new file mode 100644 index 0000000000000..86bd8a11a840b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineExtensionsDeleteSamples.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.generated; + +/** Samples for VirtualMachineExtensions Delete. */ +public final class VirtualMachineExtensionsDeleteSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachineExtension_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineExtension_Delete_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineExtensionDeleteMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineExtensions() + .delete("rgcompute", "aaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachineExtension_Delete_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineExtension_Delete_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineExtensionDeleteMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineExtensions() + .delete("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaa", "aa", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineExtensionsGetSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineExtensionsGetSamples.java new file mode 100644 index 0000000000000..b8c117bd4abda --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineExtensionsGetSamples.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.generated; + +/** Samples for VirtualMachineExtensions Get. */ +public final class VirtualMachineExtensionsGetSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachineExtension_Get_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineExtension_Get_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineExtensionGetMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineExtensions() + .getWithResponse( + "rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaa", "aaaaaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachineExtension_Get_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineExtension_Get_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineExtensionGetMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineExtensions() + .getWithResponse("rgcompute", "myVM", "myVMExtension", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineExtensionsListSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineExtensionsListSamples.java new file mode 100644 index 0000000000000..e51c82e357347 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineExtensionsListSamples.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.generated; + +/** Samples for VirtualMachineExtensions List. */ +public final class VirtualMachineExtensionsListSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachineExtension_List_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineExtension_List_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineExtensionListMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineExtensions() + .listWithResponse("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaa", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachineExtension_List_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineExtension_List_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineExtensionListMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineExtensions() + .listWithResponse("rgcompute", "aaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineExtensionsUpdateSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineExtensionsUpdateSamples.java new file mode 100644 index 0000000000000..5f0ccc588ab2d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineExtensionsUpdateSamples.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.generated; + +import com.azure.core.management.SubResource; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.compute.generated.models.KeyVaultSecretReference; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineExtension; +import java.io.IOException; + +/** Samples for VirtualMachineExtensions Update. */ +public final class VirtualMachineExtensionsUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachineExtension_Update.json + */ + /** + * Sample code: Update VM extension. + * + * @param manager Entry point to ComputeManager. + */ + public static void updateVMExtension(com.azure.resourcemanager.compute.generated.ComputeManager manager) + throws IOException { + VirtualMachineExtension resource = + manager + .virtualMachineExtensions() + .getWithResponse("myResourceGroup", "myVM", "myVMExtension", null, com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withPublisher("extPublisher") + .withType("extType") + .withTypeHandlerVersion("1.2") + .withAutoUpgradeMinorVersion(true) + .withSettings( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{\"UserName\":\"xyz@microsoft.com\"}", Object.class, SerializerEncoding.JSON)) + .withSuppressFailures(true) + .withProtectedSettingsFromKeyVault( + new KeyVaultSecretReference() + .withSecretUrl("fakeTokenPlaceholder") + .withSourceVault( + new SubResource() + .withId( + "/subscriptions/a53f7094-a16c-47af-abe4-b05c05d0d79a/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/kvName"))) + .apply(); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineImagesEdgeZoneGetSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineImagesEdgeZoneGetSamples.java new file mode 100644 index 0000000000000..43bb769312a0f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineImagesEdgeZoneGetSamples.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.generated; + +/** Samples for VirtualMachineImagesEdgeZone Get. */ +public final class VirtualMachineImagesEdgeZoneGetSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_Get_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineImagesEdgeZone_Get_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineImagesEdgeZoneGetMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineImagesEdgeZones() + .getWithResponse( + "aaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaa", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_Get_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineImagesEdgeZone_Get_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineImagesEdgeZoneGetMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineImagesEdgeZones() + .getWithResponse( + "aaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaa", + "aa", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineImagesEdgeZoneListOffersSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineImagesEdgeZoneListOffersSamples.java new file mode 100644 index 0000000000000..efddc135d87c8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineImagesEdgeZoneListOffersSamples.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.generated; + +/** Samples for VirtualMachineImagesEdgeZone ListOffers. */ +public final class VirtualMachineImagesEdgeZoneListOffersSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListOffers_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineImagesEdgeZone_ListOffers_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineImagesEdgeZoneListOffersMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineImagesEdgeZones() + .listOffersWithResponse( + "aaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListOffers_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineImagesEdgeZone_ListOffers_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineImagesEdgeZoneListOffersMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineImagesEdgeZones() + .listOffersWithResponse( + "aaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaa", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineImagesEdgeZoneListPublishersSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineImagesEdgeZoneListPublishersSamples.java new file mode 100644 index 0000000000000..0f8ad01e98a14 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineImagesEdgeZoneListPublishersSamples.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.generated; + +/** Samples for VirtualMachineImagesEdgeZone ListPublishers. */ +public final class VirtualMachineImagesEdgeZoneListPublishersSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListPublishers_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineImagesEdgeZone_ListPublishers_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineImagesEdgeZoneListPublishersMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineImagesEdgeZones() + .listPublishersWithResponse("aaaa", "aaaaaaaaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListPublishers_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineImagesEdgeZone_ListPublishers_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineImagesEdgeZoneListPublishersMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineImagesEdgeZones() + .listPublishersWithResponse("aaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineImagesEdgeZoneListSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineImagesEdgeZoneListSamples.java new file mode 100644 index 0000000000000..be5afc62e6331 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineImagesEdgeZoneListSamples.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.generated; + +/** Samples for VirtualMachineImagesEdgeZone List. */ +public final class VirtualMachineImagesEdgeZoneListSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_List_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineImagesEdgeZone_List_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineImagesEdgeZoneListMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineImagesEdgeZones() + .listWithResponse( + "aaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaa", + 12, + "aaaaaaaaaaaaaaaaaaaaaaaaaaaa", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_List_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineImagesEdgeZone_List_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineImagesEdgeZoneListMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineImagesEdgeZones() + .listWithResponse( + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaa", + "aaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + null, + null, + null, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineImagesEdgeZoneListSkusSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineImagesEdgeZoneListSkusSamples.java new file mode 100644 index 0000000000000..a5547519cee53 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineImagesEdgeZoneListSkusSamples.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.generated; + +/** Samples for VirtualMachineImagesEdgeZone ListSkus. */ +public final class VirtualMachineImagesEdgeZoneListSkusSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListSkus_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineImagesEdgeZone_ListSkus_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineImagesEdgeZoneListSkusMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineImagesEdgeZones() + .listSkusWithResponse( + "aaaaaaaaaaaa", "aaaaa", "aaaaaaaaaaaa", "aaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListSkus_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineImagesEdgeZone_ListSkus_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineImagesEdgeZoneListSkusMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineImagesEdgeZones() + .listSkusWithResponse( + "aaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaa", + "aaaaaaaaaaaa", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineImagesGetSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineImagesGetSamples.java new file mode 100644 index 0000000000000..cc74946edf7c2 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineImagesGetSamples.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.generated; + +/** Samples for VirtualMachineImages Get. */ +public final class VirtualMachineImagesGetSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineImageExamples/VirtualMachineImage_Get_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineImage_Get_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineImageGetMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineImages() + .getWithResponse( + "aaaaaaaaaaaa", + "aaaaaaaaaaa", + "aa", + "aaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineImageExamples/VirtualMachineImage_Get_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineImage_Get_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineImageGetMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineImages() + .getWithResponse( + "aaaaaa", + "aaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaa", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineImagesListByEdgeZoneSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineImagesListByEdgeZoneSamples.java new file mode 100644 index 0000000000000..65aa7a7268608 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineImagesListByEdgeZoneSamples.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.generated; + +/** Samples for VirtualMachineImages ListByEdgeZone. */ +public final class VirtualMachineImagesListByEdgeZoneSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListByEdgeZone_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineImagesEdgeZone_ListByEdgeZone_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineImagesEdgeZoneListByEdgeZoneMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineImages() + .listByEdgeZoneWithResponse("WestUS", "microsoftlosangeles1", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListByEdgeZone_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineImagesEdgeZone_ListByEdgeZone_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineImagesEdgeZoneListByEdgeZoneMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineImages() + .listByEdgeZoneWithResponse("WestUS", "microsoftlosangeles1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineImagesListOffersSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineImagesListOffersSamples.java new file mode 100644 index 0000000000000..d6cdeb0db64e0 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineImagesListOffersSamples.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.generated; + +/** Samples for VirtualMachineImages ListOffers. */ +public final class VirtualMachineImagesListOffersSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListOffers_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineImage_ListOffers_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineImageListOffersMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineImages() + .listOffersWithResponse( + "aaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListOffers_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineImage_ListOffers_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineImageListOffersMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachineImages().listOffersWithResponse("aaaaaaa", "aaaaaaaa", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineImagesListPublishersSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineImagesListPublishersSamples.java new file mode 100644 index 0000000000000..2f3f782e207a3 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineImagesListPublishersSamples.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.generated; + +/** Samples for VirtualMachineImages ListPublishers. */ +public final class VirtualMachineImagesListPublishersSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListPublishers_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineImage_ListPublishers_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineImageListPublishersMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineImages() + .listPublishersWithResponse("aaaaaaaaaaaaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListPublishers_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineImage_ListPublishers_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineImageListPublishersMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachineImages().listPublishersWithResponse("aaaaa", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineImagesListSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineImagesListSamples.java new file mode 100644 index 0000000000000..f53798d8a8555 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineImagesListSamples.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.generated; + +/** Samples for VirtualMachineImages List. */ +public final class VirtualMachineImagesListSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineImageExamples/VirtualMachineImage_List_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineImage_List_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineImageListMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineImages() + .listWithResponse( + "aaaaaaa", "aaaaaaaaaaa", "aaaaaaaaaa", "aaaaaa", null, null, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineImageExamples/VirtualMachineImage_List_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineImage_List_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineImageListMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineImages() + .listWithResponse( + "aaaaaaaaaaaaaaa", + "aaaaaa", + "aaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaa", + 18, + "aa", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineImagesListSkusSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineImagesListSkusSamples.java new file mode 100644 index 0000000000000..7886a6e4caf6c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineImagesListSkusSamples.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.generated; + +/** Samples for VirtualMachineImages ListSkus. */ +public final class VirtualMachineImagesListSkusSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListSkus_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineImage_ListSkus_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineImageListSkusMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineImages() + .listSkusWithResponse("aaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListSkus_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineImage_ListSkus_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineImageListSkusMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineImages() + .listSkusWithResponse("aaaa", "aaaaaaaaaaaaa", "aaaaaaa", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineRunCommandsCreateOrUpdateSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineRunCommandsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..48dce663c634f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineRunCommandsCreateOrUpdateSamples.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.generated; + +import com.azure.resourcemanager.compute.generated.models.RunCommandInputParameter; +import com.azure.resourcemanager.compute.generated.models.RunCommandManagedIdentity; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineRunCommandScriptSource; +import java.util.Arrays; + +/** Samples for VirtualMachineRunCommands CreateOrUpdate. */ +public final class VirtualMachineRunCommandsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/runCommandExamples/VirtualMachineRunCommand_CreateOrUpdate.json + */ + /** + * Sample code: Create or update a run command. + * + * @param manager Entry point to ComputeManager. + */ + public static void createOrUpdateARunCommand(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineRunCommands() + .define("myRunCommand") + .withRegion("West US") + .withExistingVirtualMachine("myResourceGroup", "myVM") + .withSource( + new VirtualMachineRunCommandScriptSource() + .withScriptUri( + "https://mystorageaccount.blob.core.windows.net/scriptcontainer/MyScript.ps1?sp=r&st=2022-10-07T19:52:54Z&se=2022-10-08T03:52:54Z&spr=https&sv=2021-06-08&sr=b&sig=zfYFYCgea1PqVERZuwJiewrte5gjTnKGtVJngcw5oc828%3D")) + .withParameters( + Arrays + .asList( + new RunCommandInputParameter().withName("param1").withValue("value1"), + new RunCommandInputParameter().withName("param2").withValue("value2"))) + .withAsyncExecution(false) + .withRunAsUser("user1") + .withRunAsPassword("") + .withTimeoutInSeconds(3600) + .withOutputBlobUri( + "https://mystorageaccount.blob.core.windows.net/myscriptoutputcontainer/MyScriptoutput.txt") + .withErrorBlobUri( + "https://mystorageaccount.blob.core.windows.net/mycontainer/MyScriptError.txt?sp=racw&st=2022-10-07T19:40:21Z&se=2022-10-08T03:40:21Z&spr=https&sv=2021-06-08&sr=b&sig=Yh7B%2Fy83olbYBdfsfbUREvd7ol8Dq5EVP3lAO4Kj4xDcN8%3D") + .withOutputBlobManagedIdentity( + new RunCommandManagedIdentity().withClientId("22d35efb-0c99-4041-8c5b-6d24db33a69a")) + .withTreatFailureAsDeploymentFailure(false) + .create(); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineRunCommandsDeleteSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineRunCommandsDeleteSamples.java new file mode 100644 index 0000000000000..cfa3cb4fe4875 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineRunCommandsDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for VirtualMachineRunCommands Delete. */ +public final class VirtualMachineRunCommandsDeleteSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/runCommandExamples/VirtualMachineRunCommand_Delete.json + */ + /** + * Sample code: Delete a run command. + * + * @param manager Entry point to ComputeManager. + */ + public static void deleteARunCommand(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineRunCommands() + .delete("myResourceGroup", "myVM", "myRunCommand", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineRunCommandsGetByVirtualMachineSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineRunCommandsGetByVirtualMachineSamples.java new file mode 100644 index 0000000000000..53b2a1eea9c20 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineRunCommandsGetByVirtualMachineSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for VirtualMachineRunCommands GetByVirtualMachine. */ +public final class VirtualMachineRunCommandsGetByVirtualMachineSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/runCommandExamples/VirtualMachineRunCommand_Get.json + */ + /** + * Sample code: Get a run command. + * + * @param manager Entry point to ComputeManager. + */ + public static void getARunCommand(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineRunCommands() + .getByVirtualMachineWithResponse( + "myResourceGroup", "myVM", "myRunCommand", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineRunCommandsGetSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineRunCommandsGetSamples.java new file mode 100644 index 0000000000000..f8d4ac2c5f1f5 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineRunCommandsGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for VirtualMachineRunCommands Get. */ +public final class VirtualMachineRunCommandsGetSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/runCommandExamples/RunCommand_Get.json + */ + /** + * Sample code: VirtualMachineRunCommandGet. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineRunCommandGet(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineRunCommands() + .getWithResponse("SoutheastAsia", "RunPowerShellScript", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineRunCommandsListByVirtualMachineSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineRunCommandsListByVirtualMachineSamples.java new file mode 100644 index 0000000000000..77216c8ceec60 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineRunCommandsListByVirtualMachineSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for VirtualMachineRunCommands ListByVirtualMachine. */ +public final class VirtualMachineRunCommandsListByVirtualMachineSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/runCommandExamples/VirtualMachineRunCommand_List.json + */ + /** + * Sample code: List run commands in a Virtual Machine. + * + * @param manager Entry point to ComputeManager. + */ + public static void listRunCommandsInAVirtualMachine( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineRunCommands() + .listByVirtualMachine("myResourceGroup", "myVM", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineRunCommandsListSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineRunCommandsListSamples.java new file mode 100644 index 0000000000000..420523ba363d3 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineRunCommandsListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for VirtualMachineRunCommands List. */ +public final class VirtualMachineRunCommandsListSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/runCommandExamples/RunCommand_List.json + */ + /** + * Sample code: VirtualMachineRunCommandList. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineRunCommandList( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachineRunCommands().list("SoutheastAsia", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineRunCommandsUpdateSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineRunCommandsUpdateSamples.java new file mode 100644 index 0000000000000..1f8419e9009c5 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineRunCommandsUpdateSamples.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.generated; + +import com.azure.resourcemanager.compute.generated.models.RunCommandInputParameter; +import com.azure.resourcemanager.compute.generated.models.RunCommandManagedIdentity; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineRunCommand; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineRunCommandScriptSource; +import java.util.Arrays; + +/** Samples for VirtualMachineRunCommands Update. */ +public final class VirtualMachineRunCommandsUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/runCommandExamples/VirtualMachineRunCommand_Update.json + */ + /** + * Sample code: Update a run command. + * + * @param manager Entry point to ComputeManager. + */ + public static void updateARunCommand(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + VirtualMachineRunCommand resource = + manager + .virtualMachineRunCommands() + .getByVirtualMachineWithResponse( + "myResourceGroup", "myVM", "myRunCommand", null, com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withSource( + new VirtualMachineRunCommandScriptSource() + .withScript("Write-Host Hello World! ; Remove-Item C:\test\testFile.txt")) + .withParameters( + Arrays + .asList( + new RunCommandInputParameter().withName("param1").withValue("value1"), + new RunCommandInputParameter().withName("param2").withValue("value2"))) + .withAsyncExecution(false) + .withRunAsUser("user1") + .withRunAsPassword("") + .withTimeoutInSeconds(3600) + .withOutputBlobUri( + "https://mystorageaccount.blob.core.windows.net/myscriptoutputcontainer/MyScriptoutput.txt?sp=racw&st=2022-10-07T19:40:21Z&se=2022-10-08T03:40:21Z&spr=https&sv=2021-06-08&sr=b&sig=Yh7B%2Fy83olbYBdfsfbUREvd7ol8Dq5EVP3lAO4Kj4xDcN8%3D") + .withErrorBlobUri("https://mystorageaccount.blob.core.windows.net/mycontainer/MyScriptError.txt") + .withErrorBlobManagedIdentity( + new RunCommandManagedIdentity().withObjectId("4231e4d2-33e4-4e23-96b2-17888afa6072")) + .apply(); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetExtensionsCreateOrUpdateSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetExtensionsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..162e479559657 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetExtensionsCreateOrUpdateSamples.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.generated; + +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import java.io.IOException; +import java.util.Arrays; + +/** Samples for VirtualMachineScaleSetExtensions CreateOrUpdate. */ +public final class VirtualMachineScaleSetExtensionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_CreateOrUpdate_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetExtension_CreateOrUpdate_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetExtensionCreateOrUpdateMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) throws IOException { + manager + .virtualMachineScaleSetExtensions() + .define("aaaaaaaaaaaaaaaaaaaaa") + .withExistingVirtualMachineScaleSet("rgcompute", "aaaaaaa") + .withName("{extension-name}") + .withForceUpdateTag("aaaaaaaaa") + .withPublisher("{extension-Publisher}") + .withTypePropertiesType("{extension-Type}") + .withTypeHandlerVersion("{handler-version}") + .withAutoUpgradeMinorVersion(true) + .withEnableAutomaticUpgrade(true) + .withSettings( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .withProtectedSettings( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .withProvisionAfterExtensions(Arrays.asList("aa")) + .withSuppressFailures(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_CreateOrUpdate_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetExtension_CreateOrUpdate_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetExtensionCreateOrUpdateMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetExtensions() + .define("aaaaaaaaaaa") + .withExistingVirtualMachineScaleSet("rgcompute", "aaaaaaaaaaa") + .create(); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetExtensionsDeleteSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetExtensionsDeleteSamples.java new file mode 100644 index 0000000000000..cea9891bb0dad --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetExtensionsDeleteSamples.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.generated; + +/** Samples for VirtualMachineScaleSetExtensions Delete. */ +public final class VirtualMachineScaleSetExtensionsDeleteSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Delete_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetExtension_Delete_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetExtensionDeleteMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetExtensions() + .delete("rgcompute", "aaaa", "aaaaaaaaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetExtension_Delete_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetExtensionDeleteMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetExtensions() + .delete( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaa", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetExtensionsGetSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetExtensionsGetSamples.java new file mode 100644 index 0000000000000..faef3a3c30b6a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetExtensionsGetSamples.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.generated; + +/** Samples for VirtualMachineScaleSetExtensions Get. */ +public final class VirtualMachineScaleSetExtensionsGetSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Get_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetExtension_Get_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetExtensionGetMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetExtensions() + .getWithResponse( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaa", + "aaaaaaa", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Get_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetExtension_Get_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetExtensionGetMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetExtensions() + .getWithResponse( + "rgcompute", "a", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetExtensionsListSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetExtensionsListSamples.java new file mode 100644 index 0000000000000..bd86dbba34a05 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetExtensionsListSamples.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.generated; + +/** Samples for VirtualMachineScaleSetExtensions List. */ +public final class VirtualMachineScaleSetExtensionsListSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_List_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetExtension_List_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetExtensionListMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetExtensions() + .list("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_List_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetExtension_List_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetExtensionListMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetExtensions() + .list("rgcompute", "aaaaaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetExtensionsUpdateSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetExtensionsUpdateSamples.java new file mode 100644 index 0000000000000..56ea983c0be45 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetExtensionsUpdateSamples.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.generated; + +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetExtension; +import java.io.IOException; +import java.util.Arrays; + +/** Samples for VirtualMachineScaleSetExtensions Update. */ +public final class VirtualMachineScaleSetExtensionsUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Update_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetExtension_Update_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetExtensionUpdateMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + VirtualMachineScaleSetExtension resource = + manager + .virtualMachineScaleSetExtensions() + .getWithResponse( + "rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaa", "aa", null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update().apply(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Update_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetExtension_Update_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetExtensionUpdateMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) throws IOException { + VirtualMachineScaleSetExtension resource = + manager + .virtualMachineScaleSetExtensions() + .getWithResponse( + "rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaa", null, com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withForceUpdateTag("aaaaaaaaa") + .withPublisher("{extension-Publisher}") + .withTypePropertiesType("{extension-Type}") + .withTypeHandlerVersion("{handler-version}") + .withAutoUpgradeMinorVersion(true) + .withEnableAutomaticUpgrade(true) + .withSettings( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .withProtectedSettings( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .withProvisionAfterExtensions(Arrays.asList("aa")) + .withSuppressFailures(true) + .apply(); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetRollingUpgradesCancelSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetRollingUpgradesCancelSamples.java new file mode 100644 index 0000000000000..5d7e72fe1b619 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetRollingUpgradesCancelSamples.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.generated; + +/** Samples for VirtualMachineScaleSetRollingUpgrades Cancel. */ +public final class VirtualMachineScaleSetRollingUpgradesCancelSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_Cancel_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetRollingUpgrade_Cancel_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetRollingUpgradeCancelMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachineScaleSetRollingUpgrades().cancel("rgcompute", "aaaaaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_Cancel_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetRollingUpgrade_Cancel_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetRollingUpgradeCancelMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachineScaleSetRollingUpgrades().cancel("rgcompute", "aaaaa", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetRollingUpgradesGetLatestSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetRollingUpgradesGetLatestSamples.java new file mode 100644 index 0000000000000..607a38a07f216 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetRollingUpgradesGetLatestSamples.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.generated; + +/** Samples for VirtualMachineScaleSetRollingUpgrades GetLatest. */ +public final class VirtualMachineScaleSetRollingUpgradesGetLatestSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_GetLatest_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetRollingUpgrade_GetLatest_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetRollingUpgradeGetLatestMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetRollingUpgrades() + .getLatestWithResponse("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_GetLatest_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetRollingUpgrade_GetLatest_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetRollingUpgradeGetLatestMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetRollingUpgrades() + .getLatestWithResponse("rgcompute", "aaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeSamples.java new file mode 100644 index 0000000000000..32296a80c0176 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for VirtualMachineScaleSetRollingUpgrades StartExtensionUpgrade. */ +public final class VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_RollingUpgrade.json + */ + /** + * Sample code: Start an extension rolling upgrade. + * + * @param manager Entry point to ComputeManager. + */ + public static void startAnExtensionRollingUpgrade( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetRollingUpgrades() + .startExtensionUpgrade("myResourceGroup", "{vmss-name}", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetRollingUpgradesStartOSUpgradeSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetRollingUpgradesStartOSUpgradeSamples.java new file mode 100644 index 0000000000000..27a0c98ef005f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetRollingUpgradesStartOSUpgradeSamples.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.generated; + +/** Samples for VirtualMachineScaleSetRollingUpgrades StartOSUpgrade. */ +public final class VirtualMachineScaleSetRollingUpgradesStartOSUpgradeSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_StartOSUpgrade_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetRollingUpgrade_StartOSUpgrade_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetRollingUpgradeStartOSUpgradeMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetRollingUpgrades() + .startOSUpgrade("rgcompute", "aaaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_StartOSUpgrade_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetRollingUpgrade_StartOSUpgrade_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetRollingUpgradeStartOSUpgradeMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetRollingUpgrades() + .startOSUpgrade("rgcompute", "aaaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMExtensionsCreateOrUpdateSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMExtensionsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..d58b1eabf749c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMExtensionsCreateOrUpdateSamples.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.generated; + +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import java.io.IOException; + +/** Samples for VirtualMachineScaleSetVMExtensions CreateOrUpdate. */ +public final class VirtualMachineScaleSetVMExtensionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Create.json + */ + /** + * Sample code: Create VirtualMachineScaleSet VM extension. + * + * @param manager Entry point to ComputeManager. + */ + public static void createVirtualMachineScaleSetVMExtension( + com.azure.resourcemanager.compute.generated.ComputeManager manager) throws IOException { + manager + .virtualMachineScaleSetVMExtensions() + .define("myVMExtension") + .withExistingVirtualMachine("myResourceGroup", "myvmScaleSet", "0") + .withPublisher("extPublisher") + .withTypePropertiesType("extType") + .withTypeHandlerVersion("1.2") + .withAutoUpgradeMinorVersion(true) + .withSettings( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{\"UserName\":\"xyz@microsoft.com\"}", Object.class, SerializerEncoding.JSON)) + .create(); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMExtensionsDeleteSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMExtensionsDeleteSamples.java new file mode 100644 index 0000000000000..6241d98d278a2 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMExtensionsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for VirtualMachineScaleSetVMExtensions Delete. */ +public final class VirtualMachineScaleSetVMExtensionsDeleteSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Delete.json + */ + /** + * Sample code: Delete VirtualMachineScaleSet VM extension. + * + * @param manager Entry point to ComputeManager. + */ + public static void deleteVirtualMachineScaleSetVMExtension( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetVMExtensions() + .delete("myResourceGroup", "myvmScaleSet", "0", "myVMExtension", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMExtensionsGetSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMExtensionsGetSamples.java new file mode 100644 index 0000000000000..def47dc1b6a51 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMExtensionsGetSamples.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.generated; + +/** Samples for VirtualMachineScaleSetVMExtensions Get. */ +public final class VirtualMachineScaleSetVMExtensionsGetSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Get.json + */ + /** + * Sample code: Get VirtualMachineScaleSet VM extension. + * + * @param manager Entry point to ComputeManager. + */ + public static void getVirtualMachineScaleSetVMExtension( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetVMExtensions() + .getWithResponse( + "myResourceGroup", "myvmScaleSet", "0", "myVMExtension", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMExtensionsListSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMExtensionsListSamples.java new file mode 100644 index 0000000000000..7da93ab8adbf8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMExtensionsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for VirtualMachineScaleSetVMExtensions List. */ +public final class VirtualMachineScaleSetVMExtensionsListSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_List.json + */ + /** + * Sample code: List extensions in Vmss instance. + * + * @param manager Entry point to ComputeManager. + */ + public static void listExtensionsInVmssInstance( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetVMExtensions() + .listWithResponse("myResourceGroup", "myvmScaleSet", "0", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMExtensionsUpdateSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMExtensionsUpdateSamples.java new file mode 100644 index 0000000000000..1be84963635a9 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMExtensionsUpdateSamples.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.generated; + +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMExtension; +import java.io.IOException; + +/** Samples for VirtualMachineScaleSetVMExtensions Update. */ +public final class VirtualMachineScaleSetVMExtensionsUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Update.json + */ + /** + * Sample code: Update VirtualMachineScaleSet VM extension. + * + * @param manager Entry point to ComputeManager. + */ + public static void updateVirtualMachineScaleSetVMExtension( + com.azure.resourcemanager.compute.generated.ComputeManager manager) throws IOException { + VirtualMachineScaleSetVMExtension resource = + manager + .virtualMachineScaleSetVMExtensions() + .getWithResponse( + "myResourceGroup", "myvmScaleSet", "0", "myVMExtension", null, com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withPublisher("extPublisher") + .withTypePropertiesType("extType") + .withTypeHandlerVersion("1.2") + .withAutoUpgradeMinorVersion(true) + .withSettings( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{\"UserName\":\"xyz@microsoft.com\"}", Object.class, SerializerEncoding.JSON)) + .apply(); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMRunCommandsCreateOrUpdateSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMRunCommandsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..c6d8e188054c1 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMRunCommandsCreateOrUpdateSamples.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.generated; + +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineRunCommandInner; +import com.azure.resourcemanager.compute.generated.models.RunCommandInputParameter; +import com.azure.resourcemanager.compute.generated.models.RunCommandManagedIdentity; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineRunCommandScriptSource; +import java.util.Arrays; + +/** Samples for VirtualMachineScaleSetVMRunCommands CreateOrUpdate. */ +public final class VirtualMachineScaleSetVMRunCommandsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_CreateOrUpdate.json + */ + /** + * Sample code: Create VirtualMachineScaleSet VM run command. + * + * @param manager Entry point to ComputeManager. + */ + public static void createVirtualMachineScaleSetVMRunCommand( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetVMRunCommands() + .createOrUpdate( + "myResourceGroup", + "myvmScaleSet", + "0", + "myRunCommand", + new VirtualMachineRunCommandInner() + .withLocation("West US") + .withSource( + new VirtualMachineRunCommandScriptSource() + .withScriptUri( + "https://mystorageaccount.blob.core.windows.net/scriptcontainer/MyScript.ps1") + .withScriptUriManagedIdentity( + new RunCommandManagedIdentity().withObjectId("4231e4d2-33e4-4e23-96b2-17888afa6072"))) + .withParameters( + Arrays + .asList( + new RunCommandInputParameter().withName("param1").withValue("value1"), + new RunCommandInputParameter().withName("param2").withValue("value2"))) + .withAsyncExecution(false) + .withRunAsUser("user1") + .withRunAsPassword("fakeTokenPlaceholder") + .withTimeoutInSeconds(3600) + .withOutputBlobUri( + "https://mystorageaccount.blob.core.windows.net/myscriptoutputcontainer/MyScriptoutput.txt") + .withErrorBlobUri("https://mystorageaccount.blob.core.windows.net/mycontainer/MyScriptError.txt") + .withOutputBlobManagedIdentity( + new RunCommandManagedIdentity().withClientId("22d35efb-0c99-4041-8c5b-6d24db33a69a")) + .withErrorBlobManagedIdentity(new RunCommandManagedIdentity()) + .withTreatFailureAsDeploymentFailure(true), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMRunCommandsDeleteSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMRunCommandsDeleteSamples.java new file mode 100644 index 0000000000000..8b1cde39656b4 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMRunCommandsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for VirtualMachineScaleSetVMRunCommands Delete. */ +public final class VirtualMachineScaleSetVMRunCommandsDeleteSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_Delete.json + */ + /** + * Sample code: Delete VirtualMachineScaleSet VM run command. + * + * @param manager Entry point to ComputeManager. + */ + public static void deleteVirtualMachineScaleSetVMRunCommand( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetVMRunCommands() + .delete("myResourceGroup", "myvmScaleSet", "0", "myRunCommand", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMRunCommandsGetSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMRunCommandsGetSamples.java new file mode 100644 index 0000000000000..ba332880a5e67 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMRunCommandsGetSamples.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.generated; + +/** Samples for VirtualMachineScaleSetVMRunCommands Get. */ +public final class VirtualMachineScaleSetVMRunCommandsGetSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_Get.json + */ + /** + * Sample code: Get VirtualMachineScaleSet VM run commands. + * + * @param manager Entry point to ComputeManager. + */ + public static void getVirtualMachineScaleSetVMRunCommands( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetVMRunCommands() + .getWithResponse( + "myResourceGroup", "myvmScaleSet", "0", "myRunCommand", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMRunCommandsListSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMRunCommandsListSamples.java new file mode 100644 index 0000000000000..dc969b3332a95 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMRunCommandsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for VirtualMachineScaleSetVMRunCommands List. */ +public final class VirtualMachineScaleSetVMRunCommandsListSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_List.json + */ + /** + * Sample code: List run commands in Vmss instance. + * + * @param manager Entry point to ComputeManager. + */ + public static void listRunCommandsInVmssInstance( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetVMRunCommands() + .list("myResourceGroup", "myvmScaleSet", "0", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMRunCommandsUpdateSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMRunCommandsUpdateSamples.java new file mode 100644 index 0000000000000..d064e83c0145b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMRunCommandsUpdateSamples.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.generated; + +import com.azure.resourcemanager.compute.generated.models.RunCommandManagedIdentity; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineRunCommandScriptSource; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineRunCommandUpdate; + +/** Samples for VirtualMachineScaleSetVMRunCommands Update. */ +public final class VirtualMachineScaleSetVMRunCommandsUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_Update.json + */ + /** + * Sample code: Update VirtualMachineScaleSet VM run command. + * + * @param manager Entry point to ComputeManager. + */ + public static void updateVirtualMachineScaleSetVMRunCommand( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetVMRunCommands() + .update( + "myResourceGroup", + "myvmScaleSet", + "0", + "myRunCommand", + new VirtualMachineRunCommandUpdate() + .withSource( + new VirtualMachineRunCommandScriptSource() + .withScriptUri( + "https://mystorageaccount.blob.core.windows.net/scriptcontainer/MyScript.ps1") + .withScriptUriManagedIdentity( + new RunCommandManagedIdentity().withObjectId("4231e4d2-33e4-4e23-96b2-17888afa6072"))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMsDeallocateSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMsDeallocateSamples.java new file mode 100644 index 0000000000000..87014d86c7ead --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMsDeallocateSamples.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.generated; + +/** Samples for VirtualMachineScaleSetVMs Deallocate. */ +public final class VirtualMachineScaleSetVMsDeallocateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Deallocate_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetVM_Deallocate_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetVMDeallocateMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetVMs() + .deallocate("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Deallocate_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetVM_Deallocate_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetVMDeallocateMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetVMs() + .deallocate( + "rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMsDeleteSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMsDeleteSamples.java new file mode 100644 index 0000000000000..817e0bc4079d2 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for VirtualMachineScaleSetVMs Delete. */ +public final class VirtualMachineScaleSetVMsDeleteSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Delete_Force.json + */ + /** + * Sample code: Force Delete a virtual machine from a VM scale set. + * + * @param manager Entry point to ComputeManager. + */ + public static void forceDeleteAVirtualMachineFromAVMScaleSet( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetVMs() + .delete("myResourceGroup", "myvmScaleSet", "0", true, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMsGetInstanceViewSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMsGetInstanceViewSamples.java new file mode 100644 index 0000000000000..ae5e398cccef8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMsGetInstanceViewSamples.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.generated; + +/** Samples for VirtualMachineScaleSetVMs GetInstanceView. */ +public final class VirtualMachineScaleSetVMsGetInstanceViewSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_InstanceViewAutoPlacedOnDedicatedHostGroup.json + */ + /** + * Sample code: Get instance view of a virtual machine from a VM scale set placed on a dedicated host group through + * automatic placement. + * + * @param manager Entry point to ComputeManager. + */ + public static void + getInstanceViewOfAVirtualMachineFromAVMScaleSetPlacedOnADedicatedHostGroupThroughAutomaticPlacement( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetVMs() + .getInstanceViewWithResponse( + "myResourceGroup", "myVirtualMachineScaleSet", "0", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMsGetSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMsGetSamples.java new file mode 100644 index 0000000000000..c94f1200b5a71 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMsGetSamples.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.generated; + +/** Samples for VirtualMachineScaleSetVMs Get. */ +public final class VirtualMachineScaleSetVMsGetSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_WithVMSizeProperties.json + */ + /** + * Sample code: Get VM scale set VM with VMSizeProperties. + * + * @param manager Entry point to ComputeManager. + */ + public static void getVMScaleSetVMWithVMSizeProperties( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetVMs() + .getWithResponse("myResourceGroup", "{vmss-name}", "0", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_WithUserData.json + */ + /** + * Sample code: Get VM scale set VM with UserData. + * + * @param manager Entry point to ComputeManager. + */ + public static void getVMScaleSetVMWithUserData(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetVMs() + .getWithResponse("myResourceGroup", "{vmss-name}", "0", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMsListSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMsListSamples.java new file mode 100644 index 0000000000000..a423cd4828001 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMsListSamples.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.generated; + +/** Samples for VirtualMachineScaleSetVMs List. */ +public final class VirtualMachineScaleSetVMsListSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_List_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetVM_List_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetVMListMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetVMs() + .list("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaaa", null, null, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_List_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetVM_List_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetVMListMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetVMs() + .list( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaa", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMsPerformMaintenanceSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMsPerformMaintenanceSamples.java new file mode 100644 index 0000000000000..15a6e8032cd9c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMsPerformMaintenanceSamples.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.generated; + +/** Samples for VirtualMachineScaleSetVMs PerformMaintenance. */ +public final class VirtualMachineScaleSetVMsPerformMaintenanceSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_PerformMaintenance_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetVM_PerformMaintenance_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetVMPerformMaintenanceMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetVMs() + .performMaintenance("rgcompute", "aaaaaaaaaaaaaa", "aaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_PerformMaintenance_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetVM_PerformMaintenance_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetVMPerformMaintenanceMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetVMs() + .performMaintenance("rgcompute", "aaaaaaaaaa", "aaaa", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMsPowerOffSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMsPowerOffSamples.java new file mode 100644 index 0000000000000..9c752dd2a8c9d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMsPowerOffSamples.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.generated; + +/** Samples for VirtualMachineScaleSetVMs PowerOff. */ +public final class VirtualMachineScaleSetVMsPowerOffSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_PowerOff_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetVM_PowerOff_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetVMPowerOffMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetVMs() + .powerOff("rgcompute", "aaaaaa", "aaaaaaaaa", true, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_PowerOff_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetVM_PowerOff_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetVMPowerOffMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetVMs() + .powerOff( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaa", + null, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMsRedeploySamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMsRedeploySamples.java new file mode 100644 index 0000000000000..00785475c9538 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMsRedeploySamples.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.generated; + +/** Samples for VirtualMachineScaleSetVMs Redeploy. */ +public final class VirtualMachineScaleSetVMsRedeploySamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Redeploy_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetVM_Redeploy_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetVMRedeployMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetVMs() + .redeploy( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Redeploy_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetVM_Redeploy_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetVMRedeployMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetVMs() + .redeploy("rgcompute", "aaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMsReimageAllSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMsReimageAllSamples.java new file mode 100644 index 0000000000000..85020f3ac5294 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMsReimageAllSamples.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.generated; + +/** Samples for VirtualMachineScaleSetVMs ReimageAll. */ +public final class VirtualMachineScaleSetVMsReimageAllSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_ReimageAll_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetVM_ReimageAll_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetVMReimageAllMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetVMs() + .reimageAll( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaa", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_ReimageAll_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetVM_ReimageAll_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetVMReimageAllMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetVMs() + .reimageAll( + "rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMsReimageSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMsReimageSamples.java new file mode 100644 index 0000000000000..310642df626f8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMsReimageSamples.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.generated; + +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMReimageParameters; + +/** Samples for VirtualMachineScaleSetVMs Reimage. */ +public final class VirtualMachineScaleSetVMsReimageSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Reimage_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetVM_Reimage_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetVMReimageMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetVMs() + .reimage( + "rgcompute", + "aaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + new VirtualMachineScaleSetVMReimageParameters().withTempDisk(true), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Reimage_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetVM_Reimage_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetVMReimageMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetVMs() + .reimage("rgcompute", "aaaaaaa", "aaaaaaaaaaaaa", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMsRestartSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMsRestartSamples.java new file mode 100644 index 0000000000000..193b274fba34d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMsRestartSamples.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.generated; + +/** Samples for VirtualMachineScaleSetVMs Restart. */ +public final class VirtualMachineScaleSetVMsRestartSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Restart_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetVM_Restart_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetVMRestartMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetVMs() + .restart("rgcompute", "aaaaaaaaaaaa", "aaaaaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Restart_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetVM_Restart_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetVMRestartMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetVMs() + .restart("rgcompute", "aa", "aaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMsRetrieveBootDiagnosticsDataSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMsRetrieveBootDiagnosticsDataSamples.java new file mode 100644 index 0000000000000..c8040ba4f29dc --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMsRetrieveBootDiagnosticsDataSamples.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.generated; + +/** Samples for VirtualMachineScaleSetVMs RetrieveBootDiagnosticsData. */ +public final class VirtualMachineScaleSetVMsRetrieveBootDiagnosticsDataSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_RetrieveBootDiagnosticsData.json + */ + /** + * Sample code: RetrieveBootDiagnosticsData of a virtual machine. + * + * @param manager Entry point to ComputeManager. + */ + public static void retrieveBootDiagnosticsDataOfAVirtualMachine( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetVMs() + .retrieveBootDiagnosticsDataWithResponse( + "ResourceGroup", "myvmScaleSet", "0", 60, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMsRunCommandSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMsRunCommandSamples.java new file mode 100644 index 0000000000000..d8dd2978f5b75 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMsRunCommandSamples.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.generated; + +import com.azure.resourcemanager.compute.generated.models.RunCommandInput; +import java.util.Arrays; + +/** Samples for VirtualMachineScaleSetVMs RunCommand. */ +public final class VirtualMachineScaleSetVMsRunCommandSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand.json + */ + /** + * Sample code: VirtualMachineScaleSetVMs_RunCommand. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetVMsRunCommand( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetVMs() + .runCommand( + "myResourceGroup", + "myVirtualMachineScaleSet", + "0", + new RunCommandInput() + .withCommandId("RunPowerShellScript") + .withScript(Arrays.asList("Write-Host Hello World!")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMsSimulateEvictionSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMsSimulateEvictionSamples.java new file mode 100644 index 0000000000000..d3bb632e70fc7 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMsSimulateEvictionSamples.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.generated; + +/** Samples for VirtualMachineScaleSetVMs SimulateEviction. */ +public final class VirtualMachineScaleSetVMsSimulateEvictionSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_SimulateEviction.json + */ + /** + * Sample code: Simulate Eviction a virtual machine. + * + * @param manager Entry point to ComputeManager. + */ + public static void simulateEvictionAVirtualMachine( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetVMs() + .simulateEvictionWithResponse( + "ResourceGroup", "VmScaleSetName", "InstanceId", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMsStartSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMsStartSamples.java new file mode 100644 index 0000000000000..68f6aadbcbe95 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMsStartSamples.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.generated; + +/** Samples for VirtualMachineScaleSetVMs Start. */ +public final class VirtualMachineScaleSetVMsStartSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Start_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetVM_Start_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetVMStartMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetVMs() + .start("rgcompute", "aaaaaaaaaaaaaa", "aaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Start_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetVM_Start_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetVMStartMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetVMs() + .start("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMsUpdateSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMsUpdateSamples.java new file mode 100644 index 0000000000000..13d28cbaadc1e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetVMsUpdateSamples.java @@ -0,0 +1,470 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetVMInner; +import com.azure.resourcemanager.compute.generated.models.AdditionalCapabilities; +import com.azure.resourcemanager.compute.generated.models.AdditionalUnattendContent; +import com.azure.resourcemanager.compute.generated.models.ApiEntityReference; +import com.azure.resourcemanager.compute.generated.models.BootDiagnostics; +import com.azure.resourcemanager.compute.generated.models.CachingTypes; +import com.azure.resourcemanager.compute.generated.models.ComponentNames; +import com.azure.resourcemanager.compute.generated.models.DataDisk; +import com.azure.resourcemanager.compute.generated.models.DeleteOptions; +import com.azure.resourcemanager.compute.generated.models.DiagnosticsProfile; +import com.azure.resourcemanager.compute.generated.models.DiffDiskOptions; +import com.azure.resourcemanager.compute.generated.models.DiffDiskPlacement; +import com.azure.resourcemanager.compute.generated.models.DiffDiskSettings; +import com.azure.resourcemanager.compute.generated.models.DiskCreateOptionTypes; +import com.azure.resourcemanager.compute.generated.models.DiskDeleteOptionTypes; +import com.azure.resourcemanager.compute.generated.models.DiskDetachOptionTypes; +import com.azure.resourcemanager.compute.generated.models.DiskEncryptionSetParameters; +import com.azure.resourcemanager.compute.generated.models.DiskEncryptionSettings; +import com.azure.resourcemanager.compute.generated.models.HardwareProfile; +import com.azure.resourcemanager.compute.generated.models.ImageReference; +import com.azure.resourcemanager.compute.generated.models.IpVersion; +import com.azure.resourcemanager.compute.generated.models.IpVersions; +import com.azure.resourcemanager.compute.generated.models.KeyVaultKeyReference; +import com.azure.resourcemanager.compute.generated.models.KeyVaultSecretReference; +import com.azure.resourcemanager.compute.generated.models.LinuxConfiguration; +import com.azure.resourcemanager.compute.generated.models.LinuxPatchAssessmentMode; +import com.azure.resourcemanager.compute.generated.models.LinuxPatchSettings; +import com.azure.resourcemanager.compute.generated.models.LinuxVMGuestPatchMode; +import com.azure.resourcemanager.compute.generated.models.ManagedDiskParameters; +import com.azure.resourcemanager.compute.generated.models.NetworkApiVersion; +import com.azure.resourcemanager.compute.generated.models.NetworkInterfaceReference; +import com.azure.resourcemanager.compute.generated.models.NetworkProfile; +import com.azure.resourcemanager.compute.generated.models.OSDisk; +import com.azure.resourcemanager.compute.generated.models.OSProfile; +import com.azure.resourcemanager.compute.generated.models.OperatingSystemTypes; +import com.azure.resourcemanager.compute.generated.models.PassNames; +import com.azure.resourcemanager.compute.generated.models.PatchSettings; +import com.azure.resourcemanager.compute.generated.models.Plan; +import com.azure.resourcemanager.compute.generated.models.ProtocolTypes; +import com.azure.resourcemanager.compute.generated.models.PublicIpAddressSku; +import com.azure.resourcemanager.compute.generated.models.PublicIpAddressSkuName; +import com.azure.resourcemanager.compute.generated.models.PublicIpAddressSkuTier; +import com.azure.resourcemanager.compute.generated.models.PublicIpAllocationMethod; +import com.azure.resourcemanager.compute.generated.models.SecurityProfile; +import com.azure.resourcemanager.compute.generated.models.SecurityTypes; +import com.azure.resourcemanager.compute.generated.models.SettingNames; +import com.azure.resourcemanager.compute.generated.models.SshConfiguration; +import com.azure.resourcemanager.compute.generated.models.SshPublicKey; +import com.azure.resourcemanager.compute.generated.models.StorageAccountTypes; +import com.azure.resourcemanager.compute.generated.models.StorageProfile; +import com.azure.resourcemanager.compute.generated.models.UefiSettings; +import com.azure.resourcemanager.compute.generated.models.VMSizeProperties; +import com.azure.resourcemanager.compute.generated.models.VirtualHardDisk; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineIpTag; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineNetworkInterfaceConfiguration; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineNetworkInterfaceDnsSettingsConfiguration; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineNetworkInterfaceIpConfiguration; +import com.azure.resourcemanager.compute.generated.models.VirtualMachinePublicIpAddressConfiguration; +import com.azure.resourcemanager.compute.generated.models.VirtualMachinePublicIpAddressDnsSettingsConfiguration; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetIpConfiguration; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetIpTag; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetNetworkConfiguration; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetNetworkConfigurationDnsSettings; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetPublicIpAddressConfiguration; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMNetworkProfileConfiguration; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMProtectionPolicy; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineSizeTypes; +import com.azure.resourcemanager.compute.generated.models.WinRMConfiguration; +import com.azure.resourcemanager.compute.generated.models.WinRMListener; +import com.azure.resourcemanager.compute.generated.models.WindowsConfiguration; +import com.azure.resourcemanager.compute.generated.models.WindowsPatchAssessmentMode; +import com.azure.resourcemanager.compute.generated.models.WindowsVMGuestPatchMode; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for VirtualMachineScaleSetVMs Update. */ +public final class VirtualMachineScaleSetVMsUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Update_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetVM_Update_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetVMUpdateMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetVMs() + .update( + "rgcompute", + "aaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + new VirtualMachineScaleSetVMInner() + .withLocation("westus") + .withTags(mapOf()) + .withPlan( + new Plan() + .withName("aaaaaaaaaa") + .withPublisher("aaaaaaaaaaaaaaaaaaaaaa") + .withProduct("aaaaaaaaaaaaaaaaaaaa") + .withPromotionCode("fakeTokenPlaceholder")) + .withHardwareProfile( + new HardwareProfile() + .withVmSize(VirtualMachineSizeTypes.BASIC_A0) + .withVmSizeProperties(new VMSizeProperties().withVCpusAvailable(9).withVCpusPerCore(12))) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withId("a") + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2012-R2-Datacenter") + .withVersion("4.127.20180315") + .withSharedGalleryImageId("aaaaaaaaaaaaaaaaaaaa")) + .withOsDisk( + new OSDisk() + .withOsType(OperatingSystemTypes.WINDOWS) + .withEncryptionSettings( + new DiskEncryptionSettings() + .withDiskEncryptionKey( + new KeyVaultSecretReference() + .withSecretUrl("fakeTokenPlaceholder") + .withSourceVault( + new SubResource() + .withId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"))) + .withKeyEncryptionKey( + new KeyVaultKeyReference() + .withKeyUrl("fakeTokenPlaceholder") + .withSourceVault( + new SubResource() + .withId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"))) + .withEnabled(true)) + .withName("vmss3176_vmss3176_0_OsDisk_1_6d72b805e50e4de6830303c5055077fc") + .withVhd( + new VirtualHardDisk() + .withUri( + "https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd")) + .withImage( + new VirtualHardDisk() + .withUri( + "https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd")) + .withCaching(CachingTypes.NONE) + .withWriteAcceleratorEnabled(true) + .withDiffDiskSettings( + new DiffDiskSettings() + .withOption(DiffDiskOptions.LOCAL) + .withPlacement(DiffDiskPlacement.CACHE_DISK)) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withDiskSizeGB(127) + .withManagedDisk( + new ManagedDiskParameters() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_OsDisk_1_6d72b805e50e4de6830303c5055077fc") + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS) + .withDiskEncryptionSet( + new DiskEncryptionSetParameters().withId("aaaaaaaaaaaa"))) + .withDeleteOption(DiskDeleteOptionTypes.DELETE)) + .withDataDisks( + Arrays + .asList( + new DataDisk() + .withLun(1) + .withName("vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d") + .withVhd( + new VirtualHardDisk() + .withUri( + "https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd")) + .withImage( + new VirtualHardDisk() + .withUri( + "https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd")) + .withCaching(CachingTypes.NONE) + .withWriteAcceleratorEnabled(true) + .withCreateOption(DiskCreateOptionTypes.EMPTY) + .withDiskSizeGB(128) + .withManagedDisk( + new ManagedDiskParameters() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d") + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS) + .withDiskEncryptionSet( + new DiskEncryptionSetParameters().withId("aaaaaaaaaaaa"))) + .withToBeDetached(true) + .withDetachOption(DiskDetachOptionTypes.FORCE_DETACH) + .withDeleteOption(DiskDeleteOptionTypes.DELETE)))) + .withAdditionalCapabilities( + new AdditionalCapabilities().withUltraSsdEnabled(true).withHibernationEnabled(true)) + .withOsProfile( + new OSProfile() + .withComputerName("test000000") + .withAdminUsername("Foo12") + .withAdminPassword("fakeTokenPlaceholder") + .withCustomData("aaaa") + .withWindowsConfiguration( + new WindowsConfiguration() + .withProvisionVMAgent(true) + .withEnableAutomaticUpdates(true) + .withTimeZone("aaaaaaaaaaaaaaaaaaaaaaaaaaa") + .withAdditionalUnattendContent( + Arrays + .asList( + new AdditionalUnattendContent() + .withPassName(PassNames.OOBE_SYSTEM) + .withComponentName(ComponentNames.MICROSOFT_WINDOWS_SHELL_SETUP) + .withSettingName(SettingNames.AUTO_LOGON) + .withContent("aaaaaaaaaaaaaaaaaaaa"))) + .withPatchSettings( + new PatchSettings() + .withPatchMode(WindowsVMGuestPatchMode.MANUAL) + .withEnableHotpatching(true) + .withAssessmentMode(WindowsPatchAssessmentMode.IMAGE_DEFAULT)) + .withWinRM( + new WinRMConfiguration() + .withListeners( + Arrays + .asList( + new WinRMListener() + .withProtocol(ProtocolTypes.HTTP) + .withCertificateUrl("aaaaaaaaaaaaaaaaaaaaaa"))))) + .withLinuxConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSsh( + new SshConfiguration() + .withPublicKeys( + Arrays + .asList( + new SshPublicKey() + .withPath("aaa") + .withKeyData("fakeTokenPlaceholder")))) + .withProvisionVMAgent(true) + .withPatchSettings( + new LinuxPatchSettings() + .withPatchMode(LinuxVMGuestPatchMode.IMAGE_DEFAULT) + .withAssessmentMode(LinuxPatchAssessmentMode.IMAGE_DEFAULT))) + .withSecrets(Arrays.asList()) + .withAllowExtensionOperations(true) + .withRequireGuestProvisionSignal(true)) + .withSecurityProfile( + new SecurityProfile() + .withUefiSettings(new UefiSettings().withSecureBootEnabled(true).withVTpmEnabled(true)) + .withEncryptionAtHost(true) + .withSecurityType(SecurityTypes.TRUSTED_LAUNCH)) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}/virtualMachines/0/networkInterfaces/vmsstestnetconfig5415") + .withPrimary(true) + .withDeleteOption(DeleteOptions.DELETE))) + .withNetworkApiVersion(NetworkApiVersion.TWO_ZERO_TWO_ZERO_ONE_ONE_ZERO_ONE) + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineNetworkInterfaceConfiguration() + .withName("aaaaaaaaaaa") + .withPrimary(true) + .withDeleteOption(DeleteOptions.DELETE) + .withEnableAcceleratedNetworking(true) + .withEnableFpga(true) + .withEnableIpForwarding(true) + .withNetworkSecurityGroup( + new SubResource() + .withId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}")) + .withDnsSettings( + new VirtualMachineNetworkInterfaceDnsSettingsConfiguration() + .withDnsServers(Arrays.asList("aaaaaa"))) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineNetworkInterfaceIpConfiguration() + .withName("aa") + .withSubnet( + new SubResource() + .withId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}")) + .withPrimary(true) + .withPublicIpAddressConfiguration( + new VirtualMachinePublicIpAddressConfiguration() + .withName("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa") + .withSku( + new PublicIpAddressSku() + .withName(PublicIpAddressSkuName.BASIC) + .withTier(PublicIpAddressSkuTier.REGIONAL)) + .withIdleTimeoutInMinutes(2) + .withDeleteOption(DeleteOptions.DELETE) + .withDnsSettings( + new VirtualMachinePublicIpAddressDnsSettingsConfiguration() + .withDomainNameLabel( + "aaaaaaaaaaaaaaaaaaaaaaaaa")) + .withIpTags( + Arrays + .asList( + new VirtualMachineIpTag() + .withIpTagType( + "aaaaaaaaaaaaaaaaaaaaaaaaa") + .withTag("aaaaaaaaaaaaaaaaaaaa"))) + .withPublicIpPrefix( + new SubResource() + .withId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}")) + .withPublicIpAddressVersion(IpVersions.IPV4) + .withPublicIpAllocationMethod( + PublicIpAllocationMethod.DYNAMIC)) + .withPrivateIpAddressVersion(IpVersions.IPV4) + .withApplicationSecurityGroups( + Arrays + .asList( + new SubResource() + .withId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"))) + .withApplicationGatewayBackendAddressPools( + Arrays + .asList( + new SubResource() + .withId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"))) + .withLoadBalancerBackendAddressPools( + Arrays + .asList( + new SubResource() + .withId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"))))) + .withDscpConfiguration( + new SubResource() + .withId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"))))) + .withNetworkProfileConfiguration( + new VirtualMachineScaleSetVMNetworkProfileConfiguration() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("vmsstestnetconfig5415") + .withPrimary(true) + .withEnableAcceleratedNetworking(true) + .withEnableFpga(true) + .withNetworkSecurityGroup( + new SubResource() + .withId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}")) + .withDnsSettings( + new VirtualMachineScaleSetNetworkConfigurationDnsSettings() + .withDnsServers(Arrays.asList())) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("vmsstestnetconfig9693") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/vn4071/subnets/sn5503")) + .withPrimary(true) + .withPublicIpAddressConfiguration( + new VirtualMachineScaleSetPublicIpAddressConfiguration() + .withName("aaaaaaaaaaaaaaaaaa") + .withSku( + new PublicIpAddressSku() + .withName(PublicIpAddressSkuName.BASIC) + .withTier(PublicIpAddressSkuTier.REGIONAL)) + .withIdleTimeoutInMinutes(18) + .withDnsSettings( + new VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings() + .withDomainNameLabel("aaaaaaaaaaaaaaaaaa")) + .withIpTags( + Arrays + .asList( + new VirtualMachineScaleSetIpTag() + .withIpTagType("aaaaaaa") + .withTag( + "aaaaaaaaaaaaaaaaaaaaaaaaaaa"))) + .withPublicIpPrefix( + new SubResource() + .withId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}")) + .withPublicIpAddressVersion(IpVersion.IPV4) + .withDeleteOption(DeleteOptions.DELETE)) + .withPrivateIpAddressVersion(IpVersion.IPV4) + .withApplicationGatewayBackendAddressPools( + Arrays + .asList( + new SubResource() + .withId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"))) + .withApplicationSecurityGroups( + Arrays + .asList( + new SubResource() + .withId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"))) + .withLoadBalancerBackendAddressPools( + Arrays + .asList( + new SubResource() + .withId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"))) + .withLoadBalancerInboundNatPools( + Arrays + .asList( + new SubResource() + .withId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"))))) + .withEnableIpForwarding(true) + .withDeleteOption(DeleteOptions.DELETE)))) + .withDiagnosticsProfile( + new DiagnosticsProfile() + .withBootDiagnostics( + new BootDiagnostics().withEnabled(true).withStorageUri("aaaaaaaaaaaaa"))) + .withAvailabilitySet( + new SubResource() + .withId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}")) + .withLicenseType("aaaaaaaaaa") + .withProtectionPolicy( + new VirtualMachineScaleSetVMProtectionPolicy() + .withProtectFromScaleIn(true) + .withProtectFromScaleSetActions(true)) + .withUserData("RXhhbXBsZSBVc2VyRGF0YQ=="), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Update_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSetVM_Update_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetVMUpdateMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSetVMs() + .update( + "rgcompute", + "aaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaa", + new VirtualMachineScaleSetVMInner().withLocation("westus"), + com.azure.core.util.Context.NONE); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsConvertToSinglePlacementGroupSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsConvertToSinglePlacementGroupSamples.java new file mode 100644 index 0000000000000..fcd25c7814439 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsConvertToSinglePlacementGroupSamples.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.generated; + +import com.azure.resourcemanager.compute.generated.models.VMScaleSetConvertToSinglePlacementGroupInput; + +/** Samples for VirtualMachineScaleSets ConvertToSinglePlacementGroup. */ +public final class VirtualMachineScaleSetsConvertToSinglePlacementGroupSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ConvertToSinglePlacementGroup_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_ConvertToSinglePlacementGroup_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetConvertToSinglePlacementGroupMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .convertToSinglePlacementGroupWithResponse( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + new VMScaleSetConvertToSinglePlacementGroupInput() + .withActivePlacementGroupId("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ConvertToSinglePlacementGroup_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_ConvertToSinglePlacementGroup_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetConvertToSinglePlacementGroupMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .convertToSinglePlacementGroupWithResponse( + "rgcompute", + "aaaaaaaaaaaaa", + new VMScaleSetConvertToSinglePlacementGroupInput(), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsCreateOrUpdateSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..09d08c07c36fc --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsCreateOrUpdateSamples.java @@ -0,0 +1,2730 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +import com.azure.core.management.SubResource; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetExtensionInner; +import com.azure.resourcemanager.compute.generated.models.ApiEntityReference; +import com.azure.resourcemanager.compute.generated.models.ApplicationProfile; +import com.azure.resourcemanager.compute.generated.models.AutomaticOSUpgradePolicy; +import com.azure.resourcemanager.compute.generated.models.AutomaticRepairsPolicy; +import com.azure.resourcemanager.compute.generated.models.BillingProfile; +import com.azure.resourcemanager.compute.generated.models.BootDiagnostics; +import com.azure.resourcemanager.compute.generated.models.CachingTypes; +import com.azure.resourcemanager.compute.generated.models.CapacityReservationProfile; +import com.azure.resourcemanager.compute.generated.models.DiagnosticsProfile; +import com.azure.resourcemanager.compute.generated.models.DiffDiskOptions; +import com.azure.resourcemanager.compute.generated.models.DiffDiskPlacement; +import com.azure.resourcemanager.compute.generated.models.DiffDiskSettings; +import com.azure.resourcemanager.compute.generated.models.DiskCreateOptionTypes; +import com.azure.resourcemanager.compute.generated.models.DiskEncryptionSetParameters; +import com.azure.resourcemanager.compute.generated.models.ImageReference; +import com.azure.resourcemanager.compute.generated.models.IpVersion; +import com.azure.resourcemanager.compute.generated.models.KeyVaultSecretReference; +import com.azure.resourcemanager.compute.generated.models.LinuxConfiguration; +import com.azure.resourcemanager.compute.generated.models.OSImageNotificationProfile; +import com.azure.resourcemanager.compute.generated.models.OrchestrationMode; +import com.azure.resourcemanager.compute.generated.models.Plan; +import com.azure.resourcemanager.compute.generated.models.PriorityMixPolicy; +import com.azure.resourcemanager.compute.generated.models.ScaleInPolicy; +import com.azure.resourcemanager.compute.generated.models.ScheduledEventsProfile; +import com.azure.resourcemanager.compute.generated.models.SecurityEncryptionTypes; +import com.azure.resourcemanager.compute.generated.models.SecurityPostureReference; +import com.azure.resourcemanager.compute.generated.models.SecurityProfile; +import com.azure.resourcemanager.compute.generated.models.SecurityTypes; +import com.azure.resourcemanager.compute.generated.models.ServiceArtifactReference; +import com.azure.resourcemanager.compute.generated.models.Sku; +import com.azure.resourcemanager.compute.generated.models.SpotRestorePolicy; +import com.azure.resourcemanager.compute.generated.models.SshConfiguration; +import com.azure.resourcemanager.compute.generated.models.SshPublicKey; +import com.azure.resourcemanager.compute.generated.models.StorageAccountTypes; +import com.azure.resourcemanager.compute.generated.models.TerminateNotificationProfile; +import com.azure.resourcemanager.compute.generated.models.UefiSettings; +import com.azure.resourcemanager.compute.generated.models.UpgradeMode; +import com.azure.resourcemanager.compute.generated.models.UpgradePolicy; +import com.azure.resourcemanager.compute.generated.models.VMDiskSecurityProfile; +import com.azure.resourcemanager.compute.generated.models.VMGalleryApplication; +import com.azure.resourcemanager.compute.generated.models.VMSizeProperties; +import com.azure.resourcemanager.compute.generated.models.VirtualHardDisk; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineEvictionPolicyTypes; +import com.azure.resourcemanager.compute.generated.models.VirtualMachinePriorityTypes; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetDataDisk; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetExtensionProfile; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetHardwareProfile; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetIpConfiguration; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetManagedDiskParameters; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetNetworkConfiguration; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetNetworkProfile; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetOSDisk; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetOSProfile; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetPublicIpAddressConfiguration; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetScaleInRules; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetStorageProfile; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMProfile; +import java.io.IOException; +import java.util.Arrays; + +/** Samples for VirtualMachineScaleSets CreateOrUpdate. */ +public final class VirtualMachineScaleSetsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithEmptyDataDisksOnEachVm.json + */ + /** + * Sample code: Create a scale set with empty data disks on each vm. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAScaleSetWithEmptyDataDisksOnEachVm( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_D2_v2").withTier("Standard").withCapacity(3L)) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withDiskSizeGB(512) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))) + .withDataDisks( + Arrays + .asList( + new VirtualMachineScaleSetDataDisk() + .withLun(0) + .withCreateOption(DiskCreateOptionTypes.EMPTY) + .withDiskSizeGB(1023), + new VirtualMachineScaleSetDataDisk() + .withLun(1) + .withCreateOption(DiskCreateOptionTypes.EMPTY) + .withDiskSizeGB(1023)))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true))))) + .withOverprovision(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithOSImageScheduledEventEnabled.json + */ + /** + * Sample code: Create a scale set with OS image scheduled events enabled. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAScaleSetWithOSImageScheduledEventsEnabled( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L)) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true)))) + .withScheduledEventsProfile( + new ScheduledEventsProfile() + .withOsImageNotificationProfile( + new OSImageNotificationProfile().withNotBeforeTimeout("PT15M").withEnable(true)))) + .withOverprovision(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithUserData.json + */ + /** + * Sample code: Create a scale set with userData. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAScaleSetWithUserData(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L)) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true)))) + .withUserData("RXhhbXBsZSBVc2VyRGF0YQ==")) + .withOverprovision(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromWithFpgaNetworkInterface.json + */ + /** + * Sample code: Create a scale set with Fpga Network Interfaces. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAScaleSetWithFpgaNetworkInterfaces( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L)) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true), + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{fpgaNic-Name}") + .withPrimary(false) + .withEnableAcceleratedNetworking(false) + .withEnableFpga(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{fpgaNic-Name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-fpga-subnet-name}")) + .withPrimary(true) + .withPrivateIpAddressVersion(IpVersion.IPV4))) + .withEnableIpForwarding(false))))) + .withOverprovision(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromACustomImage.json + */ + /** + * Sample code: Create a scale set from a custom image. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAScaleSetFromACustomImage( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L)) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true))))) + .withOverprovision(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_CreateA_WithDiffOsDiskUsingDiffDiskPlacement.json + */ + /** + * Sample code: Create a scale set with ephemeral os disks using placement property. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAScaleSetWithEphemeralOsDisksUsingPlacementProperty( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_DS1_v2").withTier("Standard").withCapacity(3L)) + .withPlan( + new Plan() + .withName("windows2016") + .withPublisher("microsoft-ads") + .withProduct("windows-data-science-vm")) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("microsoft-ads") + .withOffer("windows-data-science-vm") + .withSku("windows2016") + .withVersion("latest")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withCaching(CachingTypes.READ_ONLY) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withDiffDiskSettings( + new DiffDiskSettings() + .withOption(DiffDiskOptions.LOCAL) + .withPlacement(DiffDiskPlacement.RESOURCE_DISK)) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true))))) + .withOverprovision(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithScaleInPolicy.json + */ + /** + * Sample code: Create a scale set with scaleInPolicy. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAScaleSetWithScaleInPolicy( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L)) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true))))) + .withOverprovision(true) + .withScaleInPolicy( + new ScaleInPolicy() + .withRules(Arrays.asList(VirtualMachineScaleSetScaleInRules.OLDEST_VM)) + .withForceDeletion(true)) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithServiceArtifactReference.json + */ + /** + * Sample code: Create a scale set with Service Artifact Reference. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAScaleSetWithServiceArtifactReference( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("eastus2euap") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_A1").withTier("Standard").withCapacity(3L)) + .withUpgradePolicy( + new UpgradePolicy() + .withMode(UpgradeMode.AUTOMATIC) + .withAutomaticOSUpgradePolicy(new AutomaticOSUpgradePolicy().withEnableAutomaticOSUpgrade(true))) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2022-Datacenter") + .withVersion("latest")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withName("osDisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true)))) + .withServiceArtifactReference( + new ServiceArtifactReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName/serviceArtifacts/serviceArtifactName/vmArtifactsProfiles/vmArtifactsProfilesName"))) + .withOverprovision(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithEncryptionAtHost.json + */ + /** + * Sample code: Create a scale set with Host Encryption using encryptionAtHost property. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAScaleSetWithHostEncryptionUsingEncryptionAtHostProperty( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_DS1_v2").withTier("Standard").withCapacity(3L)) + .withPlan( + new Plan() + .withName("windows2016") + .withPublisher("microsoft-ads") + .withProduct("windows-data-science-vm")) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("microsoft-ads") + .withOffer("windows-data-science-vm") + .withSku("windows2016") + .withVersion("latest")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withCaching(CachingTypes.READ_ONLY) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true)))) + .withSecurityProfile(new SecurityProfile().withEncryptionAtHost(true))) + .withOverprovision(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithProtectedSettingsFromKeyVault.json + */ + /** + * Sample code: Create a VMSS with an extension with protectedSettingsFromKeyVault. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVMSSWithAnExtensionWithProtectedSettingsFromKeyVault( + com.azure.resourcemanager.compute.generated.ComputeManager manager) throws IOException { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L)) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true)))) + .withDiagnosticsProfile( + new DiagnosticsProfile() + .withBootDiagnostics( + new BootDiagnostics() + .withEnabled(true) + .withStorageUri("http://{existing-storage-account-name}.blob.core.windows.net"))) + .withExtensionProfile( + new VirtualMachineScaleSetExtensionProfile() + .withExtensions( + Arrays + .asList( + new VirtualMachineScaleSetExtensionInner() + .withName("{extension-name}") + .withPublisher("{extension-Publisher}") + .withTypePropertiesType("{extension-Type}") + .withTypeHandlerVersion("{handler-version}") + .withAutoUpgradeMinorVersion(false) + .withSettings( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .withProtectedSettingsFromKeyVault( + new KeyVaultSecretReference() + .withSecretUrl("fakeTokenPlaceholder") + .withSourceVault( + new SubResource() + .withId( + "/subscriptions/a53f7094-a16c-47af-abe4-b05c05d0d79a/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/kvName"))))))) + .withOverprovision(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithAzureLoadBalancer.json + */ + /** + * Sample code: Create a scale set with an azure load balancer. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAScaleSetWithAnAzureLoadBalancer( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L)) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")) + .withPublicIpAddressConfiguration( + new VirtualMachineScaleSetPublicIpAddressConfiguration() + .withName("{vmss-name}") + .withPublicIpAddressVersion(IpVersion.IPV4)) + .withLoadBalancerBackendAddressPools( + Arrays + .asList( + new SubResource() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/loadBalancers/{existing-load-balancer-name}/backendAddressPools/{existing-backend-address-pool-name}"))) + .withLoadBalancerInboundNatPools( + Arrays + .asList( + new SubResource() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/loadBalancers/{existing-load-balancer-name}/inboundNatPools/{existing-nat-pool-name}"))))) + .withEnableIpForwarding(true))))) + .withOverprovision(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithManagedBootDiagnostics.json + */ + /** + * Sample code: Create a scale set with managed boot diagnostics. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAScaleSetWithManagedBootDiagnostics( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L)) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true)))) + .withDiagnosticsProfile( + new DiagnosticsProfile().withBootDiagnostics(new BootDiagnostics().withEnabled(true)))) + .withOverprovision(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithAMarketplaceImagePlan.json + */ + /** + * Sample code: Create a scale set with a marketplace image plan. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAScaleSetWithAMarketplaceImagePlan( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L)) + .withPlan( + new Plan() + .withName("windows2016") + .withPublisher("microsoft-ads") + .withProduct("windows-data-science-vm")) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("microsoft-ads") + .withOffer("windows-data-science-vm") + .withSku("windows2016") + .withVersion("latest")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true))))) + .withOverprovision(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithDiffOsDisk.json + */ + /** + * Sample code: Create a scale set with ephemeral os disks. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAScaleSetWithEphemeralOsDisks( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_DS1_v2").withTier("Standard").withCapacity(3L)) + .withPlan( + new Plan() + .withName("windows2016") + .withPublisher("microsoft-ads") + .withProduct("windows-data-science-vm")) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("microsoft-ads") + .withOffer("windows-data-science-vm") + .withSku("windows2016") + .withVersion("latest")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withCaching(CachingTypes.READ_ONLY) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withDiffDiskSettings(new DiffDiskSettings().withOption(DiffDiskOptions.LOCAL)) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true))))) + .withOverprovision(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithVMsInDifferentZones.json + */ + /** + * Sample code: Create a scale set with virtual machines in different zones. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAScaleSetWithVirtualMachinesInDifferentZones( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("centralus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_A1_v2").withTier("Standard").withCapacity(2L)) + .withZones(Arrays.asList("1", "3")) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.AUTOMATIC)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withDiskSizeGB(512) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))) + .withDataDisks( + Arrays + .asList( + new VirtualMachineScaleSetDataDisk() + .withLun(0) + .withCreateOption(DiskCreateOptionTypes.EMPTY) + .withDiskSizeGB(1023), + new VirtualMachineScaleSetDataDisk() + .withLun(1) + .withCreateOption(DiskCreateOptionTypes.EMPTY) + .withDiskSizeGB(1023)))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true))))) + .withOverprovision(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithCapacityReservation.json + */ + /** + * Sample code: Create or update a scale set with capacity reservation. + * + * @param manager Entry point to ComputeManager. + */ + public static void createOrUpdateAScaleSetWithCapacityReservation( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_DS1_v2").withTier("Standard").withCapacity(3L)) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true)))) + .withCapacityReservation( + new CapacityReservationProfile() + .withCapacityReservationGroup( + new SubResource() + .withId( + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/CapacityReservationGroups/{crgName}")))) + .withOverprovision(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSecurityTypeConfidentialVM.json + */ + /** + * Sample code: Create a scale set with SecurityType as ConfidentialVM. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAScaleSetWithSecurityTypeAsConfidentialVM( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_DC2as_v5").withTier("Standard").withCapacity(3L)) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("2019-datacenter-cvm") + .withSku("windows-cvm") + .withVersion("17763.2183.2109130127")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withCaching(CachingTypes.READ_ONLY) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_SSD_LRS) + .withSecurityProfile( + new VMDiskSecurityProfile() + .withSecurityEncryptionType( + SecurityEncryptionTypes.VMGUEST_STATE_ONLY))))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true)))) + .withSecurityProfile( + new SecurityProfile() + .withUefiSettings(new UefiSettings().withSecureBootEnabled(true).withVTpmEnabled(true)) + .withSecurityType(SecurityTypes.CONFIDENTIAL_VM))) + .withOverprovision(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSshAuthentication.json + */ + /** + * Sample code: Create a scale set with ssh authentication. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAScaleSetWithSshAuthentication( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L)) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withLinuxConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSsh( + new SshConfiguration() + .withPublicKeys( + Arrays + .asList( + new SshPublicKey() + .withPath("/home/{your-username}/.ssh/authorized_keys") + .withKeyData("fakeTokenPlaceholder")))))) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true))))) + .withOverprovision(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithAzureApplicationGateway.json + */ + /** + * Sample code: Create a scale set with an azure application gateway. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAScaleSetWithAnAzureApplicationGateway( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L)) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")) + .withApplicationGatewayBackendAddressPools( + Arrays + .asList( + new SubResource() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/applicationGateways/{existing-application-gateway-name}/backendAddressPools/{existing-backend-address-pool-name}"))))) + .withEnableIpForwarding(true))))) + .withOverprovision(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_CustomImageFromAnUnmanagedGeneralizedOsImage.json + */ + /** + * Sample code: Create a custom-image scale set from an unmanaged generalized os image. + * + * @param manager Entry point to ComputeManager. + */ + public static void createACustomImageScaleSetFromAnUnmanagedGeneralizedOsImage( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L)) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withName("osDisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withImage( + new VirtualHardDisk() + .withUri( + "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/{existing-generalized-os-image-blob-name}.vhd")))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true))))) + .withOverprovision(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithExtensionsTimeBudget.json + */ + /** + * Sample code: Create a scale set with extension time budget. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAScaleSetWithExtensionTimeBudget( + com.azure.resourcemanager.compute.generated.ComputeManager manager) throws IOException { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L)) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true)))) + .withDiagnosticsProfile( + new DiagnosticsProfile() + .withBootDiagnostics( + new BootDiagnostics() + .withEnabled(true) + .withStorageUri("http://{existing-storage-account-name}.blob.core.windows.net"))) + .withExtensionProfile( + new VirtualMachineScaleSetExtensionProfile() + .withExtensions( + Arrays + .asList( + new VirtualMachineScaleSetExtensionInner() + .withName("{extension-name}") + .withPublisher("{extension-Publisher}") + .withTypePropertiesType("{extension-Type}") + .withTypeHandlerVersion("{handler-version}") + .withAutoUpgradeMinorVersion(false) + .withSettings( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)))) + .withExtensionsTimeBudget("PT1H20M"))) + .withOverprovision(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithApplicationProfile.json + */ + /** + * Sample code: Create a scale set with Application Profile. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAScaleSetWithApplicationProfile( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L)) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true)))) + .withApplicationProfile( + new ApplicationProfile() + .withGalleryApplications( + Arrays + .asList( + new VMGalleryApplication() + .withTags("myTag1") + .withOrder(1) + .withPackageReferenceId( + "/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdb/resourceGroups/myresourceGroupName2/providers/Microsoft.Compute/galleries/myGallery1/applications/MyApplication1/versions/1.0") + .withConfigurationReference( + "https://mystorageaccount.blob.core.windows.net/configurations/settings.config") + .withTreatFailureAsDeploymentFailure(true) + .withEnableAutomaticUpgrade(false), + new VMGalleryApplication() + .withPackageReferenceId( + "/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdg/resourceGroups/myresourceGroupName3/providers/Microsoft.Compute/galleries/myGallery2/applications/MyApplication2/versions/1.1"))))) + .withOverprovision(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithDiskEncryptionSetResource.json + */ + /** + * Sample code: Create a scale set with DiskEncryptionSet resource in os disk and data disk. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAScaleSetWithDiskEncryptionSetResourceInOsDiskAndDataDisk( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_DS1_v2").withTier("Standard").withCapacity(3L)) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS) + .withDiskEncryptionSet( + new DiskEncryptionSetParameters() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}")))) + .withDataDisks( + Arrays + .asList( + new VirtualMachineScaleSetDataDisk() + .withLun(0) + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.EMPTY) + .withDiskSizeGB(1023) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS) + .withDiskEncryptionSet( + new DiskEncryptionSetParameters() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}")))))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true))))) + .withOverprovision(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithPremiumStorage.json + */ + /** + * Sample code: Create a scale set with premium storage. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAScaleSetWithPremiumStorage( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L)) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.PREMIUM_LRS)))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true))))) + .withOverprovision(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromWithDisableTcpStateTrackingNetworkInterface.json + */ + /** + * Sample code: Create a scale set where nic config has DisableTcpStateTracking property. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAScaleSetWhereNicConfigHasDisableTcpStateTrackingProperty( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L)) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{nicConfig1-name}") + .withPrimary(true) + .withEnableAcceleratedNetworking(true) + .withDisableTcpStateTracking(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true), + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{nicConfig2-name}") + .withPrimary(false) + .withEnableAcceleratedNetworking(false) + .withDisableTcpStateTracking(false) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{nicConfig2-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-fpga-subnet-name2}")) + .withPrimary(true) + .withPrivateIpAddressVersion(IpVersion.IPV4))) + .withEnableIpForwarding(false))))) + .withOverprovision(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithVMSizeProperties.json + */ + /** + * Sample code: Create a scale set with vm size properties. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAScaleSetWithVmSizeProperties( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L)) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true)))) + .withUserData("RXhhbXBsZSBVc2VyRGF0YQ==") + .withHardwareProfile( + new VirtualMachineScaleSetHardwareProfile() + .withVmSizeProperties(new VMSizeProperties().withVCpusAvailable(1).withVCpusPerCore(1)))) + .withOverprovision(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithTerminateScheduledEventEnabled.json + */ + /** + * Sample code: Create a scale set with terminate scheduled events enabled. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAScaleSetWithTerminateScheduledEventsEnabled( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L)) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true)))) + .withScheduledEventsProfile( + new ScheduledEventsProfile() + .withTerminateNotificationProfile( + new TerminateNotificationProfile().withNotBeforeTimeout("PT5M").withEnable(true)))) + .withOverprovision(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithExtensionsSuppressFailuresEnabled.json + */ + /** + * Sample code: Create a VMSS with an extension that has suppressFailures enabled. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVMSSWithAnExtensionThatHasSuppressFailuresEnabled( + com.azure.resourcemanager.compute.generated.ComputeManager manager) throws IOException { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L)) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true)))) + .withDiagnosticsProfile( + new DiagnosticsProfile() + .withBootDiagnostics( + new BootDiagnostics() + .withEnabled(true) + .withStorageUri("http://{existing-storage-account-name}.blob.core.windows.net"))) + .withExtensionProfile( + new VirtualMachineScaleSetExtensionProfile() + .withExtensions( + Arrays + .asList( + new VirtualMachineScaleSetExtensionInner() + .withName("{extension-name}") + .withPublisher("{extension-Publisher}") + .withTypePropertiesType("{extension-Type}") + .withTypeHandlerVersion("{handler-version}") + .withAutoUpgradeMinorVersion(false) + .withSettings( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .withSuppressFailures(true))))) + .withOverprovision(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_PlatformImageWithUnmanagedOsDisks.json + */ + /** + * Sample code: Create a platform-image scale set with unmanaged os disks. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAPlatformImageScaleSetWithUnmanagedOsDisks( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L)) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withName("osDisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withVhdContainers( + Arrays + .asList( + "http://{existing-storage-account-name-0}.blob.core.windows.net/vhdContainer", + "http://{existing-storage-account-name-1}.blob.core.windows.net/vhdContainer", + "http://{existing-storage-account-name-2}.blob.core.windows.net/vhdContainer", + "http://{existing-storage-account-name-3}.blob.core.windows.net/vhdContainer", + "http://{existing-storage-account-name-4}.blob.core.windows.net/vhdContainer")))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true))))) + .withOverprovision(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithUefiSettings.json + */ + /** + * Sample code: Create a scale set with Uefi Settings of secureBoot and vTPM. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAScaleSetWithUefiSettingsOfSecureBootAndVTPM( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_D2s_v3").withTier("Standard").withCapacity(3L)) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("windowsserver-gen2preview-preview") + .withSku("windows10-tvm") + .withVersion("18363.592.2001092016")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withCaching(CachingTypes.READ_ONLY) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_SSD_LRS)))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true)))) + .withSecurityProfile( + new SecurityProfile() + .withUefiSettings(new UefiSettings().withSecureBootEnabled(true).withVTpmEnabled(true)) + .withSecurityType(SecurityTypes.TRUSTED_LAUNCH))) + .withOverprovision(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithPasswordAuthentication.json + */ + /** + * Sample code: Create a scale set with password authentication. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAScaleSetWithPasswordAuthentication( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L)) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true))))) + .withOverprovision(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithDiskControllerType.json + */ + /** + * Sample code: Create a scale set with Disk Controller Type. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAScaleSetWithDiskControllerType( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L)) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))) + .withDiskControllerType("NVMe")) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true)))) + .withUserData("RXhhbXBsZSBVc2VyRGF0YQ==") + .withHardwareProfile( + new VirtualMachineScaleSetHardwareProfile() + .withVmSizeProperties(new VMSizeProperties().withVCpusAvailable(1).withVCpusPerCore(1)))) + .withOverprovision(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSecurityPostureReference.json + */ + /** + * Sample code: Create a scale set with Security Posture Reference. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAScaleSetWithSecurityPostureReference( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("eastus2euap") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_A1").withTier("Standard").withCapacity(3L)) + .withUpgradePolicy( + new UpgradePolicy() + .withMode(UpgradeMode.AUTOMATIC) + .withAutomaticOSUpgradePolicy(new AutomaticOSUpgradePolicy().withEnableAutomaticOSUpgrade(true))) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2022-Datacenter") + .withVersion("latest")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withName("osDisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true)))) + .withSecurityPostureReference( + new SecurityPostureReference() + .withId( + "/CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|{major.*}|latest"))) + .withOverprovision(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithPriorityMixPolicy.json + */ + /** + * Sample code: Create a scale set with priority mix policy. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAScaleSetWithPriorityMixPolicy( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_A8m_v2").withTier("Standard").withCapacity(10L)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true)))) + .withPriority(VirtualMachinePriorityTypes.SPOT) + .withEvictionPolicy(VirtualMachineEvictionPolicyTypes.DEALLOCATE) + .withBillingProfile(new BillingProfile().withMaxPrice(-1.0D))) + .withSinglePlacementGroup(false) + .withOrchestrationMode(OrchestrationMode.FLEXIBLE) + .withPriorityMixPolicy( + new PriorityMixPolicy().withBaseRegularPriorityCount(4).withRegularPriorityPercentageAboveBase(50)) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithAutomaticRepairs.json + */ + /** + * Sample code: Create a scale set with automatic repairs enabled. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAScaleSetWithAutomaticRepairsEnabled( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L)) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) + .withAutomaticRepairsPolicy(new AutomaticRepairsPolicy().withEnabled(true).withGracePeriod("PT10M")) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true))))) + .withOverprovision(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSpotRestorePolicy.json + */ + /** + * Sample code: Create a scale set with spot restore policy. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAScaleSetWithSpotRestorePolicy( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_A8m_v2").withTier("Standard").withCapacity(2L)) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true)))) + .withPriority(VirtualMachinePriorityTypes.SPOT) + .withEvictionPolicy(VirtualMachineEvictionPolicyTypes.DEALLOCATE) + .withBillingProfile(new BillingProfile().withMaxPrice(-1.0D))) + .withOverprovision(true) + .withSpotRestorePolicy(new SpotRestorePolicy().withEnabled(true).withRestoreTimeout("PT1H")) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromAGeneralizedSharedImage.json + */ + /** + * Sample code: Create a scale set from a generalized shared image. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAScaleSetFromAGeneralizedSharedImage( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L)) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true))))) + .withOverprovision(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithBootDiagnostics.json + */ + /** + * Sample code: Create a scale set with boot diagnostics. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAScaleSetWithBootDiagnostics( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L)) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile( + new VirtualMachineScaleSetOSProfile() + .withComputerNamePrefix("{vmss-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true)))) + .withDiagnosticsProfile( + new DiagnosticsProfile() + .withBootDiagnostics( + new BootDiagnostics() + .withEnabled(true) + .withStorageUri("http://{existing-storage-account-name}.blob.core.windows.net")))) + .withOverprovision(true) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromASpecializedSharedImage.json + */ + /** + * Sample code: Create a scale set from a specialized shared image. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAScaleSetFromASpecializedSharedImage( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .define("{vmss-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L)) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) + .withVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference( + new ImageReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk() + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetNetworkConfiguration() + .withName("{vmss-name}") + .withPrimary(true) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetIpConfiguration() + .withName("{vmss-name}") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) + .withEnableIpForwarding(true))))) + .withOverprovision(true) + .create(); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsDeallocateSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsDeallocateSamples.java new file mode 100644 index 0000000000000..c06c3fba2b637 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsDeallocateSamples.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.generated; + +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMInstanceIDs; +import java.util.Arrays; + +/** Samples for VirtualMachineScaleSets Deallocate. */ +public final class VirtualMachineScaleSetsDeallocateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Deallocate_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_Deallocate_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetDeallocateMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .deallocate( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaa", + true, + new VirtualMachineScaleSetVMInstanceIDs().withInstanceIds(Arrays.asList("aaaaaaaaaaaaaaaaa")), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Deallocate_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_Deallocate_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetDeallocateMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .deallocate("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaa", null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsDeleteInstancesSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsDeleteInstancesSamples.java new file mode 100644 index 0000000000000..db03d5b9e2976 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsDeleteInstancesSamples.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.generated; + +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMInstanceRequiredIDs; +import java.util.Arrays; + +/** Samples for VirtualMachineScaleSets DeleteInstances. */ +public final class VirtualMachineScaleSetsDeleteInstancesSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_DeleteInstances_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_DeleteInstances_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetDeleteInstancesMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .deleteInstances( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaa", + new VirtualMachineScaleSetVMInstanceRequiredIDs() + .withInstanceIds(Arrays.asList("aaaaaaaaaaaaaaaaaaaaaaaaa")), + true, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_DeleteInstances_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_DeleteInstances_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetDeleteInstancesMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .deleteInstances( + "rgcompute", + "aaaaaaaaaaaaaaa", + new VirtualMachineScaleSetVMInstanceRequiredIDs() + .withInstanceIds(Arrays.asList("aaaaaaaaaaaaaaaaaaaaaaaaa")), + null, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsDeleteSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsDeleteSamples.java new file mode 100644 index 0000000000000..36379e1cb42e4 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for VirtualMachineScaleSets Delete. */ +public final class VirtualMachineScaleSetsDeleteSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Delete_Force.json + */ + /** + * Sample code: Force Delete a VM scale set. + * + * @param manager Entry point to ComputeManager. + */ + public static void forceDeleteAVMScaleSet(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .delete("myResourceGroup", "myvmScaleSet", true, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkSamples.java new file mode 100644 index 0000000000000..f21a735b51d7a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkSamples.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.generated; + +/** Samples for VirtualMachineScaleSets ForceRecoveryServiceFabricPlatformUpdateDomainWalk. */ +public final class VirtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ForceRecoveryServiceFabricPlatformUpdateDomainWalk_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_ForceRecoveryServiceFabricPlatformUpdateDomainWalk_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetForceRecoveryServiceFabricPlatformUpdateDomainWalkMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .forceRecoveryServiceFabricPlatformUpdateDomainWalkWithResponse( + "rgcompute", "aaaaaaaaaaaa", 9, null, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ForceRecoveryServiceFabricPlatformUpdateDomainWalk_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_ForceRecoveryServiceFabricPlatformUpdateDomainWalk_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetForceRecoveryServiceFabricPlatformUpdateDomainWalkMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .forceRecoveryServiceFabricPlatformUpdateDomainWalkWithResponse( + "rgcompute", "aaaaaaaaaaaaaaaa", 30, null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsGetByResourceGroupSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..ff2ecc1b094ce --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsGetByResourceGroupSamples.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.generated; + +import com.azure.resourcemanager.compute.generated.models.ExpandTypesForGetVMScaleSets; + +/** Samples for VirtualMachineScaleSets GetByResourceGroup. */ +public final class VirtualMachineScaleSetsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_AutoPlacedOnDedicatedHostGroup.json + */ + /** + * Sample code: Get a virtual machine scale set placed on a dedicated host group through automatic placement. + * + * @param manager Entry point to ComputeManager. + */ + public static void getAVirtualMachineScaleSetPlacedOnADedicatedHostGroupThroughAutomaticPlacement( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .getByResourceGroupWithResponse( + "myResourceGroup", "myVirtualMachineScaleSet", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get.json + */ + /** + * Sample code: Get a virtual machine scale set. + * + * @param manager Entry point to ComputeManager. + */ + public static void getAVirtualMachineScaleSet(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .getByResourceGroupWithResponse( + "myResourceGroup", "myVirtualMachineScaleSet", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_WithUserData.json + */ + /** + * Sample code: Get a virtual machine scale set with UserData. + * + * @param manager Entry point to ComputeManager. + */ + public static void getAVirtualMachineScaleSetWithUserData( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .getByResourceGroupWithResponse( + "myResourceGroup", + "myVirtualMachineScaleSet", + ExpandTypesForGetVMScaleSets.USER_DATA, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_WithDiskControllerType.json + */ + /** + * Sample code: Get VM scale set VM with Disk Controller Type. + * + * @param manager Entry point to ComputeManager. + */ + public static void getVMScaleSetVMWithDiskControllerType( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .getByResourceGroupWithResponse( + "myResourceGroup", + "myVirtualMachineScaleSet", + ExpandTypesForGetVMScaleSets.USER_DATA, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsGetInstanceViewSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsGetInstanceViewSamples.java new file mode 100644 index 0000000000000..5a180e3f49093 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsGetInstanceViewSamples.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.generated; + +/** Samples for VirtualMachineScaleSets GetInstanceView. */ +public final class VirtualMachineScaleSetsGetInstanceViewSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_GetInstanceView_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_GetInstanceView_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetGetInstanceViewMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .getInstanceViewWithResponse("rgcompute", "aaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_GetInstanceView_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_GetInstanceView_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetGetInstanceViewMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .getInstanceViewWithResponse("rgcompute", "aaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsGetOSUpgradeHistorySamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsGetOSUpgradeHistorySamples.java new file mode 100644 index 0000000000000..0c8a74b542e9b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsGetOSUpgradeHistorySamples.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.generated; + +/** Samples for VirtualMachineScaleSets GetOSUpgradeHistory. */ +public final class VirtualMachineScaleSetsGetOSUpgradeHistorySamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_GetOSUpgradeHistory_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_GetOSUpgradeHistory_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetGetOSUpgradeHistoryMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .getOSUpgradeHistory("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_GetOSUpgradeHistory_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_GetOSUpgradeHistory_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetGetOSUpgradeHistoryMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachineScaleSets().getOSUpgradeHistory("rgcompute", "aaaaaa", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsListByLocationSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsListByLocationSamples.java new file mode 100644 index 0000000000000..5893086484e17 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsListByLocationSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for VirtualMachineScaleSets ListByLocation. */ +public final class VirtualMachineScaleSetsListByLocationSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListBySubscription_ByLocation.json + */ + /** + * Sample code: Lists all the VM scale sets under the specified subscription for the specified location. + * + * @param manager Entry point to ComputeManager. + */ + public static void listsAllTheVMScaleSetsUnderTheSpecifiedSubscriptionForTheSpecifiedLocation( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachineScaleSets().listByLocation("eastus", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsListByResourceGroupSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsListByResourceGroupSamples.java new file mode 100644 index 0000000000000..c0d7c630e6d3d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsListByResourceGroupSamples.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.generated; + +/** Samples for VirtualMachineScaleSets ListByResourceGroup. */ +public final class VirtualMachineScaleSetsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_List_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_List_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetListMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachineScaleSets().listByResourceGroup("rgcompute", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_List_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_List_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetListMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachineScaleSets().listByResourceGroup("rgcompute", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsListSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsListSamples.java new file mode 100644 index 0000000000000..1eb58f8c05e9f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsListSamples.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.generated; + +/** Samples for VirtualMachineScaleSets List. */ +public final class VirtualMachineScaleSetsListSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListAll_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_ListAll_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetListAllMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachineScaleSets().list(com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListAll_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_ListAll_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetListAllMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachineScaleSets().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsListSkusSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsListSkusSamples.java new file mode 100644 index 0000000000000..28fa17bd42c0f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsListSkusSamples.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.generated; + +/** Samples for VirtualMachineScaleSets ListSkus. */ +public final class VirtualMachineScaleSetsListSkusSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListSkus_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_ListSkus_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetListSkusMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachineScaleSets().listSkus("rgcompute", "aaaaaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListSkus_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_ListSkus_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetListSkusMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachineScaleSets().listSkus("rgcompute", "aaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsPerformMaintenanceSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsPerformMaintenanceSamples.java new file mode 100644 index 0000000000000..a29f9158b116b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsPerformMaintenanceSamples.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.generated; + +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMInstanceIDs; +import java.util.Arrays; + +/** Samples for VirtualMachineScaleSets PerformMaintenance. */ +public final class VirtualMachineScaleSetsPerformMaintenanceSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_PerformMaintenance_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_PerformMaintenance_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetPerformMaintenanceMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachineScaleSets().performMaintenance("rgcompute", "aa", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_PerformMaintenance_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_PerformMaintenance_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetPerformMaintenanceMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .performMaintenance( + "rgcompute", + "aaaaaaaaaaa", + new VirtualMachineScaleSetVMInstanceIDs().withInstanceIds(Arrays.asList("aaaaaaaaaaaaaaaaa")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsPowerOffSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsPowerOffSamples.java new file mode 100644 index 0000000000000..dd957fb1223ee --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsPowerOffSamples.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.generated; + +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMInstanceIDs; +import java.util.Arrays; + +/** Samples for VirtualMachineScaleSets PowerOff. */ +public final class VirtualMachineScaleSetsPowerOffSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_PowerOff_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_PowerOff_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetPowerOffMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachineScaleSets().powerOff("rgcompute", "a", null, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_PowerOff_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_PowerOff_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetPowerOffMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .powerOff( + "rgcompute", + "aaaaaaaaaaaaaaaaaa", + true, + new VirtualMachineScaleSetVMInstanceIDs().withInstanceIds(Arrays.asList("aaaaaaaaaaaaaaaaa")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsReapplySamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsReapplySamples.java new file mode 100644 index 0000000000000..24fc671e042fb --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsReapplySamples.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.generated; + +/** Samples for VirtualMachineScaleSets Reapply. */ +public final class VirtualMachineScaleSetsReapplySamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Reapply_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSets_Reapply_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetsReapplyMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .reapply( + "VirtualMachineScaleSetReapplyTestRG", "VMSSReapply-Test-ScaleSet", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Reapply_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSets_Reapply_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetsReapplyMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .reapply( + "VirtualMachineScaleSetReapplyTestRG", "VMSSReapply-Test-ScaleSet", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsRedeploySamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsRedeploySamples.java new file mode 100644 index 0000000000000..6cbb9f3c95da7 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsRedeploySamples.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.generated; + +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMInstanceIDs; +import java.util.Arrays; + +/** Samples for VirtualMachineScaleSets Redeploy. */ +public final class VirtualMachineScaleSetsRedeploySamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Redeploy_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_Redeploy_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetRedeployMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .redeploy("rgcompute", "aaaaaaaaaaaaaaaaaaaaaa", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Redeploy_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_Redeploy_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetRedeployMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .redeploy( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + new VirtualMachineScaleSetVMInstanceIDs().withInstanceIds(Arrays.asList("aaaaaaaaaaaaaaaaa")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsReimageAllSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsReimageAllSamples.java new file mode 100644 index 0000000000000..f82ac41996e9e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsReimageAllSamples.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.generated; + +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMInstanceIDs; +import java.util.Arrays; + +/** Samples for VirtualMachineScaleSets ReimageAll. */ +public final class VirtualMachineScaleSetsReimageAllSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ReimageAll_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_ReimageAll_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetReimageAllMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .reimageAll( + "rgcompute", + "aaaaaaaaaaaa", + new VirtualMachineScaleSetVMInstanceIDs().withInstanceIds(Arrays.asList("aaaaaaaaaaaaaaaaa")), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ReimageAll_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_ReimageAll_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetReimageAllMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .reimageAll("rgcompute", "aaaaaaaaaaaaaaaaaaaaaa", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsReimageSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsReimageSamples.java new file mode 100644 index 0000000000000..e791c63b24079 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsReimageSamples.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.generated; + +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetReimageParameters; +import java.util.Arrays; + +/** Samples for VirtualMachineScaleSets Reimage. */ +public final class VirtualMachineScaleSetsReimageSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Reimage_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_Reimage_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetReimageMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .reimage("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaaa", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Reimage_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_Reimage_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetReimageMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .reimage( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaaaa", + new VirtualMachineScaleSetReimageParameters() + .withTempDisk(true) + .withInstanceIds(Arrays.asList("aaaaaaaaaa")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsRestartSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsRestartSamples.java new file mode 100644 index 0000000000000..2aa5096a5bb61 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsRestartSamples.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.generated; + +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMInstanceIDs; +import java.util.Arrays; + +/** Samples for VirtualMachineScaleSets Restart. */ +public final class VirtualMachineScaleSetsRestartSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Restart_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_Restart_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetRestartMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .restart( + "rgcompute", + "aaaaaaaaaaaaaaaaaaa", + new VirtualMachineScaleSetVMInstanceIDs().withInstanceIds(Arrays.asList("aaaaaaaaaaaaaaaaa")), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Restart_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_Restart_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetRestartMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachineScaleSets().restart("rgcompute", "aaaa", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsSetOrchestrationServiceStateSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsSetOrchestrationServiceStateSamples.java new file mode 100644 index 0000000000000..453c1c48cbec9 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsSetOrchestrationServiceStateSamples.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.generated; + +import com.azure.resourcemanager.compute.generated.models.OrchestrationServiceNames; +import com.azure.resourcemanager.compute.generated.models.OrchestrationServiceStateAction; +import com.azure.resourcemanager.compute.generated.models.OrchestrationServiceStateInput; + +/** Samples for VirtualMachineScaleSets SetOrchestrationServiceState. */ +public final class VirtualMachineScaleSetsSetOrchestrationServiceStateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_SetOrchestrationServiceState_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_SetOrchestrationServiceState_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetSetOrchestrationServiceStateMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .setOrchestrationServiceState( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaa", + new OrchestrationServiceStateInput() + .withServiceName(OrchestrationServiceNames.AUTOMATIC_REPAIRS) + .withAction(OrchestrationServiceStateAction.RESUME), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_SetOrchestrationServiceState_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_SetOrchestrationServiceState_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetSetOrchestrationServiceStateMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .setOrchestrationServiceState( + "rgcompute", + "aaaaaaaaaaaaaaaa", + new OrchestrationServiceStateInput() + .withServiceName(OrchestrationServiceNames.AUTOMATIC_REPAIRS) + .withAction(OrchestrationServiceStateAction.RESUME), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsStartSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsStartSamples.java new file mode 100644 index 0000000000000..36a20c602f7d4 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsStartSamples.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.generated; + +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMInstanceIDs; +import java.util.Arrays; + +/** Samples for VirtualMachineScaleSets Start. */ +public final class VirtualMachineScaleSetsStartSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Start_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_Start_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetStartMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .start("rgcompute", "aaaaaaaaaaaaaaaaaaa", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Start_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_Start_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetStartMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .start( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaa", + new VirtualMachineScaleSetVMInstanceIDs().withInstanceIds(Arrays.asList("aaaaaaaaaaaaaaaaa")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsUpdateInstancesSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsUpdateInstancesSamples.java new file mode 100644 index 0000000000000..ea0e71bd58724 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsUpdateInstancesSamples.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.generated; + +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMInstanceRequiredIDs; +import java.util.Arrays; + +/** Samples for VirtualMachineScaleSets UpdateInstances. */ +public final class VirtualMachineScaleSetsUpdateInstancesSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_UpdateInstances_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_UpdateInstances_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetUpdateInstancesMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .updateInstances( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + new VirtualMachineScaleSetVMInstanceRequiredIDs() + .withInstanceIds(Arrays.asList("aaaaaaaaaaaaaaaaaaaaaaaaa")), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_UpdateInstances_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_UpdateInstances_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetUpdateInstancesMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachineScaleSets() + .updateInstances( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaa", + new VirtualMachineScaleSetVMInstanceRequiredIDs() + .withInstanceIds(Arrays.asList("aaaaaaaaaaaaaaaaaaaaaaaaa")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsUpdateSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsUpdateSamples.java new file mode 100644 index 0000000000000..deee721d239ae --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineScaleSetsUpdateSamples.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.generated; + +import com.azure.core.management.SubResource; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetExtensionInner; +import com.azure.resourcemanager.compute.generated.models.AdditionalCapabilities; +import com.azure.resourcemanager.compute.generated.models.AdditionalUnattendContent; +import com.azure.resourcemanager.compute.generated.models.ApiEntityReference; +import com.azure.resourcemanager.compute.generated.models.AutomaticOSUpgradePolicy; +import com.azure.resourcemanager.compute.generated.models.AutomaticRepairsPolicy; +import com.azure.resourcemanager.compute.generated.models.BillingProfile; +import com.azure.resourcemanager.compute.generated.models.BootDiagnostics; +import com.azure.resourcemanager.compute.generated.models.CachingTypes; +import com.azure.resourcemanager.compute.generated.models.ComponentNames; +import com.azure.resourcemanager.compute.generated.models.DeleteOptions; +import com.azure.resourcemanager.compute.generated.models.DiagnosticsProfile; +import com.azure.resourcemanager.compute.generated.models.DiskCreateOptionTypes; +import com.azure.resourcemanager.compute.generated.models.DiskEncryptionSetParameters; +import com.azure.resourcemanager.compute.generated.models.ImageReference; +import com.azure.resourcemanager.compute.generated.models.IpVersion; +import com.azure.resourcemanager.compute.generated.models.LinuxConfiguration; +import com.azure.resourcemanager.compute.generated.models.LinuxPatchAssessmentMode; +import com.azure.resourcemanager.compute.generated.models.LinuxPatchSettings; +import com.azure.resourcemanager.compute.generated.models.LinuxVMGuestPatchMode; +import com.azure.resourcemanager.compute.generated.models.NetworkApiVersion; +import com.azure.resourcemanager.compute.generated.models.PassNames; +import com.azure.resourcemanager.compute.generated.models.PatchSettings; +import com.azure.resourcemanager.compute.generated.models.Plan; +import com.azure.resourcemanager.compute.generated.models.ProtocolTypes; +import com.azure.resourcemanager.compute.generated.models.ResourceIdentityType; +import com.azure.resourcemanager.compute.generated.models.RollingUpgradePolicy; +import com.azure.resourcemanager.compute.generated.models.ScaleInPolicy; +import com.azure.resourcemanager.compute.generated.models.ScheduledEventsProfile; +import com.azure.resourcemanager.compute.generated.models.SecurityProfile; +import com.azure.resourcemanager.compute.generated.models.SecurityTypes; +import com.azure.resourcemanager.compute.generated.models.SettingNames; +import com.azure.resourcemanager.compute.generated.models.Sku; +import com.azure.resourcemanager.compute.generated.models.SshConfiguration; +import com.azure.resourcemanager.compute.generated.models.SshPublicKey; +import com.azure.resourcemanager.compute.generated.models.StorageAccountTypes; +import com.azure.resourcemanager.compute.generated.models.TerminateNotificationProfile; +import com.azure.resourcemanager.compute.generated.models.UefiSettings; +import com.azure.resourcemanager.compute.generated.models.UpgradeMode; +import com.azure.resourcemanager.compute.generated.models.UpgradePolicy; +import com.azure.resourcemanager.compute.generated.models.UserAssignedIdentitiesValue; +import com.azure.resourcemanager.compute.generated.models.VaultCertificate; +import com.azure.resourcemanager.compute.generated.models.VaultSecretGroup; +import com.azure.resourcemanager.compute.generated.models.VirtualHardDisk; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSet; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetDataDisk; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetExtensionProfile; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetIdentity; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetManagedDiskParameters; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetNetworkConfigurationDnsSettings; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetScaleInRules; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetUpdateIpConfiguration; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetUpdateNetworkConfiguration; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetUpdateNetworkProfile; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetUpdateOSDisk; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetUpdateOSProfile; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetUpdatePublicIpAddressConfiguration; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetUpdateStorageProfile; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetUpdateVMProfile; +import com.azure.resourcemanager.compute.generated.models.WinRMConfiguration; +import com.azure.resourcemanager.compute.generated.models.WinRMListener; +import com.azure.resourcemanager.compute.generated.models.WindowsConfiguration; +import com.azure.resourcemanager.compute.generated.models.WindowsPatchAssessmentMode; +import com.azure.resourcemanager.compute.generated.models.WindowsVMGuestPatchAutomaticByPlatformRebootSetting; +import com.azure.resourcemanager.compute.generated.models.WindowsVMGuestPatchAutomaticByPlatformSettings; +import com.azure.resourcemanager.compute.generated.models.WindowsVMGuestPatchMode; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for VirtualMachineScaleSets Update. */ +public final class VirtualMachineScaleSetsUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Update_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_Update_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetUpdateMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + VirtualMachineScaleSet resource = + manager + .virtualMachineScaleSets() + .getByResourceGroupWithResponse("rgcompute", "aaaaaaaaaaaaaa", null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update().apply(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Update_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineScaleSet_Update_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineScaleSetUpdateMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) throws IOException { + VirtualMachineScaleSet resource = + manager + .virtualMachineScaleSets() + .getByResourceGroupWithResponse("rgcompute", "aaaaaaaaaaaaa", null, com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("key246", "aaaaaaaaaaaaaaaaaaaaaaaa")) + .withSku(new Sku().withName("DSv3-Type1").withTier("aaa").withCapacity(7L)) + .withPlan( + new Plan() + .withName("windows2016") + .withPublisher("microsoft-ads") + .withProduct("windows-data-science-vm") + .withPromotionCode("fakeTokenPlaceholder")) + .withIdentity( + new VirtualMachineScaleSetIdentity() + .withType(ResourceIdentityType.SYSTEM_ASSIGNED) + .withUserAssignedIdentities(mapOf("key3951", new UserAssignedIdentitiesValue()))) + .withUpgradePolicy( + new UpgradePolicy() + .withMode(UpgradeMode.MANUAL) + .withRollingUpgradePolicy( + new RollingUpgradePolicy() + .withMaxBatchInstancePercent(49) + .withMaxUnhealthyInstancePercent(81) + .withMaxUnhealthyUpgradedInstancePercent(98) + .withPauseTimeBetweenBatches("aaaaaaaaaaaaaaa") + .withEnableCrossZoneUpgrade(true) + .withPrioritizeUnhealthyInstances(true) + .withRollbackFailedInstancesOnPolicyBreach(true) + .withMaxSurge(true)) + .withAutomaticOSUpgradePolicy( + new AutomaticOSUpgradePolicy() + .withEnableAutomaticOSUpgrade(true) + .withDisableAutomaticRollback(true))) + .withAutomaticRepairsPolicy(new AutomaticRepairsPolicy().withEnabled(true).withGracePeriod("PT30M")) + .withVirtualMachineProfile( + new VirtualMachineScaleSetUpdateVMProfile() + .withOsProfile( + new VirtualMachineScaleSetUpdateOSProfile() + .withCustomData("aaaaaaaaaaaaaaaaaaaaaaaaaa") + .withWindowsConfiguration( + new WindowsConfiguration() + .withProvisionVMAgent(true) + .withEnableAutomaticUpdates(true) + .withTimeZone("aaaaaaaaaaaaaaaa") + .withAdditionalUnattendContent( + Arrays + .asList( + new AdditionalUnattendContent() + .withPassName(PassNames.OOBE_SYSTEM) + .withComponentName(ComponentNames.MICROSOFT_WINDOWS_SHELL_SETUP) + .withSettingName(SettingNames.AUTO_LOGON) + .withContent("aaaaaaaaaaaaaaaaaaaa"))) + .withPatchSettings( + new PatchSettings() + .withPatchMode(WindowsVMGuestPatchMode.AUTOMATIC_BY_PLATFORM) + .withEnableHotpatching(true) + .withAssessmentMode(WindowsPatchAssessmentMode.IMAGE_DEFAULT) + .withAutomaticByPlatformSettings( + new WindowsVMGuestPatchAutomaticByPlatformSettings() + .withRebootSetting( + WindowsVMGuestPatchAutomaticByPlatformRebootSetting.NEVER))) + .withWinRM( + new WinRMConfiguration() + .withListeners( + Arrays + .asList( + new WinRMListener() + .withProtocol(ProtocolTypes.HTTP) + .withCertificateUrl("aaaaaaaaaaaaaaaaaaaaaa"))))) + .withLinuxConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSsh( + new SshConfiguration() + .withPublicKeys( + Arrays + .asList( + new SshPublicKey() + .withPath("/home/{your-username}/.ssh/authorized_keys") + .withKeyData("fakeTokenPlaceholder")))) + .withProvisionVMAgent(true) + .withPatchSettings( + new LinuxPatchSettings() + .withPatchMode(LinuxVMGuestPatchMode.IMAGE_DEFAULT) + .withAssessmentMode(LinuxPatchAssessmentMode.IMAGE_DEFAULT))) + .withSecrets( + Arrays + .asList( + new VaultSecretGroup() + .withSourceVault( + new SubResource() + .withId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}")) + .withVaultCertificates( + Arrays + .asList( + new VaultCertificate() + .withCertificateUrl("aaaaaaa") + .withCertificateStore("aaaaaaaaaaaaaaaaaaaaaaaaa")))))) + .withStorageProfile( + new VirtualMachineScaleSetUpdateStorageProfile() + .withImageReference( + new ImageReference() + .withId("aaaaaaaaaaaaaaaaaaa") + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest") + .withSharedGalleryImageId("aaaaaa")) + .withOsDisk( + new VirtualMachineScaleSetUpdateOSDisk() + .withCaching(CachingTypes.READ_WRITE) + .withWriteAcceleratorEnabled(true) + .withDiskSizeGB(6) + .withImage( + new VirtualHardDisk() + .withUri( + "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk.vhd")) + .withVhdContainers(Arrays.asList("aa")) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS) + .withDiskEncryptionSet( + new DiskEncryptionSetParameters().withId("aaaaaaaaaaaa")))) + .withDataDisks( + Arrays + .asList( + new VirtualMachineScaleSetDataDisk() + .withName("aaaaaaaaaaaaaaaaaaaaaaaaaa") + .withLun(26) + .withCaching(CachingTypes.NONE) + .withWriteAcceleratorEnabled(true) + .withCreateOption(DiskCreateOptionTypes.EMPTY) + .withDiskSizeGB(1023) + .withManagedDisk( + new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS) + .withDiskEncryptionSet( + new DiskEncryptionSetParameters().withId("aaaaaaaaaaaa"))) + .withDiskIopsReadWrite(28L) + .withDiskMBpsReadWrite(15L)))) + .withNetworkProfile( + new VirtualMachineScaleSetUpdateNetworkProfile() + .withHealthProbe( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/disk123")) + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetUpdateNetworkConfiguration() + .withName("aaaaaaaa") + .withPrimary(true) + .withEnableAcceleratedNetworking(true) + .withEnableFpga(true) + .withNetworkSecurityGroup( + new SubResource() + .withId( + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot")) + .withDnsSettings( + new VirtualMachineScaleSetNetworkConfigurationDnsSettings() + .withDnsServers(Arrays.asList())) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineScaleSetUpdateIpConfiguration() + .withName("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa") + .withSubnet( + new ApiEntityReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/disk123")) + .withPrimary(true) + .withPublicIpAddressConfiguration( + new VirtualMachineScaleSetUpdatePublicIpAddressConfiguration() + .withName("a") + .withIdleTimeoutInMinutes(3) + .withDnsSettings( + new VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings() + .withDomainNameLabel("aaaaaaaaaaaaaaaaaa")) + .withDeleteOption(DeleteOptions.DELETE)) + .withPrivateIpAddressVersion(IpVersion.IPV4) + .withApplicationGatewayBackendAddressPools( + Arrays + .asList( + new SubResource() + .withId( + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"))) + .withApplicationSecurityGroups( + Arrays + .asList( + new SubResource() + .withId( + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"))) + .withLoadBalancerBackendAddressPools( + Arrays + .asList( + new SubResource() + .withId( + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"))) + .withLoadBalancerInboundNatPools( + Arrays + .asList( + new SubResource() + .withId( + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"))))) + .withEnableIpForwarding(true) + .withDeleteOption(DeleteOptions.DELETE))) + .withNetworkApiVersion(NetworkApiVersion.TWO_ZERO_TWO_ZERO_ONE_ONE_ZERO_ONE)) + .withSecurityProfile( + new SecurityProfile() + .withUefiSettings(new UefiSettings().withSecureBootEnabled(true).withVTpmEnabled(true)) + .withEncryptionAtHost(true) + .withSecurityType(SecurityTypes.TRUSTED_LAUNCH)) + .withDiagnosticsProfile( + new DiagnosticsProfile() + .withBootDiagnostics( + new BootDiagnostics() + .withEnabled(true) + .withStorageUri("http://{existing-storage-account-name}.blob.core.windows.net"))) + .withExtensionProfile( + new VirtualMachineScaleSetExtensionProfile() + .withExtensions( + Arrays + .asList( + new VirtualMachineScaleSetExtensionInner() + .withName("{extension-name}") + .withForceUpdateTag("aaaaaaaaa") + .withPublisher("{extension-Publisher}") + .withTypePropertiesType("{extension-Type}") + .withTypeHandlerVersion("{handler-version}") + .withAutoUpgradeMinorVersion(true) + .withEnableAutomaticUpgrade(true) + .withSettings( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .withProtectedSettings( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .withProvisionAfterExtensions(Arrays.asList("aa")) + .withSuppressFailures(true))) + .withExtensionsTimeBudget("PT1H20M")) + .withLicenseType("aaaaaaaaaaaa") + .withBillingProfile(new BillingProfile().withMaxPrice(-1.0D)) + .withScheduledEventsProfile( + new ScheduledEventsProfile() + .withTerminateNotificationProfile( + new TerminateNotificationProfile().withNotBeforeTimeout("PT10M").withEnable(true))) + .withUserData("aaaaaaaaaaaaa")) + .withOverprovision(true) + .withDoNotRunExtensionsOnOverprovisionedVMs(true) + .withSinglePlacementGroup(true) + .withAdditionalCapabilities( + new AdditionalCapabilities().withUltraSsdEnabled(true).withHibernationEnabled(true)) + .withScaleInPolicy( + new ScaleInPolicy() + .withRules(Arrays.asList(VirtualMachineScaleSetScaleInRules.OLDEST_VM)) + .withForceDeletion(true)) + .withProximityPlacementGroup( + new SubResource() + .withId( + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot")) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineSizesListSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineSizesListSamples.java new file mode 100644 index 0000000000000..4113e55fb3171 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachineSizesListSamples.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.generated; + +/** Samples for VirtualMachineSizes List. */ +public final class VirtualMachineSizesListSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/computeRPCommonExamples/VirtualMachineSizes_List_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachineSizes_List_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineSizesListMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachineSizes().list("._..", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/computeRPCommonExamples/VirtualMachineSizes_List_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachineSizes_List_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineSizesListMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachineSizes().list("-e", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesAssessPatchesSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesAssessPatchesSamples.java new file mode 100644 index 0000000000000..7add48434be1c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesAssessPatchesSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for VirtualMachines AssessPatches. */ +public final class VirtualMachinesAssessPatchesSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_AssessPatches.json + */ + /** + * Sample code: Assess patch state of a virtual machine. + * + * @param manager Entry point to ComputeManager. + */ + public static void assessPatchStateOfAVirtualMachine( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachines().assessPatches("myResourceGroupName", "myVMName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesCaptureSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesCaptureSamples.java new file mode 100644 index 0000000000000..cd0de5eb795f8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesCaptureSamples.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.generated; + +import com.azure.resourcemanager.compute.generated.models.VirtualMachineCaptureParameters; + +/** Samples for VirtualMachines Capture. */ +public final class VirtualMachinesCaptureSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Capture_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachine_Capture_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineCaptureMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .capture( + "rgcompute", + "aaaaaaaaaaaaa", + new VirtualMachineCaptureParameters() + .withVhdPrefix("aaaaaaaaa") + .withDestinationContainerName("aaaaaaa") + .withOverwriteVhds(true), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Capture_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachine_Capture_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineCaptureMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .capture( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaa", + new VirtualMachineCaptureParameters() + .withVhdPrefix("aaaaaaaaa") + .withDestinationContainerName("aaaaaaa") + .withOverwriteVhds(true), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesConvertToManagedDisksSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesConvertToManagedDisksSamples.java new file mode 100644 index 0000000000000..f2bd2bbd58474 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesConvertToManagedDisksSamples.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.generated; + +/** Samples for VirtualMachines ConvertToManagedDisks. */ +public final class VirtualMachinesConvertToManagedDisksSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_ConvertToManagedDisks_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachine_ConvertToManagedDisks_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineConvertToManagedDisksMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachines().convertToManagedDisks("rgcompute", "aaaaaaaaaaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_ConvertToManagedDisks_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachine_ConvertToManagedDisks_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineConvertToManagedDisksMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachines().convertToManagedDisks("rgcompute", "aaaaaaa", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesCreateOrUpdateSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..5734cc3b0b27b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesCreateOrUpdateSamples.java @@ -0,0 +1,2443 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.compute.generated.models.AdditionalCapabilities; +import com.azure.resourcemanager.compute.generated.models.ApplicationProfile; +import com.azure.resourcemanager.compute.generated.models.BootDiagnostics; +import com.azure.resourcemanager.compute.generated.models.CachingTypes; +import com.azure.resourcemanager.compute.generated.models.CapacityReservationProfile; +import com.azure.resourcemanager.compute.generated.models.DataDisk; +import com.azure.resourcemanager.compute.generated.models.DeleteOptions; +import com.azure.resourcemanager.compute.generated.models.DiagnosticsProfile; +import com.azure.resourcemanager.compute.generated.models.DiffDiskOptions; +import com.azure.resourcemanager.compute.generated.models.DiffDiskPlacement; +import com.azure.resourcemanager.compute.generated.models.DiffDiskSettings; +import com.azure.resourcemanager.compute.generated.models.DiskControllerTypes; +import com.azure.resourcemanager.compute.generated.models.DiskCreateOptionTypes; +import com.azure.resourcemanager.compute.generated.models.DiskEncryptionSetParameters; +import com.azure.resourcemanager.compute.generated.models.HardwareProfile; +import com.azure.resourcemanager.compute.generated.models.ImageReference; +import com.azure.resourcemanager.compute.generated.models.LinuxConfiguration; +import com.azure.resourcemanager.compute.generated.models.LinuxPatchAssessmentMode; +import com.azure.resourcemanager.compute.generated.models.LinuxPatchSettings; +import com.azure.resourcemanager.compute.generated.models.LinuxVMGuestPatchAutomaticByPlatformRebootSetting; +import com.azure.resourcemanager.compute.generated.models.LinuxVMGuestPatchAutomaticByPlatformSettings; +import com.azure.resourcemanager.compute.generated.models.LinuxVMGuestPatchMode; +import com.azure.resourcemanager.compute.generated.models.ManagedDiskParameters; +import com.azure.resourcemanager.compute.generated.models.NetworkApiVersion; +import com.azure.resourcemanager.compute.generated.models.NetworkInterfaceReference; +import com.azure.resourcemanager.compute.generated.models.NetworkProfile; +import com.azure.resourcemanager.compute.generated.models.OSDisk; +import com.azure.resourcemanager.compute.generated.models.OSImageNotificationProfile; +import com.azure.resourcemanager.compute.generated.models.OSProfile; +import com.azure.resourcemanager.compute.generated.models.OperatingSystemTypes; +import com.azure.resourcemanager.compute.generated.models.PatchSettings; +import com.azure.resourcemanager.compute.generated.models.Plan; +import com.azure.resourcemanager.compute.generated.models.PublicIpAddressSku; +import com.azure.resourcemanager.compute.generated.models.PublicIpAddressSkuName; +import com.azure.resourcemanager.compute.generated.models.PublicIpAddressSkuTier; +import com.azure.resourcemanager.compute.generated.models.PublicIpAllocationMethod; +import com.azure.resourcemanager.compute.generated.models.ScheduledEventsProfile; +import com.azure.resourcemanager.compute.generated.models.SecurityEncryptionTypes; +import com.azure.resourcemanager.compute.generated.models.SecurityProfile; +import com.azure.resourcemanager.compute.generated.models.SecurityTypes; +import com.azure.resourcemanager.compute.generated.models.SshConfiguration; +import com.azure.resourcemanager.compute.generated.models.SshPublicKey; +import com.azure.resourcemanager.compute.generated.models.StorageAccountTypes; +import com.azure.resourcemanager.compute.generated.models.StorageProfile; +import com.azure.resourcemanager.compute.generated.models.TerminateNotificationProfile; +import com.azure.resourcemanager.compute.generated.models.UefiSettings; +import com.azure.resourcemanager.compute.generated.models.VMDiskSecurityProfile; +import com.azure.resourcemanager.compute.generated.models.VMGalleryApplication; +import com.azure.resourcemanager.compute.generated.models.VMSizeProperties; +import com.azure.resourcemanager.compute.generated.models.VirtualHardDisk; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineNetworkInterfaceConfiguration; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineNetworkInterfaceIpConfiguration; +import com.azure.resourcemanager.compute.generated.models.VirtualMachinePublicIpAddressConfiguration; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineSizeTypes; +import com.azure.resourcemanager.compute.generated.models.WindowsConfiguration; +import com.azure.resourcemanager.compute.generated.models.WindowsPatchAssessmentMode; +import com.azure.resourcemanager.compute.generated.models.WindowsVMGuestPatchAutomaticByPlatformRebootSetting; +import com.azure.resourcemanager.compute.generated.models.WindowsVMGuestPatchAutomaticByPlatformSettings; +import com.azure.resourcemanager.compute.generated.models.WindowsVMGuestPatchMode; +import java.util.Arrays; + +/** Samples for VirtualMachines CreateOrUpdate. */ +public final class VirtualMachinesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_FromASharedGalleryImage.json + */ + /** + * Sample code: Create a VM from a shared gallery image. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVMFromASharedGalleryImage( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withSharedGalleryImageId( + "/SharedGalleries/sharedGalleryName/Images/sharedGalleryImageName/Versions/sharedGalleryImageVersionName")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithVMSizeProperties.json + */ + /** + * Sample code: Create a VM with VM Size Properties. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVMWithVMSizeProperties( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile( + new HardwareProfile() + .withVmSize(VirtualMachineSizeTypes.STANDARD_D4_V3) + .withVmSizeProperties(new VMSizeProperties().withVCpusAvailable(1).withVCpusPerCore(1))) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .withDiagnosticsProfile( + new DiagnosticsProfile() + .withBootDiagnostics( + new BootDiagnostics() + .withEnabled(true) + .withStorageUri("http://{existing-storage-account-name}.blob.core.windows.net"))) + .withUserData("U29tZSBDdXN0b20gRGF0YQ==") + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_PlatformImageVmWithUnmanagedOsAndDataDisks.json + */ + /** + * Sample code: Create a platform-image vm with unmanaged os and data disks. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAPlatformImageVmWithUnmanagedOsAndDataDisks( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("{vm-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D2_V2)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withVhd( + new VirtualHardDisk() + .withUri( + "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk.vhd")) + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)) + .withDataDisks( + Arrays + .asList( + new DataDisk() + .withLun(0) + .withVhd( + new VirtualHardDisk() + .withUri( + "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk0.vhd")) + .withCreateOption(DiskCreateOptionTypes.EMPTY) + .withDiskSizeGB(1023), + new DataDisk() + .withLun(1) + .withVhd( + new VirtualHardDisk() + .withUri( + "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk1.vhd")) + .withCreateOption(DiskCreateOptionTypes.EMPTY) + .withDiskSizeGB(1023)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_LinuxVmWithPatchSettingModesOfAutomaticByPlatform.json + */ + /** + * Sample code: Create a Linux vm with a patch settings patchMode and assessmentMode set to AutomaticByPlatform. + * + * @param manager Entry point to ComputeManager. + */ + public static void createALinuxVmWithAPatchSettingsPatchModeAndAssessmentModeSetToAutomaticByPlatform( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D2S_V3)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("Canonical") + .withOffer("UbuntuServer") + .withSku("16.04-LTS") + .withVersion("latest")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.PREMIUM_LRS)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder") + .withLinuxConfiguration( + new LinuxConfiguration() + .withProvisionVMAgent(true) + .withPatchSettings( + new LinuxPatchSettings() + .withPatchMode(LinuxVMGuestPatchMode.AUTOMATIC_BY_PLATFORM) + .withAssessmentMode(LinuxPatchAssessmentMode.AUTOMATIC_BY_PLATFORM)))) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithADiffOsDiskUsingDiffDiskPlacementAsCacheDisk.json + */ + /** + * Sample code: Create a vm with ephemeral os disk provisioning in Cache disk using placement property. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVmWithEphemeralOsDiskProvisioningInCacheDiskUsingPlacementProperty( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withPlan( + new Plan() + .withName("windows2016") + .withPublisher("microsoft-ads") + .withProduct("windows-data-science-vm")) + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_DS1_V2)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("microsoft-ads") + .withOffer("windows-data-science-vm") + .withSku("windows2016") + .withVersion("latest")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_ONLY) + .withDiffDiskSettings( + new DiffDiskSettings() + .withOption(DiffDiskOptions.LOCAL) + .withPlacement(DiffDiskPlacement.CACHE_DISK)) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithAMarketplaceImagePlan.json + */ + /** + * Sample code: Create a vm with a marketplace image plan. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVmWithAMarketplaceImagePlan( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withPlan( + new Plan() + .withName("windows2016") + .withPublisher("microsoft-ads") + .withProduct("windows-data-science-vm")) + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("microsoft-ads") + .withOffer("windows-data-science-vm") + .withSku("windows2016") + .withVersion("latest")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithPatchSettingModeOfAutomaticByOS.json + */ + /** + * Sample code: Create a Windows vm with a patch setting patchMode of AutomaticByOS. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAWindowsVmWithAPatchSettingPatchModeOfAutomaticByOS( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.PREMIUM_LRS)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder") + .withWindowsConfiguration( + new WindowsConfiguration() + .withProvisionVMAgent(true) + .withEnableAutomaticUpdates(true) + .withPatchSettings( + new PatchSettings().withPatchMode(WindowsVMGuestPatchMode.AUTOMATIC_BY_OS)))) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic") + .withPrimary(true)))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithPatchSettingModesOfAutomaticByPlatform.json + */ + /** + * Sample code: Create a Windows vm with patch settings patchMode and assessmentMode set to AutomaticByPlatform. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAWindowsVmWithPatchSettingsPatchModeAndAssessmentModeSetToAutomaticByPlatform( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.PREMIUM_LRS)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder") + .withWindowsConfiguration( + new WindowsConfiguration() + .withProvisionVMAgent(true) + .withEnableAutomaticUpdates(true) + .withPatchSettings( + new PatchSettings() + .withPatchMode(WindowsVMGuestPatchMode.AUTOMATIC_BY_PLATFORM) + .withAssessmentMode(WindowsPatchAssessmentMode.AUTOMATIC_BY_PLATFORM)))) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithPatchSettingAssessmentModeOfImageDefault.json + */ + /** + * Sample code: Create a Windows vm with a patch setting assessmentMode of ImageDefault. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAWindowsVmWithAPatchSettingAssessmentModeOfImageDefault( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.PREMIUM_LRS)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder") + .withWindowsConfiguration( + new WindowsConfiguration() + .withProvisionVMAgent(true) + .withEnableAutomaticUpdates(true) + .withPatchSettings( + new PatchSettings().withAssessmentMode(WindowsPatchAssessmentMode.IMAGE_DEFAULT)))) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithPremiumStorage.json + */ + /** + * Sample code: Create a vm with premium storage. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVmWithPremiumStorage(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.PREMIUM_LRS)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithCapacityReservation.json + */ + /** + * Sample code: Create or update a VM with capacity reservation. + * + * @param manager Entry point to ComputeManager. + */ + public static void createOrUpdateAVMWithCapacityReservation( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withPlan( + new Plan() + .withName("windows2016") + .withPublisher("microsoft-ads") + .withProduct("windows-data-science-vm")) + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_DS1_V2)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("microsoft-ads") + .withOffer("windows-data-science-vm") + .withSku("windows2016") + .withVersion("latest")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_ONLY) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .withCapacityReservation( + new CapacityReservationProfile() + .withCapacityReservationGroup( + new SubResource() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/CapacityReservationGroups/{crgName}"))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_LinuxVmWithPatchSettingAssessmentModeOfImageDefault.json + */ + /** + * Sample code: Create a Linux vm with a patch setting assessmentMode of ImageDefault. + * + * @param manager Entry point to ComputeManager. + */ + public static void createALinuxVmWithAPatchSettingAssessmentModeOfImageDefault( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D2S_V3)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("Canonical") + .withOffer("UbuntuServer") + .withSku("16.04-LTS") + .withVersion("latest")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.PREMIUM_LRS)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder") + .withLinuxConfiguration( + new LinuxConfiguration() + .withProvisionVMAgent(true) + .withPatchSettings( + new LinuxPatchSettings().withAssessmentMode(LinuxPatchAssessmentMode.IMAGE_DEFAULT)))) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithPatchSettingModeOfAutomaticByPlatformAndEnableHotPatchingTrue.json + */ + /** + * Sample code: Create a Windows vm with a patch setting patchMode of AutomaticByPlatform and enableHotpatching set + * to true. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAWindowsVmWithAPatchSettingPatchModeOfAutomaticByPlatformAndEnableHotpatchingSetToTrue( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.PREMIUM_LRS)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder") + .withWindowsConfiguration( + new WindowsConfiguration() + .withProvisionVMAgent(true) + .withEnableAutomaticUpdates(true) + .withPatchSettings( + new PatchSettings() + .withPatchMode(WindowsVMGuestPatchMode.AUTOMATIC_BY_PLATFORM) + .withEnableHotpatching(true)))) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithExtensionsTimeBudget.json + */ + /** + * Sample code: Create a vm with an extensions time budget. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVmWithAnExtensionsTimeBudget( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .withDiagnosticsProfile( + new DiagnosticsProfile() + .withBootDiagnostics( + new BootDiagnostics() + .withEnabled(true) + .withStorageUri("http://{existing-storage-account-name}.blob.core.windows.net"))) + .withExtensionsTimeBudget("PT30M") + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_CustomImageVmFromAnUnmanagedGeneralizedOsImage.json + */ + /** + * Sample code: Create a custom-image vm from an unmanaged generalized os image. + * + * @param manager Entry point to ComputeManager. + */ + public static void createACustomImageVmFromAnUnmanagedGeneralizedOsImage( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("{vm-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2)) + .withStorageProfile( + new StorageProfile() + .withOsDisk( + new OSDisk() + .withOsType(OperatingSystemTypes.WINDOWS) + .withName("myVMosdisk") + .withVhd( + new VirtualHardDisk() + .withUri( + "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk.vhd")) + .withImage( + new VirtualHardDisk() + .withUri( + "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/{existing-generalized-os-image-blob-name}.vhd")) + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithEncryptionAtHost.json + */ + /** + * Sample code: Create a vm with Host Encryption using encryptionAtHost property. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVmWithHostEncryptionUsingEncryptionAtHostProperty( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withPlan( + new Plan() + .withName("windows2016") + .withPublisher("microsoft-ads") + .withProduct("windows-data-science-vm")) + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_DS1_V2)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("microsoft-ads") + .withOffer("windows-data-science-vm") + .withSku("windows2016") + .withVersion("latest")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_ONLY) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .withSecurityProfile(new SecurityProfile().withEncryptionAtHost(true)) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_InAnAvailabilitySet.json + */ + /** + * Sample code: Create a vm in an availability set. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVmInAnAvailabilitySet( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .withAvailabilitySet( + new SubResource() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/availabilitySets/{existing-availability-set-name}")) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithEmptyDataDisks.json + */ + /** + * Sample code: Create a vm with empty data disks. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVmWithEmptyDataDisks(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D2_V2)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS))) + .withDataDisks( + Arrays + .asList( + new DataDisk() + .withLun(0) + .withCreateOption(DiskCreateOptionTypes.EMPTY) + .withDiskSizeGB(1023), + new DataDisk() + .withLun(1) + .withCreateOption(DiskCreateOptionTypes.EMPTY) + .withDiskSizeGB(1023)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithSecurityTypeConfidentialVM.json + */ + /** + * Sample code: Create a VM with securityType ConfidentialVM with Platform Managed Keys. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVMWithSecurityTypeConfidentialVMWithPlatformManagedKeys( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile( + new HardwareProfile().withVmSize(VirtualMachineSizeTypes.fromString("Standard_DC2as_v5"))) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("2019-datacenter-cvm") + .withSku("windows-cvm") + .withVersion("17763.2183.2109130127")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_ONLY) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_SSD_LRS) + .withSecurityProfile( + new VMDiskSecurityProfile() + .withSecurityEncryptionType( + SecurityEncryptionTypes.DISK_WITH_VMGUEST_STATE))))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .withSecurityProfile( + new SecurityProfile() + .withUefiSettings(new UefiSettings().withSecureBootEnabled(true).withVTpmEnabled(true)) + .withSecurityType(SecurityTypes.CONFIDENTIAL_VM)) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithNetworkInterfaceConfiguration.json + */ + /** + * Sample code: Create a VM with network interface configuration. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVMWithNetworkInterfaceConfiguration( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withNetworkProfile( + new NetworkProfile() + .withNetworkApiVersion(NetworkApiVersion.TWO_ZERO_TWO_ZERO_ONE_ONE_ZERO_ONE) + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualMachineNetworkInterfaceConfiguration() + .withName("{nic-config-name}") + .withPrimary(true) + .withDeleteOption(DeleteOptions.DELETE) + .withIpConfigurations( + Arrays + .asList( + new VirtualMachineNetworkInterfaceIpConfiguration() + .withName("{ip-config-name}") + .withPrimary(true) + .withPublicIpAddressConfiguration( + new VirtualMachinePublicIpAddressConfiguration() + .withName("{publicIP-config-name}") + .withSku( + new PublicIpAddressSku() + .withName(PublicIpAddressSkuName.BASIC) + .withTier(PublicIpAddressSkuTier.GLOBAL)) + .withDeleteOption(DeleteOptions.DETACH) + .withPublicIpAllocationMethod( + PublicIpAllocationMethod.STATIC))))))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_FromACustomImage.json + */ + /** + * Sample code: Create a vm from a custom image. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVmFromACustomImage(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithHibernationEnabled.json + */ + /** + * Sample code: Create a VM with HibernationEnabled. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVMWithHibernationEnabled( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("{vm-name}") + .withRegion("eastus2euap") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D2S_V3)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2019-Datacenter") + .withVersion("latest")) + .withOsDisk( + new OSDisk() + .withName("vmOSdisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withAdditionalCapabilities(new AdditionalCapabilities().withHibernationEnabled(true)) + .withOsProfile( + new OSProfile() + .withComputerName("{vm-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .withDiagnosticsProfile( + new DiagnosticsProfile() + .withBootDiagnostics( + new BootDiagnostics() + .withEnabled(true) + .withStorageUri("http://{existing-storage-account-name}.blob.core.windows.net"))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithUefiSettings.json + */ + /** + * Sample code: Create a VM with Uefi Settings of secureBoot and vTPM. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVMWithUefiSettingsOfSecureBootAndVTPM( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D2S_V3)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("windowsserver-gen2preview-preview") + .withSku("windows10-tvm") + .withVersion("18363.592.2001092016")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_ONLY) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_SSD_LRS)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .withSecurityProfile( + new SecurityProfile() + .withUefiSettings(new UefiSettings().withSecureBootEnabled(true).withVTpmEnabled(true)) + .withSecurityType(SecurityTypes.TRUSTED_LAUNCH)) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithApplicationProfile.json + */ + /** + * Sample code: Create a vm with Application Profile. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVmWithApplicationProfile( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("{image_publisher}") + .withOffer("{image_offer}") + .withSku("{image_sku}") + .withVersion("latest")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .withApplicationProfile( + new ApplicationProfile() + .withGalleryApplications( + Arrays + .asList( + new VMGalleryApplication() + .withTags("myTag1") + .withOrder(1) + .withPackageReferenceId( + "/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdb/resourceGroups/myresourceGroupName2/providers/Microsoft.Compute/galleries/myGallery1/applications/MyApplication1/versions/1.0") + .withConfigurationReference( + "https://mystorageaccount.blob.core.windows.net/configurations/settings.config") + .withTreatFailureAsDeploymentFailure(false) + .withEnableAutomaticUpgrade(false), + new VMGalleryApplication() + .withPackageReferenceId( + "/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdg/resourceGroups/myresourceGroupName3/providers/Microsoft.Compute/galleries/myGallery2/applications/MyApplication2/versions/1.1")))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_FromASpecializedSharedImage.json + */ + /** + * Sample code: Create a vm from a specialized shared image. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVmFromASpecializedSharedImage( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithPasswordAuthentication.json + */ + /** + * Sample code: Create a vm with password authentication. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVmWithPasswordAuthentication( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_InAVmssWithCustomerAssignedPlatformFaultDomain.json + */ + /** + * Sample code: Create a vm in a Virtual Machine Scale Set with customer assigned platformFaultDomain. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVmInAVirtualMachineScaleSetWithCustomerAssignedPlatformFaultDomain( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .withVirtualMachineScaleSet( + new SubResource() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{existing-flex-vmss-name-with-platformFaultDomainCount-greater-than-1}")) + .withPlatformFaultDomain(1) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithScheduledEventsProfile.json + */ + /** + * Sample code: Create a vm with Scheduled Events Profile. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVmWithScheduledEventsProfile( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .withDiagnosticsProfile( + new DiagnosticsProfile() + .withBootDiagnostics( + new BootDiagnostics() + .withEnabled(true) + .withStorageUri("http://{existing-storage-account-name}.blob.core.windows.net"))) + .withScheduledEventsProfile( + new ScheduledEventsProfile() + .withTerminateNotificationProfile( + new TerminateNotificationProfile().withNotBeforeTimeout("PT10M").withEnable(true)) + .withOsImageNotificationProfile( + new OSImageNotificationProfile().withNotBeforeTimeout("PT15M").withEnable(true))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithBootDiagnostics.json + */ + /** + * Sample code: Create a vm with boot diagnostics. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVmWithBootDiagnostics( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .withDiagnosticsProfile( + new DiagnosticsProfile() + .withBootDiagnostics( + new BootDiagnostics() + .withEnabled(true) + .withStorageUri("http://{existing-storage-account-name}.blob.core.windows.net"))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithSshAuthentication.json + */ + /** + * Sample code: Create a vm with ssh authentication. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVmWithSshAuthentication( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("{image_publisher}") + .withOffer("{image_offer}") + .withSku("{image_sku}") + .withVersion("latest")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withLinuxConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSsh( + new SshConfiguration() + .withPublicKeys( + Arrays + .asList( + new SshPublicKey() + .withPath("/home/{your-username}/.ssh/authorized_keys") + .withKeyData("fakeTokenPlaceholder")))))) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_FromACommunityGalleryImage.json + */ + /** + * Sample code: Create a VM from a community gallery image. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVMFromACommunityGalleryImage( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withCommunityGalleryImageId( + "/CommunityGalleries/galleryPublicName/Images/communityGalleryImageName/Versions/communityGalleryImageVersionName")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithADiffOsDiskUsingDiffDiskPlacementAsResourceDisk.json + */ + /** + * Sample code: Create a vm with ephemeral os disk provisioning in Resource disk using placement property. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVmWithEphemeralOsDiskProvisioningInResourceDiskUsingPlacementProperty( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withPlan( + new Plan() + .withName("windows2016") + .withPublisher("microsoft-ads") + .withProduct("windows-data-science-vm")) + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_DS1_V2)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("microsoft-ads") + .withOffer("windows-data-science-vm") + .withSku("windows2016") + .withVersion("latest")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_ONLY) + .withDiffDiskSettings( + new DiffDiskSettings() + .withOption(DiffDiskOptions.LOCAL) + .withPlacement(DiffDiskPlacement.RESOURCE_DISK)) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithADiffOsDisk.json + */ + /** + * Sample code: Create a vm with ephemeral os disk. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVmWithEphemeralOsDisk( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withPlan( + new Plan() + .withName("windows2016") + .withPublisher("microsoft-ads") + .withProduct("windows-data-science-vm")) + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_DS1_V2)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("microsoft-ads") + .withOffer("windows-data-science-vm") + .withSku("windows2016") + .withVersion("latest")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_ONLY) + .withDiffDiskSettings(new DiffDiskSettings().withOption(DiffDiskOptions.LOCAL)) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithUserData.json + */ + /** + * Sample code: Create a VM with UserData. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVMWithUserData(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("{vm-name}") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new OSDisk() + .withName("vmOSdisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withOsProfile( + new OSProfile() + .withComputerName("{vm-name}") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .withDiagnosticsProfile( + new DiagnosticsProfile() + .withBootDiagnostics( + new BootDiagnostics() + .withEnabled(true) + .withStorageUri("http://{existing-storage-account-name}.blob.core.windows.net"))) + .withUserData("RXhhbXBsZSBVc2VyRGF0YQ==") + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_FromAGeneralizedSharedImage.json + */ + /** + * Sample code: Create a vm from a generalized shared image. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVmFromAGeneralizedSharedImage( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_LinuxVmWithAutomaticByPlatformSettings.json + */ + /** + * Sample code: Create a Linux vm with a patch setting patchMode of AutomaticByPlatform and + * AutomaticByPlatformSettings. + * + * @param manager Entry point to ComputeManager. + */ + public static void createALinuxVmWithAPatchSettingPatchModeOfAutomaticByPlatformAndAutomaticByPlatformSettings( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D2S_V3)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("Canonical") + .withOffer("UbuntuServer") + .withSku("16.04-LTS") + .withVersion("latest")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.PREMIUM_LRS)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder") + .withLinuxConfiguration( + new LinuxConfiguration() + .withProvisionVMAgent(true) + .withPatchSettings( + new LinuxPatchSettings() + .withPatchMode(LinuxVMGuestPatchMode.AUTOMATIC_BY_PLATFORM) + .withAssessmentMode(LinuxPatchAssessmentMode.AUTOMATIC_BY_PLATFORM) + .withAutomaticByPlatformSettings( + new LinuxVMGuestPatchAutomaticByPlatformSettings() + .withRebootSetting(LinuxVMGuestPatchAutomaticByPlatformRebootSetting.NEVER) + .withBypassPlatformSafetyChecksOnUserSchedule(true))))) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithPatchSettingModeOfManual.json + */ + /** + * Sample code: Create a Windows vm with a patch setting patchMode of Manual. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAWindowsVmWithAPatchSettingPatchModeOfManual( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.PREMIUM_LRS)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder") + .withWindowsConfiguration( + new WindowsConfiguration() + .withProvisionVMAgent(true) + .withEnableAutomaticUpdates(true) + .withPatchSettings(new PatchSettings().withPatchMode(WindowsVMGuestPatchMode.MANUAL)))) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithSecurityTypeConfidentialVMWithCustomerManagedKeys.json + */ + /** + * Sample code: Create a VM with securityType ConfidentialVM with Customer Managed Keys. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVMWithSecurityTypeConfidentialVMWithCustomerManagedKeys( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile( + new HardwareProfile().withVmSize(VirtualMachineSizeTypes.fromString("Standard_DC2as_v5"))) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("2019-datacenter-cvm") + .withSku("windows-cvm") + .withVersion("17763.2183.2109130127")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_ONLY) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_SSD_LRS) + .withSecurityProfile( + new VMDiskSecurityProfile() + .withSecurityEncryptionType(SecurityEncryptionTypes.DISK_WITH_VMGUEST_STATE) + .withDiskEncryptionSet( + new DiskEncryptionSetParameters() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}")))))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .withSecurityProfile( + new SecurityProfile() + .withUefiSettings(new UefiSettings().withSecureBootEnabled(true).withVTpmEnabled(true)) + .withSecurityType(SecurityTypes.CONFIDENTIAL_VM)) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_LinuxVmWithPatchSettingModeOfImageDefault.json + */ + /** + * Sample code: Create a Linux vm with a patch setting patchMode of ImageDefault. + * + * @param manager Entry point to ComputeManager. + */ + public static void createALinuxVmWithAPatchSettingPatchModeOfImageDefault( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D2S_V3)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("Canonical") + .withOffer("UbuntuServer") + .withSku("16.04-LTS") + .withVersion("latest")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.PREMIUM_LRS)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder") + .withLinuxConfiguration( + new LinuxConfiguration() + .withProvisionVMAgent(true) + .withPatchSettings( + new LinuxPatchSettings().withPatchMode(LinuxVMGuestPatchMode.IMAGE_DEFAULT)))) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithManagedBootDiagnostics.json + */ + /** + * Sample code: Create a vm with managed boot diagnostics. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVmWithManagedBootDiagnostics( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .withDiagnosticsProfile( + new DiagnosticsProfile().withBootDiagnostics(new BootDiagnostics().withEnabled(true))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithDiskEncryptionSetResource.json + */ + /** + * Sample code: Create a vm with DiskEncryptionSet resource id in the os disk and data disk. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVmWithDiskEncryptionSetResourceIdInTheOsDiskAndDataDisk( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS) + .withDiskEncryptionSet( + new DiskEncryptionSetParameters() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}")))) + .withDataDisks( + Arrays + .asList( + new DataDisk() + .withLun(0) + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.EMPTY) + .withDiskSizeGB(1023) + .withManagedDisk( + new ManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS) + .withDiskEncryptionSet( + new DiskEncryptionSetParameters() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"))), + new DataDisk() + .withLun(1) + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.ATTACH) + .withDiskSizeGB(1023) + .withManagedDisk( + new ManagedDiskParameters() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/{existing-managed-disk-name}") + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS) + .withDiskEncryptionSet( + new DiskEncryptionSetParameters() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}")))))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithDiskControllerType.json + */ + /** + * Sample code: Create a VM with Disk Controller Type. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAVMWithDiskControllerType( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D4_V3)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS))) + .withDiskControllerType(DiskControllerTypes.NVME)) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .withDiagnosticsProfile( + new DiagnosticsProfile() + .withBootDiagnostics( + new BootDiagnostics() + .withEnabled(true) + .withStorageUri("http://{existing-storage-account-name}.blob.core.windows.net"))) + .withUserData("U29tZSBDdXN0b20gRGF0YQ==") + .create(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithAutomaticByPlatformSettings.json + */ + /** + * Sample code: Create a Windows vm with a patch setting patchMode of AutomaticByPlatform and + * AutomaticByPlatformSettings. + * + * @param manager Entry point to ComputeManager. + */ + public static void createAWindowsVmWithAPatchSettingPatchModeOfAutomaticByPlatformAndAutomaticByPlatformSettings( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .define("myVM") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.PREMIUM_LRS)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder") + .withWindowsConfiguration( + new WindowsConfiguration() + .withProvisionVMAgent(true) + .withEnableAutomaticUpdates(true) + .withPatchSettings( + new PatchSettings() + .withPatchMode(WindowsVMGuestPatchMode.AUTOMATIC_BY_PLATFORM) + .withAssessmentMode(WindowsPatchAssessmentMode.AUTOMATIC_BY_PLATFORM) + .withAutomaticByPlatformSettings( + new WindowsVMGuestPatchAutomaticByPlatformSettings() + .withRebootSetting( + WindowsVMGuestPatchAutomaticByPlatformRebootSetting.NEVER) + .withBypassPlatformSafetyChecksOnUserSchedule(false))))) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .create(); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesDeallocateSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesDeallocateSamples.java new file mode 100644 index 0000000000000..f1ee192d2d196 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesDeallocateSamples.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.generated; + +/** Samples for VirtualMachines Deallocate. */ +public final class VirtualMachinesDeallocateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Deallocate_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachine_Deallocate_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineDeallocateMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachines().deallocate("rgcompute", "aaaaaaaaaa", true, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Deallocate_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachine_Deallocate_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineDeallocateMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachines().deallocate("rgcompute", "aaaaaaaaaaaaaaaa", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesDeleteSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesDeleteSamples.java new file mode 100644 index 0000000000000..20762e167cb9c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for VirtualMachines Delete. */ +public final class VirtualMachinesDeleteSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Delete_Force.json + */ + /** + * Sample code: Force delete a VM. + * + * @param manager Entry point to ComputeManager. + */ + public static void forceDeleteAVM(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachines().delete("myResourceGroup", "myVM", true, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesGeneralizeSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesGeneralizeSamples.java new file mode 100644 index 0000000000000..5ca83f3aede3b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesGeneralizeSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for VirtualMachines Generalize. */ +public final class VirtualMachinesGeneralizeSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Generalize.json + */ + /** + * Sample code: Generalize a Virtual Machine. + * + * @param manager Entry point to ComputeManager. + */ + public static void generalizeAVirtualMachine(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .generalizeWithResponse("myResourceGroup", "myVMName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesGetByResourceGroupSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..a60f2fc840082 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesGetByResourceGroupSamples.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.generated; + +import com.azure.resourcemanager.compute.generated.models.InstanceViewTypes; + +/** Samples for VirtualMachines GetByResourceGroup. */ +public final class VirtualMachinesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Get_WithVMSizeProperties.json + */ + /** + * Sample code: Get a virtual machine with VM Size Properties. + * + * @param manager Entry point to ComputeManager. + */ + public static void getAVirtualMachineWithVMSizeProperties( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .getByResourceGroupWithResponse("myResourceGroup", "myVM", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Get_AutoPlacedOnDedicatedHostGroup.json + */ + /** + * Sample code: Get a virtual machine placed on a dedicated host group through automatic placement. + * + * @param manager Entry point to ComputeManager. + */ + public static void getAVirtualMachinePlacedOnADedicatedHostGroupThroughAutomaticPlacement( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .getByResourceGroupWithResponse("myResourceGroup", "myVM", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Get_WithDiskControllerType.json + */ + /** + * Sample code: Get a virtual machine with Disk Controller Type Properties. + * + * @param manager Entry point to ComputeManager. + */ + public static void getAVirtualMachineWithDiskControllerTypeProperties( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .getByResourceGroupWithResponse( + "myResourceGroup", "myVM", InstanceViewTypes.USER_DATA, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Get.json + */ + /** + * Sample code: Get a Virtual Machine. + * + * @param manager Entry point to ComputeManager. + */ + public static void getAVirtualMachine(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .getByResourceGroupWithResponse( + "myResourceGroup", "myVM", InstanceViewTypes.USER_DATA, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesInstallPatchesSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesInstallPatchesSamples.java new file mode 100644 index 0000000000000..253f44ca09077 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesInstallPatchesSamples.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.generated; + +import com.azure.resourcemanager.compute.generated.models.VMGuestPatchClassificationWindows; +import com.azure.resourcemanager.compute.generated.models.VMGuestPatchRebootSetting; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineInstallPatchesParameters; +import com.azure.resourcemanager.compute.generated.models.WindowsParameters; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** Samples for VirtualMachines InstallPatches. */ +public final class VirtualMachinesInstallPatchesSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_InstallPatches.json + */ + /** + * Sample code: Install patch state of a virtual machine. + * + * @param manager Entry point to ComputeManager. + */ + public static void installPatchStateOfAVirtualMachine( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .installPatches( + "myResourceGroupName", + "myVMName", + new VirtualMachineInstallPatchesParameters() + .withMaximumDuration("PT4H") + .withRebootSetting(VMGuestPatchRebootSetting.IF_REQUIRED) + .withWindowsParameters( + new WindowsParameters() + .withClassificationsToInclude( + Arrays + .asList( + VMGuestPatchClassificationWindows.CRITICAL, + VMGuestPatchClassificationWindows.SECURITY)) + .withMaxPatchPublishDate(OffsetDateTime.parse("2020-11-19T02:36:43.0539904+00:00"))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesInstanceViewSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesInstanceViewSamples.java new file mode 100644 index 0000000000000..96674e29bd644 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesInstanceViewSamples.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.generated; + +/** Samples for VirtualMachines InstanceView. */ +public final class VirtualMachinesInstanceViewSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Get_InstanceView.json + */ + /** + * Sample code: Get Virtual Machine Instance View. + * + * @param manager Entry point to ComputeManager. + */ + public static void getVirtualMachineInstanceView( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachines().instanceViewWithResponse("myResourceGroup", "myVM", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Get_InstanceViewAutoPlacedOnDedicatedHostGroup.json + */ + /** + * Sample code: Get instance view of a virtual machine placed on a dedicated host group through automatic placement. + * + * @param manager Entry point to ComputeManager. + */ + public static void getInstanceViewOfAVirtualMachinePlacedOnADedicatedHostGroupThroughAutomaticPlacement( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachines().instanceViewWithResponse("myResourceGroup", "myVM", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesListAvailableSizesSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesListAvailableSizesSamples.java new file mode 100644 index 0000000000000..384f18625be8e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesListAvailableSizesSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for VirtualMachines ListAvailableSizes. */ +public final class VirtualMachinesListAvailableSizesSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_ListAvailableVmSizes.json + */ + /** + * Sample code: Lists all available virtual machine sizes to which the specified virtual machine can be resized. + * + * @param manager Entry point to ComputeManager. + */ + public static void listsAllAvailableVirtualMachineSizesToWhichTheSpecifiedVirtualMachineCanBeResized( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachines().listAvailableSizes("myResourceGroup", "myVmName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesListByLocationSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesListByLocationSamples.java new file mode 100644 index 0000000000000..0990af2cf981f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesListByLocationSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for VirtualMachines ListByLocation. */ +public final class VirtualMachinesListByLocationSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_ListBySubscription_ByLocation.json + */ + /** + * Sample code: Lists all the virtual machines under the specified subscription for the specified location. + * + * @param manager Entry point to ComputeManager. + */ + public static void listsAllTheVirtualMachinesUnderTheSpecifiedSubscriptionForTheSpecifiedLocation( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachines().listByLocation("eastus", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesListByResourceGroupSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesListByResourceGroupSamples.java new file mode 100644 index 0000000000000..4e4d2166fe74f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesListByResourceGroupSamples.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.generated; + +/** Samples for VirtualMachines ListByResourceGroup. */ +public final class VirtualMachinesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_List_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachine_List_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineListMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .listByResourceGroup("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaa", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_List_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachine_List_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineListMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachines().listByResourceGroup("rgcompute", null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesListSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesListSamples.java new file mode 100644 index 0000000000000..e6b47f476dafe --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesListSamples.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.generated; + +/** Samples for VirtualMachines List. */ +public final class VirtualMachinesListSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_ListAll_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachine_ListAll_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineListAllMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachines().list(null, null, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_ListAll_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachine_ListAll_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineListAllMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .list("aaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaa", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesPerformMaintenanceSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesPerformMaintenanceSamples.java new file mode 100644 index 0000000000000..d3fa07ac622ea --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesPerformMaintenanceSamples.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.generated; + +/** Samples for VirtualMachines PerformMaintenance. */ +public final class VirtualMachinesPerformMaintenanceSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_PerformMaintenance_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachine_PerformMaintenance_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachinePerformMaintenanceMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachines().performMaintenance("rgcompute", "aaaaaaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_PerformMaintenance_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachine_PerformMaintenance_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachinePerformMaintenanceMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachines().performMaintenance("rgcompute", "aaaaaaaaaa", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesPowerOffSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesPowerOffSamples.java new file mode 100644 index 0000000000000..d820e7931d897 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesPowerOffSamples.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.generated; + +/** Samples for VirtualMachines PowerOff. */ +public final class VirtualMachinesPowerOffSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_PowerOff_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachine_PowerOff_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachinePowerOffMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachines().powerOff("rgcompute", "aaaaaaaaaaaaaaaaaa", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_PowerOff_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachine_PowerOff_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachinePowerOffMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .powerOff("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaa", true, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesReapplySamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesReapplySamples.java new file mode 100644 index 0000000000000..78f5c6ccc6269 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesReapplySamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for VirtualMachines Reapply. */ +public final class VirtualMachinesReapplySamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Reapply.json + */ + /** + * Sample code: Reapply the state of a virtual machine. + * + * @param manager Entry point to ComputeManager. + */ + public static void reapplyTheStateOfAVirtualMachine( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachines().reapply("ResourceGroup", "VMName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesRedeploySamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesRedeploySamples.java new file mode 100644 index 0000000000000..cb2256c799b4d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesRedeploySamples.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.generated; + +/** Samples for VirtualMachines Redeploy. */ +public final class VirtualMachinesRedeploySamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Redeploy_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachine_Redeploy_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineRedeployMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachines().redeploy("rgcompute", "aaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Redeploy_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachine_Redeploy_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineRedeployMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachines().redeploy("rgcompute", "a", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesReimageSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesReimageSamples.java new file mode 100644 index 0000000000000..04adb35cfad3e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesReimageSamples.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.generated; + +import com.azure.resourcemanager.compute.generated.models.OSProfileProvisioningData; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineReimageParameters; + +/** Samples for VirtualMachines Reimage. */ +public final class VirtualMachinesReimageSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Reimage.json + */ + /** + * Sample code: Reimage a Virtual Machine. + * + * @param manager Entry point to ComputeManager. + */ + public static void reimageAVirtualMachine(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .reimage( + "myResourceGroup", + "myVMName", + new VirtualMachineReimageParameters().withTempDisk(true), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Reimage_NonEphemeralVMs.json + */ + /** + * Sample code: Reimage a Non-Ephemeral Virtual Machine. + * + * @param manager Entry point to ComputeManager. + */ + public static void reimageANonEphemeralVirtualMachine( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .reimage( + "myResourceGroup", + "myVMName", + new VirtualMachineReimageParameters() + .withTempDisk(true) + .withExactVersion("aaaaaa") + .withOsProfile( + new OSProfileProvisioningData() + .withAdminPassword("fakeTokenPlaceholder") + .withCustomData("{your-custom-data}")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesRestartSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesRestartSamples.java new file mode 100644 index 0000000000000..cac7e9309ec81 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesRestartSamples.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.generated; + +/** Samples for VirtualMachines Restart. */ +public final class VirtualMachinesRestartSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Restart_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachine_Restart_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineRestartMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachines().restart("rgcompute", "aaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Restart_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachine_Restart_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineRestartMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachines().restart("rgcompute", "aaaaaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesRetrieveBootDiagnosticsDataSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesRetrieveBootDiagnosticsDataSamples.java new file mode 100644 index 0000000000000..f4735a738b014 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesRetrieveBootDiagnosticsDataSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for VirtualMachines RetrieveBootDiagnosticsData. */ +public final class VirtualMachinesRetrieveBootDiagnosticsDataSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_RetrieveBootDiagnosticsData.json + */ + /** + * Sample code: RetrieveBootDiagnosticsData of a virtual machine. + * + * @param manager Entry point to ComputeManager. + */ + public static void retrieveBootDiagnosticsDataOfAVirtualMachine( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .retrieveBootDiagnosticsDataWithResponse("ResourceGroup", "VMName", 60, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesRunCommandSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesRunCommandSamples.java new file mode 100644 index 0000000000000..138be7a8cf444 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesRunCommandSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +import com.azure.resourcemanager.compute.generated.models.RunCommandInput; + +/** Samples for VirtualMachines RunCommand. */ +public final class VirtualMachinesRunCommandSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/runCommandExamples/VirtualMachineRunCommand.json + */ + /** + * Sample code: VirtualMachineRunCommand. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineRunCommand(com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .runCommand( + "crptestar98131", + "vm3036", + new RunCommandInput().withCommandId("RunPowerShellScript"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesSimulateEvictionSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesSimulateEvictionSamples.java new file mode 100644 index 0000000000000..6e8a876fdd9c0 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesSimulateEvictionSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.generated; + +/** Samples for VirtualMachines SimulateEviction. */ +public final class VirtualMachinesSimulateEvictionSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_SimulateEviction.json + */ + /** + * Sample code: Simulate Eviction a virtual machine. + * + * @param manager Entry point to ComputeManager. + */ + public static void simulateEvictionAVirtualMachine( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager + .virtualMachines() + .simulateEvictionWithResponse("ResourceGroup", "VMName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesStartSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesStartSamples.java new file mode 100644 index 0000000000000..994f80af1218f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesStartSamples.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.generated; + +/** Samples for VirtualMachines Start. */ +public final class VirtualMachinesStartSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Start_MinimumSet_Gen.json + */ + /** + * Sample code: VirtualMachine_Start_MinimumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineStartMinimumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachines().start("rgcompute", "aaaaa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Start_MaximumSet_Gen.json + */ + /** + * Sample code: VirtualMachine_Start_MaximumSet_Gen. + * + * @param manager Entry point to ComputeManager. + */ + public static void virtualMachineStartMaximumSetGen( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + manager.virtualMachines().start("rgcompute", "aaaaaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesUpdateSamples.java b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesUpdateSamples.java new file mode 100644 index 0000000000000..f73971684f411 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/samples/java/com/azure/resourcemanager/compute/generated/generated/VirtualMachinesUpdateSamples.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.generated; + +import com.azure.resourcemanager.compute.generated.models.CachingTypes; +import com.azure.resourcemanager.compute.generated.models.DataDisk; +import com.azure.resourcemanager.compute.generated.models.DiskCreateOptionTypes; +import com.azure.resourcemanager.compute.generated.models.DiskDetachOptionTypes; +import com.azure.resourcemanager.compute.generated.models.HardwareProfile; +import com.azure.resourcemanager.compute.generated.models.ImageReference; +import com.azure.resourcemanager.compute.generated.models.ManagedDiskParameters; +import com.azure.resourcemanager.compute.generated.models.NetworkInterfaceReference; +import com.azure.resourcemanager.compute.generated.models.NetworkProfile; +import com.azure.resourcemanager.compute.generated.models.OSDisk; +import com.azure.resourcemanager.compute.generated.models.OSProfile; +import com.azure.resourcemanager.compute.generated.models.StorageAccountTypes; +import com.azure.resourcemanager.compute.generated.models.StorageProfile; +import com.azure.resourcemanager.compute.generated.models.VirtualMachine; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineSizeTypes; +import java.util.Arrays; + +/** Samples for VirtualMachines Update. */ +public final class VirtualMachinesUpdateSamples { + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Update_DetachDataDiskUsingToBeDetachedProperty.json + */ + /** + * Sample code: Update a VM by detaching data disk. + * + * @param manager Entry point to ComputeManager. + */ + public static void updateAVMByDetachingDataDisk( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + VirtualMachine resource = + manager + .virtualMachines() + .getByResourceGroupWithResponse("myResourceGroup", "myVM", null, com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D2_V2)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS))) + .withDataDisks( + Arrays + .asList( + new DataDisk() + .withLun(0) + .withCreateOption(DiskCreateOptionTypes.EMPTY) + .withDiskSizeGB(1023) + .withToBeDetached(true), + new DataDisk() + .withLun(1) + .withCreateOption(DiskCreateOptionTypes.EMPTY) + .withDiskSizeGB(1023) + .withToBeDetached(false)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .apply(); + } + + /* + * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/examples/virtualMachineExamples/VirtualMachine_Update_ForceDetachDataDisk.json + */ + /** + * Sample code: Update a VM by force-detaching data disk. + * + * @param manager Entry point to ComputeManager. + */ + public static void updateAVMByForceDetachingDataDisk( + com.azure.resourcemanager.compute.generated.ComputeManager manager) { + VirtualMachine resource = + manager + .virtualMachines() + .getByResourceGroupWithResponse("myResourceGroup", "myVM", null, com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D2_V2)) + .withStorageProfile( + new StorageProfile() + .withImageReference( + new ImageReference() + .withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer") + .withSku("2016-Datacenter") + .withVersion("latest")) + .withOsDisk( + new OSDisk() + .withName("myVMosdisk") + .withCaching(CachingTypes.READ_WRITE) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withManagedDisk( + new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS))) + .withDataDisks( + Arrays + .asList( + new DataDisk() + .withLun(0) + .withCreateOption(DiskCreateOptionTypes.EMPTY) + .withDiskSizeGB(1023) + .withToBeDetached(true) + .withDetachOption(DiskDetachOptionTypes.FORCE_DETACH), + new DataDisk() + .withLun(1) + .withCreateOption(DiskCreateOptionTypes.EMPTY) + .withDiskSizeGB(1023) + .withToBeDetached(false)))) + .withOsProfile( + new OSProfile() + .withComputerName("myVM") + .withAdminUsername("{your-username}") + .withAdminPassword("fakeTokenPlaceholder")) + .withNetworkProfile( + new NetworkProfile() + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceReference() + .withId( + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") + .withPrimary(true)))) + .apply(); + } +} diff --git a/sdk/compute/ci.yml b/sdk/compute/ci.yml new file mode 100644 index 0000000000000..e096b82fffa75 --- /dev/null +++ b/sdk/compute/ci.yml @@ -0,0 +1,47 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - hotfix/* + - release/* + paths: + include: + - sdk/compute/ci.yml + - sdk/compute/azure-resourcemanager-compute-generated/ + exclude: + - sdk/compute/pom.xml + - sdk/compute/azure-resourcemanager-compute-generated/pom.xml + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/compute/ci.yml + - sdk/compute/azure-resourcemanager-compute-generated/ + exclude: + - sdk/compute/pom.xml + - sdk/compute/azure-resourcemanager-compute-generated/pom.xml + +parameters: + - name: release_azureresourcemanagercomputegenerated + displayName: azure-resourcemanager-compute-generated + type: boolean + default: false + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: compute + EnableBatchRelease: true + Artifacts: + - name: azure-resourcemanager-compute-generated + groupId: com.azure.resourcemanager + safeName: azureresourcemanagercomputegenerated + releaseInBatch: ${{ parameters.release_azureresourcemanagercomputegenerated }} diff --git a/sdk/compute/pom.xml b/sdk/compute/pom.xml new file mode 100644 index 0000000000000..c433acd2e8e64 --- /dev/null +++ b/sdk/compute/pom.xml @@ -0,0 +1,15 @@ + + + 4.0.0 + com.azure + azure-compute-service + pom + 1.0.0 + + + azure-resourcemanager-compute-generated + +